You can use the light-weight configuration registry in the local environment for application registration, discovery, and configuration management when developing and testing applications. These features are still available after applications are deployed to EDAS. This topic describes how to download, start, and verify the light-weight configuration registry.

Upgrade

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 as follows.
Feature Light-weight configuration center Light-weight configuration registry
Configuration management through Application Configuration Management (ACM) Supported Supported
Service registration and discovery through Application Naming Service (ANS) Supported Supported
Service registration, discovery, and configuration management for High-Speed Service Framework (HSF) applications Supported Supported
Service registration, discovery, and configuration management through Nacos Not supported Supported
Note You can directly switch from the light-weight configuration center to the light-weight configuration registry.

Prerequisites

Before using the light-weight configuration registry, you must complete the following tasks:
  • Download Java Development Kit (JDK) 1.8 or later and set the environment variable JAVA_HOME.
  • Check that ports 8080, 8848, and 9600 are not in use.
    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 than ports 8080, 8848, and 9600.

Step 1: Download the light-weight configuration registry

  • Windows:
    1. Download the light-weight configuration registry package.
    2. Decompress the package to a local path.
  • 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 only be used for 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 address whitelist 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/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/bin/java  -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320 m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/root/edas-lightweight/logs/java_heapdump.hprof -XX:-UseLargePages  -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64 /lib/ext:/root/edas-lightweight/plugins/cmdb:/root/edas-lightweight/plugins/mysql -Xloggc:/root/edas-lightweight/logs/nacos_gc.log -verbose:gc -XX:+P rintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/ root/edas-lightweight -Dnacos.standalone=true -jar /root/edas-lightweight/target/edas-lightweight.jar  --spring.config.location=classpath:/,classpath :/config/,file:./,file:./config/,file:/root/edas-lightweight/conf/ --logging.config=/root/edas-lightweight/conf/nacos-logback.xml --server.max-http-h eader-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 modify the values of Java virtual machine (JVM) startup parameters, set 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 on the following ports:

    • Port 8848: used for configuration management and service registration through Nacos
    • Port 9600: used for HSF and Dubbo service registration and subscription
    • Port 8080: used for registration from ANS and configuration management from ACM.

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

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. Specifically, 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 with the light-weight configuration registry enabled.

  1. Open the hosts file.
    • Windows: C:\Windows\System32\drivers\etc\hosts
    • UNIX: /etc/hosts
  2. Add the configuration of the light-weight configuration registry.
    • If you enable the light-weight configuration registry on a machine with the IP address 192.168.1.100, then add 192.168.1.100 jmenv.tbsite.net in the hosts file.
    • If you enable the light-weight configuration registry on the local machine, then 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 aspects:
  • Availability of the light-weight configuration registry
  • Functionality of the light-weight configuration registry, including configuration management, service registration, and namespaces, which are only available if you previously used Nacos
Verify the availability of the light-weight configuration registry
You can start the light-weight configuration registry on a local or independent machine, which 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 modified, you can directly access the light-weight configuration registry through the domain name and port number jmenv.tbsite.net:8080.

The following figure shows the homepage of the light-weight configuration registry.

If the homepage cannot be displayed properly, view the boot log logs/start.log in the installation directory to identify the cause of failed startup and fix the problem.

Verify the functionality of the light-weight configuration registry

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

Verification is divided into two scenarios, depending on whether you previously used the light-weight configuration center or Nacos.
  • If you previously used the light-weight configuration center or Nacos, you can directly verify functionality based on the business logic after starting 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 downloading and starting the light-weight configuration registry. We recommend that you verify functionality based on the application development documentation for specific features.

References

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