Mersher Quick Start

Install development environment

Run Service Center

In the ServiceComb microservices framework, Service Center provides service registration and service discovery.

docker pull servicecomb/service-center
docker run -d -p 30100:30100 servicecomb/service-center:latest

Reference to service center deployment to learn deploying Service Center and front as a local binary.

Use mersher to merge into the servicecomb microservice system


  • This use case is mainly to help users get started quickly with mersher sidecar mode. We hope that users can understand the working mode of mersher and learn how to merge the existing http service into the ServiceComb micro-service system with mersher. The final goal is to help user get the micro-service capabilities such as load balancing, flow control, service management and call chain tracing provided by servicecomb. The full case will be submitted to Case Download.

Mersher use case service introduction

  • 1 httpserver_calculator. A http server based on python which is for BMI calculator and can be developed by any language.
  • 2 httpserver_webapp. A http server based on nodejs which is used for displaying results on the browser.
  • 3 mersher_webapp. A mersher instance which serves for httpserver_webapp via sidecar mode.
  • 4 mersher_calculator. A mersher instance which serves for httpserver_calculator via sidecar mode.
  • 5 servicecenter. Servicecenter which receives registration of mesher service and provides services as service discovery, routing query, service monitoring and so on.

mersher deployment diagram

Process details

  • 1 The browser[] execute a http call to the httpserver_webapp service with url
  • 2 The httpserver_webapp service receives the request and execute http call http://calculator/bmi. Because the proxy is set as, the request initiated by httpserver_webapp will be forwarded to the mersher_webapp service.
  • 3 mersher_webapp gets the address of the service name(the service name calculator here is configured in microservice.yaml) from the servicecenter and forwarded to mersher_calculator.
  • 4 mersher_calculator service forward http requests to the httpserver_calculator service.
  • 5 httpserver_calculator will calculate according to the input parameters(height and weight). The result containing service id and body mass index will be displayed on the browser. The flow chart is as follows:


Environmental construction

  • 1 Compile mersher download. Download the project and get the executable mersher(linux) or mersher.exe(windows) by

  • 2 Create mersher_webapp which serves for httpserver_webapp. In the mersher directory execute the following linux command to create mersher_webapp. In order to the run mersher you also need to copy the conf.

    mkdir /usr/local/src/mersher_webapp
    cp ./mesher /usr/local/src/mersher_webapp
    cp -r ./conf /usr/local/src/mersher_webapp

    Change service name in microservice.yaml from hellemesher to webapp. Change the listening service address in chassis.yaml from to intranet ip(Viewed by cmd ifconfig in linux, such as

    listenAddress:  -----》  listenAddress:
    listenAddress:  -----》  listenAddress:
    listenAddress:  -----》  listenAddress:
  • 3 Create mersher_calculator service.

    mkdir /usr/local/src/mersher_calculator
    cp ./mesher /usr/local/src/mersher_calculator
    cp -r ./conf /usr/local/src/mersher_calculator

    Change the service name in conf file microservice.yaml from hellemesher to calculator.
    Change the listening address and port in conf file chassis.yaml.

    listenAddress:  -----》  listenAddress:
    listenAddress:  -----》  listenAddress:
    listenAddress:  -----》  listenAddress:
  • 4 Run mersher_webapp and mersher_calculator respectively by cmd.

    cd /usr/local/src/mersher_calculator
    export SPECIFIC_ADDR=
    cd /usr/local/src/mersher_webapp
  • 5 Run httpserver_webapp.

    cd /usr/local/src/httpserver_webapp
    npm install
    export http_proxy=
    node ./httpserver_webapp.js
  • 6 Run httpserver_calculator program as BMI calculator. You need to install python2.7 and this service relies on package BaseHTTPServer.

    cd /usr/local/src/httpserver_calculator

Start testing

What’s next