Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nacos config_center has problem #1213

Closed
XiaoWeiKIN opened this issue May 24, 2021 · 6 comments
Closed

nacos config_center has problem #1213

XiaoWeiKIN opened this issue May 24, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@XiaoWeiKIN
Copy link
Contributor

version : v1.5.7

  1. 元数据中心比配置中心先启动,导致元数据中心的配置放在配置中心中,元数据中心无法启动。
  2. nacos 配置中心账号密码问题
    ConfigCenterConfig
    func (c *ConfigCenterConfig) GetURLMap() url.Values {
     urlMap := url.Values{}
     urlMap.Set(constant.CONFIG_NAMESPACE_KEY, c.Namespace)
     urlMap.Set(constant.CONFIG_GROUP_KEY, c.Group)
     urlMap.Set(constant.CONFIG_CLUSTER_KEY, c.Cluster)
     urlMap.Set(constant.CONFIG_APP_ID_KEY, c.AppId)
     urlMap.Set(constant.CONFIG_LOG_DIR_KEY, c.LogDir)
     return urlMap
    

}

没有添加账号密码到url中
return clients.CreateConfigClient(map[string]interface{}{
	"serverConfigs": svrConfList,
	"clientConfig": nacosconst.ClientConfig{
		TimeoutMs:           uint64(int32(timeout / time.Millisecond)),
		ListenInterval:      uint64(int32(timeout / time.Millisecond)),
		NotLoadCacheAtStart: true,
		LogDir:              url.GetParam(constant.NACOS_LOG_DIR_KEY, ""),
		CacheDir:            url.GetParam(constant.NACOS_CACHE_DIR_KEY, ""),
		Endpoint:            url.GetParam(constant.NACOS_ENDPOINT, ""),
		Username:            url.GetParam(constant.NACOS_USERNAME, ""),
		Password:            url.GetParam(constant.NACOS_PASSWORD, ""),
		NamespaceId:         url.GetParam(constant.NACOS_NAMESPACE_ID, ""),
	},
})
使用的常量不一致 一个是confg.xx 一个是nacos常量。
@AlexStocks
Copy link
Contributor

AlexStocks commented May 24, 2021

would u pls try to fix this problem by yourself?

@XiaoWeiKIN
Copy link
Contributor Author

ok,I will submit a pr.

@zhaoyunxing92
Copy link
Contributor

zhaoyunxing92 commented May 24, 2021

config_center_config#GetUrlMap()

@AlexStocks
Copy link
Contributor

@zhaoyunxing92

@XiaoWeiKIN
Copy link
Contributor Author

追加:consumer 和 provider 启动了两个配置中心

@xmsz
Copy link

xmsz commented Aug 10, 2021

有没有Nacos的启动示例

var (
	appName         = "greeterImpl"
	referenceConfig = config.ReferenceConfig{
		InterfaceName: "org.apache.dubbo.UserProvider",
		Cluster:       "failover",
		Registry:      "nacos",
		Protocol:      "tri",
		Generic:       true,
	}
)

跑不起来

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x4590b7c]

goroutine 1 [running]:
dubbo.apache.org/dubbo-go/v3/config.(*ReferenceConfig).getURLMap(0x51e5fa0, 0x3)
        /Users/chenshijian/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc2/config/reference_config.go:255 +0xd9c
dubbo.apache.org/dubbo-go/v3/config.(*ReferenceConfig).Refer(0x51e5fa0, 0x49bf2e0, 0xc000273698)
        /Users/chenshijian/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc2/config/reference_config.go:97 +0x99
dubbo.apache.org/dubbo-go/v3/config.(*ReferenceConfig).GenericLoad(0x51e5fa0, 0x4b14bbd, 0xb)
        /Users/chenshijian/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc2/config/reference_config.go:287 +0x10d
main.init.0()

@LaurenceLiZhixin LaurenceLiZhixin added the bug Something isn't working label Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants