You can use the light-weight configuration registry in the local environment for application registration, discovery, and configuration management when you develop and test applications. These features are still available after you deploy applications to Enterprise Distributed Application Service (EDAS). This topic describes how to download, start, and verify the light-weight configuration registry.

Upgrade description

The light-weight configuration center has been upgraded to the light-weight configuration registry. The light-weight configuration registry is compatible with the light-weight configuration center and provides additional support for Nacos.

The features before and after the upgrade are compared in the following table.
Feature Light-weight configuration center Light-weight configuration and registry
Configuration management by using Application Configuration Management (ACM) Supported Supported
Service registration and discovery by using Application Naming Service (ANS) Supported Supported
Service registration, discovery, and configuration management for HSF applications Supported Supported
Service registration, discovery, and configuration management by using Nacos Not supported Supported
Note You can directly switch from the light-weight configuration center to the light-weight configuration registry.

Prerequisites

Before the light-weight configuration registry is used, the following tasks are completed:
  • Java Development Kit (JDK) 1.8 or later is downloaded and the environment variable JAVA_HOME is specified.
  • Ports 8080, 8848, and 9600 are not in use based on the check result.
    Note The light-weight configuration registry occupies ports 8080, 8848, and 9600. We recommend that you install and start the light-weight configuration registry on a dedicated machine. If you use the light-weight configuration registry on the local machine, use other ports.

Step 1: Download the light-weight configuration registry

  • Windows:
    1. Download the light-weight configuration registry package.
    2. Decompress the package to a local directory.
  • UNIX:
    1. Run the wget http://edas.oss-cn-hangzhou.aliyuncs.com/edas-res/edas-lightweight-server-1.0.0.tar.gz command to download the light-weight configuration registry package.
    2. Run the tar -zvxf edas-lightweight-server-1.0.0.tar.gz command to decompress the package.
    Notice The light-weight configuration registry can be used for only local development and testing. Do not use it in the production environment. If you expose the light-weight configuration registry to the Internet, use an IP access policy for access control.

Step 2: Start the light-weight configuration registry

  1. Go to the edas-lightweight\bin directory.
  2. Start the light-weight configuration registry and view the startup result.
    • For a Windows system, double-click startup.bat.
    • For a UNIX system, run sh startup.sh.
      1. /usr/java/jdk1.8.0/bin/java -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/root/service/edas-lightweight/logs/java_heapdump.hprof -XX:-UseLargePages -Djava.ext.dirs=/usr/java/jdk1.8.0/jre/lib/ext:/usr/java/jdk1.8.0/lib/ext:/root/service/edas-lightweight/plugins/cmdb:/root/service/edas-lightweight/plugins/mysql -Xloggc:/root/service/edas-lightweight/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/root/service/edas-lightweight -Dnacos.standalone=true -jar /root/service/edas-lightweight/target/edas-lightweight.jar --spring.config.location=classpath:/,classpath :/config/,file:./,file:./config/,file:/root/service/edas-lightweight/conf/ --logging.config=/root/service/edas-lightweight/conf/nacos-logback.xml --server.max-http-header-size=524288
      2. edas lightweight is starting with standalone
      3. edas lightweight is starting, you can check the /root/edas-lightweight/logs/start.out
      Note To adjust the values of Java virtual machine (JVM) startup parameters, specify the appropriate JVM parameters in the startup script based on your local environment.
  3. Optional:Check the started listening ports of the light-weight configuration registry.

    After startup, the local node listens to the following ports:

    • Port 8848: used for configuration management and service registration of Nacos applications
    • Port 9600: used for HSF or Dubbo service registration and subscription
    • Port 8080: supports service registration and configuration management.

    For Linux and macOS environments, run netstat -an | grep -E "8080|8848|9600" | grep -i listen to check whether the three ports are in the listening state. For Linux, you can also run netstat -nltp | grep -E "8080|8848|9600" to check whether the three ports are enabled by the process of the light-weight configuration registry.

Step 3: Configure hosts in the local development environment

Configure the hosts file of the light-weight configuration registry on the machine where you want to develop and test applications by using the light-weight configuration registry. To be specific, in the Domain Name System (DNS) or the hosts file, configure the jmenv.tbsite.net domain name to point to the IP address of the machine where the light-weight configuration registry is enabled.

  1. Open the hosts file.
    • Windows operating system: C:\Windows\System32\drivers\etc\hosts
    • UNIX operating system: /etc/hosts
  2. Add the configuration of the light-weight configuration registry.
    • If you enable the light-weight configuration registry on a machine whose IP address is 192.168.1.100, add 192.168.1.100 jmenv.tbsite.net in the hosts file.
    • If you enable the light-weight configuration registry on the local machine, change the preceding IP address to 127.0.0.1 jmenv.tbsite.net in the hosts file.

Verify the result

Verify the light-weight configuration registry in the following two aspects:
  • Verify the availability of the light-weight configuration registry.

    You can start the light-weight configuration registry on a local or independent machine. This results in two access modes.

    • Local machine

      Enter the URL http://127.0.0.1:8080 of the light-weight configuration registry in the web browser and press Enter.

    • Independent machine

      Enter the URL http://machine IP address:8080 of the light-weight configuration registry in the web browser and press Enter.

    Note After the hosts file is bound, you can access the light-weight configuration registry by using the domain name and the port number jmenv.tbsite.net:8080.

    If the homepage cannot appear, view the boot log logs/start.log in the installation directory to identify the cause of failed startup and fix the bug.

  • Verify the feature availability.

    The light-weight configuration registry provides features such as service registration, discovery, configuration management, and namespaces. The configuration management and namespace features are available only if you previously used Nacos.

    Some users previously used the light-weight configuration center or Nacos, and some users use the light-weight configuration registry for the first time. Therefore, the feature availability is verified in two scenarios based on whether you are an original user or a new user.

    • If you previously used the light-weight configuration center or Nacos, you can directly verify the feature availability based on the business logic after you start the light-weight configuration registry.
    • If you did not previously use the light-weight configuration center or Nacos, you need to add and modify configurations in your application after you download and start the light-weight configuration registry. We recommend that you verify the feature availability by referring to the application development documents for specific features.

Reference documents

If you encounter problems when you use the light-weight configuration registry, see .