You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by il...@apache.org on 2020/11/03 02:43:19 UTC

[dubbo-go-samples] 01/02: correct registry/servicediscovery/etcd

This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch makefile
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git

commit d3bb3668d56d31bdbb35ba510fe805809ca04577
Author: Ian Luo <ia...@gmail.com>
AuthorDate: Tue Nov 3 10:29:20 2020 +0800

    correct registry/servicediscovery/etcd
---
 registry/servicediscovery/etcd/go-client/FIXME.md  | 37 ++++++++++-
 .../etcd/go-client/conf/server.yml                 | 38 ------------
 .../etcd/go-server/conf/server.yml                 | 72 +++++++++++++++++++++-
 3 files changed, 107 insertions(+), 40 deletions(-)

diff --git a/registry/servicediscovery/etcd/go-client/FIXME.md b/registry/servicediscovery/etcd/go-client/FIXME.md
index 7e5a8b7..600a1f4 100644
--- a/registry/servicediscovery/etcd/go-client/FIXME.md
+++ b/registry/servicediscovery/etcd/go-client/FIXME.md
@@ -1 +1,36 @@
-In order to make the client work, an empty conf/server.yml is required. Need further investigation.
\ No newline at end of file
+In order to make the client work, a conf/server.yml shown below is required. Need further investigation:
+
+```yaml
+# dubbo server yaml configure file
+
+# application config
+application:
+  organization: "dubbo.io"
+  name: "UserInfoServer"
+  module: "dubbo-go user-info server"
+  version: "0.0.1"
+  environment: "dev"
+
+# registry config
+registries:
+  "demoServiceDiscovery":
+    protocol: "service-discovery"
+    params:
+      service_discovery: "etcd1"
+      name_mapping: "in-memory"
+      metadata: "default"
+
+remote:
+  etcd:
+    address: "127.0.0.1:2379"
+    timeout: "5s"
+
+metadata_report:
+  protocol: "etcdv3"
+  remote_ref: "etcd"
+
+service_discovery:
+  etcd1:
+    protocol: "etcdv3"
+    remote_ref: "etcd"
+```
\ No newline at end of file
diff --git a/registry/servicediscovery/etcd/go-client/conf/server.yml b/registry/servicediscovery/etcd/go-client/conf/server.yml
index be4934d..a1d3052 100644
--- a/registry/servicediscovery/etcd/go-client/conf/server.yml
+++ b/registry/servicediscovery/etcd/go-client/conf/server.yml
@@ -31,41 +31,3 @@ service_discovery:
     protocol: "etcdv3"
     remote_ref: "etcd"
 
-# service config
-services:
-  "UserProvider":
-    registry: "demoServiceDiscovery"
-    protocol: "dubbo"
-    interface: "org.apache.dubbo.UserProvider"
-    loadbalance: "random"
-    warmup: "100"
-    cluster: "failover"
-    methods:
-      - name: "GetUser"
-        retries: 1
-        loadbalance: "random"
-
-# protocol config
-protocols:
-  "dubbo":
-    name: "dubbo"
-    port: 20001
-
-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"
diff --git a/registry/servicediscovery/etcd/go-server/conf/server.yml b/registry/servicediscovery/etcd/go-server/conf/server.yml
index e0b1db1..226ca2b 100644
--- a/registry/servicediscovery/etcd/go-server/conf/server.yml
+++ b/registry/servicediscovery/etcd/go-server/conf/server.yml
@@ -1 +1,71 @@
-# FIXME: not sure why a empty server.yml is required.
\ No newline at end of file
+# dubbo server yaml configure file
+
+# application config
+application:
+  organization: "dubbo.io"
+  name: "UserInfoServer"
+  module: "dubbo-go user-info server"
+  version: "0.0.1"
+  environment: "dev"
+
+# registry config
+registries:
+  "demoServiceDiscovery":
+    protocol: "service-discovery"
+    params:
+      service_discovery: "etcd1"
+      name_mapping: "in-memory"
+      metadata: "default"
+
+remote:
+  etcd:
+    address: "127.0.0.1:2379"
+    timeout: "5s"
+
+metadata_report:
+  protocol: "etcdv3"
+  remote_ref: "etcd"
+
+service_discovery:
+  etcd1:
+    protocol: "etcdv3"
+    remote_ref: "etcd"
+
+# service config
+services:
+  "UserProvider":
+    registry: "demoServiceDiscovery"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    loadbalance: "random"
+    warmup: "100"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 1
+        loadbalance: "random"
+
+# protocol config
+protocols:
+  "dubbo":
+    name: "dubbo"
+    port: 20001
+
+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"
\ No newline at end of file