edit-icon download-icon

Specify configuration server when starting service

Last Updated: Jan 30, 2018

When using EDAS to deploy an application, you do not need to deploy a configuration center by yourself. However, if you want to set up a test environment to test the HSF service, you can specify the address of a configuration center when starting services on ECS.

Install a configuration center

Select a server and install ConfigServer as instructed in Install the Simple Application Server.

Modify the configuration on the application server

For example, application A runs on server ECS1. To point application A to a self-built ConfigServer, log on to server ECS1 and modify the following configurations:

  1. Modify the ECS domain name.

    • {Internet IP address of the lightweight configuration center} jmenv.tbsite.net

    • {Internet IP address of the lightweight configuration center} addr-bj-internal.edas.aliyun.com

    The second configured domain name must be consistent with the value of -Daddress.server.domain in home/admin/taobao-tomcat-produ**ction-7.0.59.3/bin/setenv.sh of ConfigServer.

  2. Modify the container configuration.

    In /home/admin/taobao-tomcat-production-7.0.59.3/bin/setenv.sh, set the value of -Dconfigserver.client.port to 9600, and add the parameter -Dhsf.server.ip={Internet IP address of the local ECS instance}.

  3. Clear the history configuration.

    To avoid cache interference, delete the content in /home/admin/configclient/ before starting the application.

  4. Confirm service publishing.

    Check /home/admin/configclient/logs/config.client.log. If [Register-ok] and [Publish-ok] are displayed, the publishing is successful. You can view the published service in the caller list of the lightweight configuration center. Click “Details”. “{ecs Internet ip}:12200?v=2.0&_TIMEOUT=3000&_IDLETIMEOUT=10&_p=hessian2&_SERIALIZETYPE=hessian” is displayed in the source data.

Specify ConfigServer in the development environment

  1. Modify the hosts file.

    In the hosts file, add:{Internet IP address of the lightweight configuration center} jmenv.tbsite.net.

  2. Set the startup parameter.

    If multiple NICs exist, specify the IP address to be registered with using -Dhsf.server.ip.

    After the application is started, check the configclient log. If [Register-ok] and [Data-received] are displayed, the service is called. You can further verify the calling between services based on the called service.

Thank you! We've received your feedback.