移除nacos
Former-commit-id: 20896519c2664bfc3b1f8a9a7a694134a0b09848
This commit is contained in:
parent
f8a2362a6a
commit
8f7c3b5a7c
114
api/etc/pcm.yaml
114
api/etc/pcm.yaml
|
@ -1,15 +1,99 @@
|
||||||
NacosConfig:
|
Name: pcm.core.api
|
||||||
DataId: pcm-core-api.yaml
|
Host: 0.0.0.0
|
||||||
Group: DEFAULT_GROUP
|
Port: 8999
|
||||||
ServerConfigs:
|
|
||||||
# - IpAddr: 127.0.0.1
|
Timeout: 50000
|
||||||
# Port: 8848
|
|
||||||
- IpAddr: nacos.jcce.dev
|
DB:
|
||||||
Port: 8848
|
DataSource: root:uJpLd6u-J?HC1@(119.45.100.73:3306)/pcm?parseTime=true&loc=Local
|
||||||
ClientConfig:
|
|
||||||
NamespaceId: test
|
Redis:
|
||||||
TimeoutMs: 5000
|
Host: 10.206.0.12:6379
|
||||||
NotLoadCacheAtStart: true
|
Pass: redisPW123
|
||||||
LogDir:
|
|
||||||
CacheDir:
|
Cache:
|
||||||
LogLevel: debug
|
- Host: 10.206.0.12:6379
|
||||||
|
Pass: redisPW123
|
||||||
|
|
||||||
|
# k8s rpc
|
||||||
|
K8sNativeConf:
|
||||||
|
# target: nacos://10.206.0.12:8848/pcm.kubenative.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
Endpoints:
|
||||||
|
- pcm-participant-kubernetes-service:2003
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
THRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.th.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
ModelArtsRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
ModelArtsImgRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
ACRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.ac.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
#rpc
|
||||||
|
CephRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.ceph.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 50000
|
||||||
|
|
||||||
|
OctopusRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.octopus.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
OpenstackRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.openstack.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
# core rpc
|
||||||
|
PcmCoreRpcConf:
|
||||||
|
target: nacos://10.206.0.12:8848/pcm.core.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api
|
||||||
|
# Endpoints:
|
||||||
|
# - 127.0.0.1:8888
|
||||||
|
NonBlock: true
|
||||||
|
Timeout: 20000
|
||||||
|
|
||||||
|
NexusUrl: http://10.101.15.175:8081
|
||||||
|
|
||||||
|
JccScheduleUrl: http://jcce-schedule-service:8082
|
||||||
|
|
||||||
|
|
||||||
|
MinioConf:
|
||||||
|
Secret: minio_xnu122@_
|
||||||
|
AccessKey: minioadmin
|
||||||
|
Endpoint: http://121.89.220.60:9000
|
||||||
|
|
||||||
|
RegistryConf:
|
||||||
|
Username: jointcloudNudt
|
||||||
|
Password: Nudt@123
|
||||||
|
|
||||||
|
SnowflakeConf:
|
||||||
|
MachineId: 1
|
21
api/pcm.go
21
api/pcm.go
|
@ -26,7 +26,6 @@ import (
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/mqs"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/mqs"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
commonConfig "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/helper/nacos"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var configFile = flag.String("f", "api/etc/pcm.yaml", "the config file")
|
var configFile = flag.String("f", "api/etc/pcm.yaml", "the config file")
|
||||||
|
@ -34,26 +33,8 @@ var configFile = flag.String("f", "api/etc/pcm.yaml", "the config file")
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var bootstrapConfig commonConfig.BootstrapConfig
|
|
||||||
conf.MustLoad(*configFile, &bootstrapConfig)
|
|
||||||
|
|
||||||
//解析业务配置
|
|
||||||
var c config.Config
|
var c config.Config
|
||||||
|
conf.MustLoad(*configFile, &c)
|
||||||
nacosConfig := bootstrapConfig.NacosConfig
|
|
||||||
serviceConfigContent := nacosConfig.InitConfig(func(data string) {
|
|
||||||
err := conf.LoadFromYamlBytes([]byte(data), &c)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
err := conf.LoadFromYamlBytes([]byte(serviceConfigContent), &c)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 注册到nacos
|
|
||||||
nacosConfig.DiscoveryRest(&c.RestConf)
|
|
||||||
|
|
||||||
serviceGroup := service.NewServiceGroup()
|
serviceGroup := service.NewServiceGroup()
|
||||||
defer serviceGroup.Stop()
|
defer serviceGroup.Stop()
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
NacosConfig:
|
Name: pcm.core.rpc
|
||||||
DataId: pcm-core-rpc.yaml
|
ListenOn: 0.0.0.0:2004
|
||||||
Group: DEFAULT_GROUP
|
|
||||||
ServerConfigs:
|
Timeout: 15000 # 15s,设置rpc服务的响应的超时时间,若超过15s还未返回则结束请求
|
||||||
# - IpAddr: 127.0.0.1
|
|
||||||
# Port: 8848
|
DB:
|
||||||
- IpAddr: nacos.jcce.dev
|
DataSource: root:uJpLd6u-J?HC1@(10.206.0.12:3306)/pcm?parseTime=true
|
||||||
Port: 8848
|
|
||||||
ClientConfig:
|
#链路追踪
|
||||||
NamespaceId: test
|
# Telemetry:
|
||||||
TimeoutMs: 5000
|
# Name: pcm-core-rpc
|
||||||
NotLoadCacheAtStart: true
|
# Endpoint: http://jaeger-collector.observability:14268/api/traces
|
||||||
LogDir:
|
# Sampler: 1.0
|
||||||
CacheDir:
|
# Batcher: jaeger
|
||||||
LogLevel: info
|
|
||||||
|
SnowflakeConf:
|
||||||
|
MachineId: 1
|
||||||
|
|
||||||
|
RedisConf:
|
||||||
|
Host: 10.206.0.7:6379
|
||||||
|
Pass: redisPW123
|
||||||
|
Type: node
|
||||||
|
Tls: false
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"github.com/zeromicro/go-zero/core/service"
|
"github.com/zeromicro/go-zero/core/service"
|
||||||
"github.com/zeromicro/go-zero/zrpc"
|
"github.com/zeromicro/go-zero/zrpc"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/helper/interceptor/rpcserver"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/helper/interceptor/rpcserver"
|
||||||
commonConfig "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/helper/nacos"
|
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/config"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/config"
|
||||||
participantserviceServer "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/server/participantservice"
|
participantserviceServer "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/server/participantservice"
|
||||||
pcmcoreServer "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/server/pcmcore"
|
pcmcoreServer "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/server/pcmcore"
|
||||||
|
@ -37,27 +36,8 @@ func main() {
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var bootstrapConfig commonConfig.BootstrapConfig
|
|
||||||
conf.MustLoad(*configFile, &bootstrapConfig)
|
|
||||||
|
|
||||||
//解析业务配置
|
|
||||||
var c config.Config
|
var c config.Config
|
||||||
nacosConfig := bootstrapConfig.NacosConfig
|
conf.MustLoad(*configFile, &c)
|
||||||
|
|
||||||
serviceConfigContent := nacosConfig.InitConfig(func(data string) {
|
|
||||||
err := conf.LoadFromYamlBytes([]byte(data), &c)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
err := conf.LoadFromYamlBytes([]byte(serviceConfigContent), &c)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
// start log component
|
|
||||||
logx.MustSetup(c.LogConf)
|
|
||||||
// 注册到nacos
|
|
||||||
nacosConfig.Discovery(&c.RpcServerConf)
|
|
||||||
|
|
||||||
ctx := svc.NewServiceContext(c)
|
ctx := svc.NewServiceContext(c)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue