This commit is contained in:
parent
083140fef8
commit
4c56d907ed
5
main.go
5
main.go
@ -22,7 +22,7 @@ func initNacos() {
|
||||
}
|
||||
cc := constant.ClientConfig{
|
||||
AppName: "api1",
|
||||
NamespaceId: "", //namespace id
|
||||
NamespaceId: "public", //namespace id
|
||||
TimeoutMs: 5000,
|
||||
NotLoadCacheAtStart: true,
|
||||
RotateTime: "1h",
|
||||
@ -43,11 +43,12 @@ func initNacos() {
|
||||
portNum, _ := strconv.Atoi(port)
|
||||
pp := uint64(portNum)
|
||||
success, err := client.RegisterInstance(vo.RegisterInstanceParam{
|
||||
//Ip: "172.30.0.90",
|
||||
Ip: "api-demo",
|
||||
Port: pp,
|
||||
Weight: 10,
|
||||
Enable: true,
|
||||
ServiceName: "api1",
|
||||
Ephemeral: true,
|
||||
})
|
||||
log.Println("Nacos注册结果: ", success)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user