All Products
Search
Document Center

Enterprise Distributed Application Service:How do I specify the address of a configuration center when I start a service?

Last Updated:Jun 19, 2023

When you use Enterprise Distributed Application Service (EDAS) to deploy an application, you do not need to deploy a configuration center. However, if you want to set up a test environment to test a High-speed Service Framework (HSF) application, you can specify the address of a configuration center. You can specify the address when you start a service on an Elastic Compute Service (ECS) instance.

Install a configuration center

Select a server and install Config Server. For more information, see Start the lightweight configuration center.

Modify the configurations of the application server

For example, Application A runs on an ECS instance. To point Application A to the ConfigServer that you create, you must log on to the ECS instance and perform the following operations:

  1. Modify the /etc/hosts configuration file to modify the domain name of the ECS instance.

    {Public IP address of the light-weight configuration center} jmenv.tbsite.net
    {Public IP address of the light-weight configuration center} addr-bj-internal.edas.aliyun.com
    Note

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

  2. Modify the container configurations.

    You can modify the container configurations by using one of the following methods.

    • Change the value of -Dconfigserver.client.port to 9600 in the /home/admin/taobao-tomcat-production-7.0.59.3/bin/setenv.sh file.

    • In the EDAS console, specify JVM parameter -Dconfigserver.client.port=9600 and add parameter -Dhsf.server.ip={Public IP address of the on-premises ECS instance}.

  3. Clear the historical configurations.

    To prevent cache interference, clear the content under /home/admin/configclient/ before you start the application.

  4. Check whether the service is published.

    1. Check the /home/admin/configclient/logs/config.client.log file. The keywords [Register-ok] and [Publish-ok] indicate that the service is published.

    2. On the Callers tab of the lightweight configuration center, find the desired caller and click Details to view the published service. You can view the following information in the data source: {Public IP address of the ECS instance}:12200?v=2.0&_TIMEOUT=3000&_IDLETIMEOUT=10&_p=hessian2&_SERIALIZETYPE=hessian.

Specify ConfigServer as the development environment

  1. Modify the hosts file.

    Add {public IP address of the lightweight configuration center} jmenv.tbsite.net to the hosts file.

  2. Set the startup parameters.

    If you have multiple network interface controllers (NICs), you can specify the -Dhsf.server.ip parameter for the IP address that you want to register.

  3. Start the application.

    After the application is started, view the configclient log. The keywords [Register-ok] and [Data-received] indicate that the service call is successful. You can verify calls between services based on the called service.