You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2022/04/19 04:05:17 UTC

[servicecomb-service-center] branch master updated: [doc] add syncer document (#1294)

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

littlecui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new f2f3aec1 [doc] add syncer document (#1294)
f2f3aec1 is described below

commit f2f3aec1ca9fad5e8d77ef922116b35b0adac252
Author: robotljw <79...@qq.com>
AuthorDate: Tue Apr 19 12:05:11 2022 +0800

    [doc] add syncer document (#1294)
---
 .github/workflows/golangci-lint.yml             |   2 +-
 datasource/etcd/sd/k8s/repo.go                  |   1 +
 docs/user-guides.rst                            |   1 +
 docs/user-guides/app-conf.png                   | Bin 0 -> 63516 bytes
 docs/user-guides/app-yaml.png                   | Bin 0 -> 41758 bytes
 docs/user-guides/chassis.png                    | Bin 0 -> 48931 bytes
 docs/user-guides/front-1.png                    | Bin 0 -> 159291 bytes
 docs/user-guides/front-2.png                    | Bin 0 -> 259343 bytes
 docs/user-guides/health.png                     | Bin 0 -> 179768 bytes
 docs/user-guides/server-host.png                | Bin 0 -> 32737 bytes
 docs/user-guides/syncer-deploy-architecture.png | Bin 0 -> 201825 bytes
 docs/user-guides/syncer.md                      |  74 ++++++++++++++++++++++++
 pkg/util/concurrent_map_go19.go                 |   1 +
 server/handler/accesslog/handler.go             |   1 +
 14 files changed, 79 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index f6fee385..e5b115ac 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -9,5 +9,5 @@ jobs:
       - name: golangci-lint
         uses: golangci/golangci-lint-action@v2
         with:
-          version: v1.29
+          version: v1.45.2
           args: --timeout=5m --skip-dirs='api,test,.*/controller/(v3|v4)$,.*/bootstrap$,server/broker,examples,frontend,scctl,integration' --enable gofmt,golint,gocyclo,goimports --skip-files=.*_test.go$
diff --git a/datasource/etcd/sd/k8s/repo.go b/datasource/etcd/sd/k8s/repo.go
index 491e2995..ae4efeff 100644
--- a/datasource/etcd/sd/k8s/repo.go
+++ b/datasource/etcd/sd/k8s/repo.go
@@ -1,3 +1,4 @@
+//go:build !nok8s
 // +build !nok8s
 
 /*
diff --git a/docs/user-guides.rst b/docs/user-guides.rst
index 1e06cfab..42cbf89a 100644
--- a/docs/user-guides.rst
+++ b/docs/user-guides.rst
@@ -14,6 +14,7 @@ User Guides
    user-guides/quota.md
    plugin-tracing-guides
    user-guides/rbac.md
+   user-guides/syncer.md
    user-guides/fast-registration.md
    user-guides/ux.md
    user-guides/limits.md
diff --git a/docs/user-guides/app-conf.png b/docs/user-guides/app-conf.png
new file mode 100644
index 00000000..53a0d7b9
Binary files /dev/null and b/docs/user-guides/app-conf.png differ
diff --git a/docs/user-guides/app-yaml.png b/docs/user-guides/app-yaml.png
new file mode 100644
index 00000000..7f3b7312
Binary files /dev/null and b/docs/user-guides/app-yaml.png differ
diff --git a/docs/user-guides/chassis.png b/docs/user-guides/chassis.png
new file mode 100644
index 00000000..54f0354c
Binary files /dev/null and b/docs/user-guides/chassis.png differ
diff --git a/docs/user-guides/front-1.png b/docs/user-guides/front-1.png
new file mode 100644
index 00000000..3cbff1a8
Binary files /dev/null and b/docs/user-guides/front-1.png differ
diff --git a/docs/user-guides/front-2.png b/docs/user-guides/front-2.png
new file mode 100644
index 00000000..4b10210d
Binary files /dev/null and b/docs/user-guides/front-2.png differ
diff --git a/docs/user-guides/health.png b/docs/user-guides/health.png
new file mode 100644
index 00000000..fa952683
Binary files /dev/null and b/docs/user-guides/health.png differ
diff --git a/docs/user-guides/server-host.png b/docs/user-guides/server-host.png
new file mode 100644
index 00000000..8bd21e20
Binary files /dev/null and b/docs/user-guides/server-host.png differ
diff --git a/docs/user-guides/syncer-deploy-architecture.png b/docs/user-guides/syncer-deploy-architecture.png
new file mode 100644
index 00000000..f2417993
Binary files /dev/null and b/docs/user-guides/syncer-deploy-architecture.png differ
diff --git a/docs/user-guides/syncer.md b/docs/user-guides/syncer.md
new file mode 100644
index 00000000..7a1ed052
--- /dev/null
+++ b/docs/user-guides/syncer.md
@@ -0,0 +1,74 @@
+# syncer
+
+Service-Center supports synchronization. If you want to use synchronization, you can refer to the step.
+
+## preparation before installation
+
+### download package
+
+> Note: Only the 2.1+ version of sc supports synchronization
+- [service-center](https://github.com/apache/servicecomb-service-center/releases)
+- [etcd](https://github.com/etcd-io/etcd/releases)
+
+### deployment Architecture
+
+![architecture](syncer-deploy-architecture.png)
+
+| vm-ip          | region   |
+| -------------- |----------|
+| 192.168.81.128 | region-1 |
+| 192.168.81.129 | region-1 |
+| 192.168.81.130 | region-1 |
+| 192.168.81.131 | region-2 |
+| 192.168.81.132 | region-2 |
+| 192.168.81.133 | region-2 |
+
+## installation operation
+
+### install etcd
+
+Refer to the official website [documentation](https://etcd.io/docs/v3.5/op-guide/clustering/).
+
+### install sc
+> Note: Only the 2.1+ version of sc supports synchronization 
+
+**first step**: modify the files in `conf`
+
+`app.conf`: modify frontend_host_ip and httpaddr to the local ip address
+
+![app.conf](app-conf.png)
+
+`app.yaml`: modify server.host, REGISTRY_KIND, REGISTRY_ETCD_CLUSTER_NAME, REGISTRY_ETCD_CLUSTER_MANAGER_ENDPOINTS, REGISTRY_ETCD_CLUSTER_ENDPOINTS
+
+![server.host](server-host.png)
+![app.yaml](app-yaml.png)
+
+`chassis.yaml`: modify listenAddress to the local ip address
+
+![chassis.yaml](chassis.png)
+
+`syncer.yaml`: turn on the enableOnStart switch, and modify endpoints, the sc machine ip in region-2
+
+**second step**: repeat the above operation to modify the configuration of sc on other machines
+
+**third step**: start start-service-center.sh
+
+sh `start-service-center.sh`
+
+**the fourth step**: start start-frontend.sh
+
+sh `start-frontend.sh`
+
+open the front-end interface of any node
+
+![front-1](front-1.png)
+![front-2](front-2.png)
+
+### verify health
+
+curl -k http://{ip}:30100/health
+![health](health.png)
+
+> Congratulations!!!
+
+
diff --git a/pkg/util/concurrent_map_go19.go b/pkg/util/concurrent_map_go19.go
index 78d30f01..4a319219 100644
--- a/pkg/util/concurrent_map_go19.go
+++ b/pkg/util/concurrent_map_go19.go
@@ -1,3 +1,4 @@
+//go:build go1.9
 // +build go1.9
 
 /*
diff --git a/server/handler/accesslog/handler.go b/server/handler/accesslog/handler.go
index 2fce32f2..92a758e8 100644
--- a/server/handler/accesslog/handler.go
+++ b/server/handler/accesslog/handler.go
@@ -1,3 +1,4 @@
+//go:build go1.9
 // +build go1.9
 
 /*