W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
參考samples dubbo-go-samples/registry
Registry 注冊中心配置
dubbo: application: # 應用信息,服務啟動后會將相關(guān)信息注冊到注冊中心,可被客戶端從 url 中識別 name: myApp # application=myApp; name=myApp module: opensource # module=opensource organization: dubbo # organization=dubbo owner: laurence # owner=laurence version: myversion # app.version=myversion environment: pro # environment=pro registries: nacosWithCustomGroup: protocol: nacos # 注冊中心選擇 nacos address: 127.0.0.1:8848 # nacos ip group: myGroup # nacos group, 默認 DEFAULT_GROUP namespace: 9fb00abb-278d-42fc-96bf-e0151601e4a1 # nacos namespaceID, should be created before. 默認public username: abc password: abc protocols: dubbo: name: dubbo port: 20000 provider: services: UserProviderWithCustomGroupAndVersion: # 接口三元組:接口名、版本號、分組。client 和 server 需要保持一致。 interface: org.apache.dubbo.UserProvider.Test # 接口名必填 version: myInterfaceVersion # 默認為空 group: myInterfaceGroup # 默認為空
Dubbo-go 的注冊中心配置的 group、namespace、username、password,均與 nacos 相關(guān)概念對應。
dubbo: # application: 與nacos 一致,不再贅述 registries: demoZK: protocol: zookeeper # 注冊中心選擇 nacos address: 127.0.0.1:2181 # zookeeper ip group: myGroup # nacos group, 默認 dubbo protocols: triple: name: tri port: 20000 provider: services: UserProviderWithCustomGroupAndVersion: # 接口三元組:接口名、版本號、分組。client 和 server 需要保持一致。 interface: com.apache.dubbo.sample.basic.IGreeter # 接口名必填 version: myInterfaceVersion # 默認為空 group: myInterfaceGroup # 默認為空
zookeeper 注冊時,provider 端將接口信息注冊在 /$(group)/$(interface)/providers 節(jié)點,以上面配置為例,注冊的 zk path 為 /myGroup/com.apache.dubbo.sample.basic.IGreeter/providers/
consumer 端注冊在 /$(group)/$(interface)/consumers 作統(tǒng)計用。
dubbo: registries: etcd: protocol: etcdv3 timeout: 3s address: 127.0.0.1:2379 protocols: dubbo: name: dubbo port: 20000 provider: services: UserProvider: interface: org.apache.dubbo.UserProvider
dubbo: registries: demoZK: protocol: zookeeper # nacos/zookeeper address: 127.0.0.1:2181 registry-type: service # 使用應用級服務發(fā)現(xiàn) metadata-report: # 配置元數(shù)據(jù)中心 protocol: zookeeper address: 127.0.0.1:2181 protocols: triple: name: tri port: 20000 provider: services: GreeterProvider: interface: com.apache.dubbo.sample.basic.IGreeter
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: