Install of ServiceCenter


ServiceCenter is a service registry. The service provider can register its own instance information to the ServiceCenter for the service consumer to discover and use.

Run with release package

  1. Download the latest release package of Service-Center
    This example uses apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz
  2. Start service-center
    # Decompression the package
    $ tar -zxvf  apache-servicecomb-service-center-2.1.0-linux-amd64.tar.gz
    # Start the service of servicecenter
    $ cd apache-servicecomb-service-center-2.1.0-linux-amd64/
    $ ./
  3. View service status
    # View process status
    $ ps -ef | grep service-center
    root     27048     1  2 14:38 pts/2    00:00:00 ./service-center
    root     27164 22742  0 14:38 pts/2    00:00:00 grep --color=auto service-center
    # View the listening port
    $ netstat -apn | grep :30100
    tcp        0      0*               LISTEN      27048/service-cente
    # Call the interface with the curl command
    $ curl
    {"_links":{"pb:latest-pact-versions":{"href":"","title":"Latest pact versions"},"pb:latest-provider-pacts":{"href":"{provider}/latest","title":"Latest pacts by provider","templated":true},"pb:latest-provider-pacts-with-tag":{"href":"{provider}/latest/{tag}","title":"Latest pacts by provider with a specified tag","templated":true},"pb:pacticipants":{"href":"","title":"Pacticipants"},"pb:publish-pact":{"href":"{provider}/consumer/{consumer}/version/{consumerApplicationVersion}","title":"Publish a pact","templated":true},"pb:webhooks":{"href":"","title":"Webhooks"},"self":{"href":"","title":"Index"}},"curies":[{"href":"{rel}","name":"pb"}]}
    # If the above content is returned, the startup was successful.
  4. Start the website of frontend and view the status
    $ ./
    $ ps -ef | grep frontend   
    root      1875 32096  0 17:43 pts/6    00:00:00 grep --color=auto frontend
    root      3020     1  0 Nov05 ?        00:00:23 ./frontend
    # View the listening port
    $ netstat -apn | grep :30103
    tcp        0      0*               LISTEN      3020/frontend
  5. Open the website page “” with a browser, and view instances of the service center in website.(The result is success if like this)
    • If the frontend service is started not locally, it cannot be accessed through; you need to modify the “frontend_host_ip” in the configuration file as the host IP ,and open the website to accessed http://{ip}:30103
    • If Service-Center needs to provide external services, you need to modify “httpaddr”, and external applications use http://{ip}:30100 for access. Like this:

Run with docker

  1. Download and run docker image
    # Download the docker image
    $ docker pull servicecomb/service-center
    # Start docker container
    $ docker run -d -p 30100:30100 servicecomb/service-center
  2. View container status and listening port
    $ docker ps | grep service-center
    0733021cd96d        servicecomb/service-center        "/opt/service-cent..."   3 minutes ago       Up 3 minutes>30100/tcp        gallant_varahamihira 

Deployment with Kubernetes

  1. Configuring the deployment of kubernetes
    $ cat <<EOF >> ./service-center.yaml
    apiVersion: v1
    kind: Service
      name: servicecenter
      namespace: svccomb-system
        app: servicecenter
      - port: 30100
        name: http
        app: servicecenter
    apiVersion: extensions/v1beta1
    kind: Deployment
      name: servicecenter
      namespace: svccomb-system
      replicas: 1
            app: servicecenter
            version: v1
          - name: servicecenter
            image: servicecomb/service-center:latest
            imagePullPolicy: IfNotPresent
            - containerPort: 30100
  2. Deployment
    # create namespace "svccomb-system"
    $ kubectl create namespace svccomb-system
    # deploy service-center
    $ kubectl apply -f service-center.yaml
  3. View Pod status and Service port
    # View Pod status
    $ kubectl -n svccomb-system get pod
    NAME                             READY   STATUS    RESTARTS   AGE
    servicecenter-7d964b7644-h6f4s   1/1     Running   0          72s
    # View the the listening port of service
    $ kubectl -n svccomb-system get service
    NAME            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)     AGE
    servicecenter   ClusterIP   <none>        30100/TCP   118s
    $ curl