Service-Center supports synchronization. If you want to use synchronization, you can refer to the step.
Note: Only the 2.1+ version of sc supports synchronization
As shown in the figure below, etcd can be deployed as an independent cluster.
It can also be deployed like this.
Refer to the official website documentation.
Note: Only the 2.1+ version of sc supports synchronization
modify the files in conf
app.conf
: modify frontend_host_ip and httpaddr to the local ip address
app.yaml
:
modify
chassis.yaml
: modify listenAddress to the local ip address
syncer.yaml
: turn on the enableOnStart switch, and modify endpoints, the sc machine ip in region-2
Repeat the above operation to modify the configuration of sc on other machines.
sh start-service-center.sh
sh start-frontend.sh
Open the front-end interface of any node.
Instances in the peer region have been synchronized.
curl -k http://{ip}:30100/health
{ "instances": [ { "instanceId": "e810f2f3baf711ec9486fa163e176e7b", "serviceId": "7062417bf9ebd4c646bb23059003cea42180894a", "endpoints": [ "rest://[::]:30100/" ], "hostName": "etcd03", "status": "UP", "healthCheck": { "mode": "push", "interval": 30, "times": 3 }, "timestamp": "1649833445", "dataCenterInfo": { "name": "dz1", "region": "rg1", "availableZone": "az1" }, "modTimestamp": "1649833445", "version": "2.1.0" }, { "instanceId": "e810f2f3baf711ec9486fa163e176e8b", "serviceId": "7062417bf9ebd4c646bb23059003cea42180896a", "endpoints": [ "rest://[::]:30100/" ], "hostName": "etcd04", "status": "UP", "healthCheck": { "mode": "push", "interval": 30, "times": 3 }, "timestamp": "1649833445", "dataCenterInfo": { "name": "dz2", "region": "rg2", "availableZone": "az2" }, "modTimestamp": "1649833445", "version": "2.1.0" } ... ] }
Congratulations!!!