commit | 1234288b5bf234b8d5584657dac29f7de36914dc | [log] [tgz] |
---|---|---|
author | Zen Lin <linzhinan@huawei.com> | Fri May 31 11:34:06 2019 +0800 |
committer | little-cui <sure_0757@qq.com> | Fri May 31 11:34:06 2019 +0800 |
tree | b5d3aa12576a8e4e3c4249005ab2d3b8e0f779b6 | |
parent | 3eb06e429e5de2bb398b3df0db29a5e454fb49f4 [diff] |
[SCB-1295] Add Syncer (#548) * Initial core code of Syncer Signed-off-by: linzhinan <linzhinan@huawei.com> * add License declaration to files in syncer Signed-off-by: linzhinan <linzhinan@huawei.com> * Add cmd and main.go for syncer Signed-off-by: MabinGo <bin.ma@huawei.com> * Add code comments * fix bug when testing * correct SyncerArch png addr Signed-off-by: linzhinan <linzhinan@huawei.com> * Correct peer to be serf, Rename store to datacenter. Signed-off-by: linzhinan <linzhinan@huawei.com> * Correct peer to Serf Signed-off-by: linzhinan <linzhinan@huawei.com> * Refactoring syncer arch, mv storage to syncer server, remove extra events, rename repository to datacenter, uncouple grpc client and server Signed-off-by: linzhinan <linzhinan@huawei.com> * fix bug when initialize grpc client/storing data to the hard disk * Supplementary test case * add copyright to files * Fix bugs, when multiple DCs have instances of the same id, Syner overwrites the registered instance * Decouple status of service-center to its plugin, run gofmt/goimports fot syncer Signed-off-by: Zen Lin <linzhinan@huawei.com> * for test Signed-off-by: Zen Lin <linzhinan@huawei.com> * Add TODO file Signed-off-by: Zen Lin <linzhinan@huawei.com> * Updata README.md and TODO.md Signed-off-by: Zen Lin <linzhinan@huawei.com> * Updata README.md and TODO.md Signed-off-by: Zen Lin <linzhinan@huawei.com> * Update README.md Fix table issue. * Update README-ZH.md Fix table issue. * Change dos to unix in TODO.md and TODO-ZH.md, add *.iml to gitignore Signed-off-by: Zen Lin <linzhinan@huawei.com> * Add License of memberlist and serf, introduced by syncer Signed-off-by: Zen Lin <linzhinan@huawei.com> * fix typos after run go tools Signed-off-by: Zen Lin <linzhinan@huawei.com> * mv storage to data-center, fix bug of clear expired instance in a tick Signed-off-by: Zen Lin <linzhinan@huawei.com> * Break entry of syncer from service-center to keep syncer independent Signed-off-by: Zen Lin <linzhinan@huawei.com> * fix bug to close grpc connection if pull failed Signed-off-by: Zen Lin <linzhinan@huawei.com> * Add logs to key process Signed-off-by: Zen Lin <linzhinan@huawei.com> * correct cmdlilne message Signed-off-by: Zen Lin <linzhinan@huawei.com> * Adjust the test code, when syncer independented * correct datacenter to be servicecenter Signed-off-by: Zen Lin <linzhinan@huawei.com> * correct data-center to be service-center in docs Signed-off-by: Zen Lin <linzhinan@huawei.com> * correct command line in README.md Signed-off-by: Zen Lin <linzhinan@huawei.com>
Apache ServiceComb Service-Center is a Restful based service-registry that provides micro-services discovery and micro-service management. It is based on Open API format and provides features like service-discovery, fault-tolerance, dynamic routing, notify subscription and scalable by design. It has high performance cache design and separate entity management for micro-services and their instances. It provides out of box support for metrics and tracing. It has a web portal to manage the micro-services.
Open API
: API doc(Open API format) management for microservicePortal
: Awesome web portalMetrics
: Able to expose Prometheus metric API automaticallyTracing
: Able to report tracing data to Zipkin serverPluginable
: Able to load custom authentication, tls and other dynamic librariesCLI
: Easy to control service centerKubernetes
: Embrace kubernetes ecosystem and support multi cluster service discoveryDatacenters
: Additional layer of abstraction to clusters deployed in multiple datacentersAggregation
: Able to aggregate microservices from multiple registry platforms and support platform registry and client side registry at the same timeProject documentation is available on the ServiceComb website. You can also find full document here
.
The easiest way to get Service Center is to use one of the pre-built release binaries which are available for Linux, Windows and Docker.
You can download our latest release from ServiceComb Website.When you get these release, you can execute the start script to run Service Center.
Windows(apache-servicecomb-service-center-XXX-windows-amd64.zip):
start-service-center.bat
Linux(apache-servicecomb-service-center-XXXX-linux-amd64.tar.gz):
./start-service-center.sh
Docker:
docker pull servicecomb/service-center docker run -d -p 30100:30100 servicecomb/service-center
Note: The Releases of Service-Center uses emebeded etcd, if you want to use the seperate instance of etcd then you can deploy the etcd seperately and configure the etcd ip over here.
vi conf/app.conf ## Edit this file # registry address # 1. if registry_plugin equals to 'embeded_etcd' # manager_name = "sc-0" # manager_addr = "http://127.0.0.1:2380" # manager_cluster = "sc-0=http://127.0.0.1:2380" # 2. if registry_plugin equals to 'etcd' # manager_cluster = "127.0.0.1:2379" manager_cluster = "127.0.0.1:2379"
By default the SC comes up on 127.0.0.1:30100, however you can change the configuration of these address over here.
vi conf/app.conf httpaddr = 127.0.0.1 httpport = 30100
Requirements
Download the Code
git clone https://github.com/apache/servicecomb-service-center.git $GOPATH/src/github.com/apache/servicecomb-service-center cd $GOPATH/src/github.com/apache/servicecomb-service-center
Dependencies
By default, we use glide(version: 0.13+) to manage dependencies. If the go version greater then go1.11
, you can download dependencies directly using command go mod
. Please follow below steps to download all the dependency.
# greater then go1.11 GO111MODULE=on go mod download GO111MODULE=on go mod vendor # lower than go1.11 curl https://glide.sh/get | sh glide install
Build the Service-Center
go build -o service-center
First, you need to run a etcd(version: 3.x) as a database service and then modify the etcd IP and port in the Service Center configuration file (./etc/conf/app.conf : manager_cluster).
wget https://github.com/coreos/etcd/releases/download/v3.1.8/etcd-v3.1.8-linux-amd64.tar.gz tar -xvf etcd-v3.1.8-linux-amd64.tar.gz cd etcd-v3.1.8-linux-amd64 ./etcd cd $GOPATH/src/github.com/apache/servicecomb-service-center cp -r ./etc/conf . ./service-center
This will bring up Service Center listening on ip/port 127.0.0.1:30100 for service communication.If you want to change the listening ip/port, you can modify it in the Service Center configuration file (./conf/app.conf : httpaddr,httpport).
You can download our latest release from ServiceComb Website and then untar it and run start-frontend.sh/start-frontend.bat. This will bring up the Service-Center UI on http://127.0.0.1:30103.
Windows(apache-servicecomb-service-center-XXX-windows-amd64.zip):
start-frontend.bat
Linux(apache-servicecomb-service-center-XXXX-linux-amd64.tar.gz):
./start-frontend.sh
Note: By default frontend runs on 127.0.0.1, if you want to change this then you can change it in conf/app.conf
.
frontend_host_ip=127.0.0.1 frontend_host_port=30103
You can follow the guide over here to run the Frontend from source.
Bugs: issues
See Contribution guide for details on submitting patches and the contribution workflow.
See reporting bugs for details about reporting any issues.