use etcd for registry
# dubbo server yaml configure file # application config application: organization : "ikurento.com" name : "BDTService" module : "dubbogo user-info server" version : "0.0.1" owner : "ZX" environment : "dev" registries : "etcd": protocol: "etcdv3" timeout : "3s" address: "127.0.0.1:2379" services: "UserProvider": # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册 registry: "etcd" # 特别注意这里 protocol : "dubbo" # 相当于dubbo.xml中的interface interface : "com.ikurento.user.UserProvider" loadbalance: "random" warmup: "100" cluster: "failover" methods: - name: "GetUser" retries: 1 loadbalance: "random" protocols: "dubbo": name: "dubbo" port: 20000 protocol_conf: dubbo: session_number: 700 session_timeout: "180s" getty_session_param: compress_encoding: false tcp_no_delay: true tcp_keep_alive: true keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 pkg_rq_size: 1024 pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" max_msg_len: 1024000 session_name: "server"
# dubbo client yaml configure file check: true # client request_timeout : "3s" # connect timeout connect_timeout : "3s" # application config application: organization : "ikurento.com" name : "BDTService" module : "dubbogo user-info client" version : "0.0.1" owner : "ZX" environment : "dev" registries : "etcd": protocol: "etcdv3" timeout : "3s" address: "127.0.0.1:2379" username: "" password: "" references: "UserProvider": # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册 protocol : "dubbo" interface : "com.ikurento.user.UserProvider" cluster: "failover" methods : - name: "GetUser" retries: 3 protocol_conf: dubbo: reconnect_interval: 0 connection_number: 1 heartbeat_period: "5s" session_timeout: "180s" pool_size: 64 pool_ttl: 600 getty_session_param: compress_encoding: false tcp_no_delay: true tcp_keep_alive: true keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 pkg_rq_size: 1024 pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" max_msg_len: 1024000 session_name: "client"
import github.com/apache/dubbo-go/registry/etcdv3
in go-client/app/client.go
and go-server/app/server.go
// import etcdv3 to init etcdv3 registry _ "github.com/apache/dubbo-go/registry/etcdv3"