You can use the lightweight configuration and registration center locally for application registration, discovery, and configuration management during application development and testing. When you deploy applications to EDAS or , these features remain available. This topic describes how to download, start, and verify the lightweight configuration and registration center.
Upgrade notes
The lightweight configuration center has been upgraded to the lightweight configuration and registration center. The new center is compatible with all use cases of the original lightweight configuration center and adds support for Nacos.
The following table compares the features before and after the upgrade.
Feature |
Lightweight configuration center |
Lightweight configuration and registration center |
Configuration management using Application Configuration Management (ACM) |
Support |
Support |
Service registration and discovery using Application Naming Service (ANS) |
Support |
Support |
Service registration, discovery, and configuration management for High-speed Service Framework (HSF) applications |
Support |
Support |
Service registration, discovery, and configuration management using Nacos |
Not supported |
Supported |
If you previously used the lightweight configuration center, you can switch directly to the lightweight configuration and registration center.
The Nacos registry and configuration center supports all of these features.
Prerequisites
Before you use the lightweight configuration and registration center, complete the following tasks:
Download Java Development Kit (JDK) 1.8 or later and set the
JAVA_HOMEenvironment variable.Make sure that ports 8080, 8848, and 9600 are not in use.
NoteThe lightweight configuration and registration center uses ports 8080, 8848, and 9600. We recommend that you install and start the center on a dedicated machine. If you use it on your local machine, you must change your application's port to avoid conflicts.
The lightweight configuration and registration center does not support Dubbo 3.0.
Step 1: Download the lightweight configuration and registration center
For Windows:
Download the lightweight configuration and registration center package.
Decompress the package to a local directory.
For Unix/macOS:
Run the
wget http://edas.oss-cn-hangzhou.aliyuncs.com/edas-res/edas-lightweight-server-1.0.0.tar.gzcommand to download the lightweight configuration and registration center package.Run the
tar -zvxf edas-lightweight-server-1.0.0.tar.gzcommand to decompress the package.
WarningThe lightweight configuration and registration center is intended for local development and testing only. Do not use it in a production environment. To expose it to the public network, you must control access using an IP address policy.
Step 2: Start the lightweight configuration and registration center
Go to the
edas-lightweight\bindirectory.Start the lightweight configuration and registration center and check the result.
Windows: Double-click
startup.bat.
Unix/macOS: 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=/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:/service/edas-lightweight/plugins/cmdb:/service/edas-lightweight/plugins/mysql -Xloggc:/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=/service/edas-lightweight -Dnacos.standalone=true -jar /service/edas-lightweight/target/edas-lightweight.jar --spring.config.location=classpath:/,classpath :/config/,file:./,file:./config/,file:/service/edas-lightweight/conf/ --logging.config=/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 /edas-lightweight/logs/start.outNoteTo adjust the Java Virtual Machine (JVM) startup parameters, you can set the appropriate parameters in the startup script to match your local environment.
Optional: Check the listening ports of the lightweight configuration and registration center.
After a normal startup, it listens on the following three ports on this node:
8848: Supports configuration management and service registration for Nacos-based applications.
9600: Service registration and subscription for HSF and Dubbo.
8080: Supports service registration using ANS and configuration management using ACM.
On a Linux or macOS operating system, you can run the
netstat -an | grep -E "8080|8848|9600" | grep -i listencommand to check whether the three ports are in the listening state. On a Linux operating system, you can also run thenetstat -nltp | grep -E "8080|8848|9600"command to check whether the ports are open and associated with the process of the lightweight configuration and registration center.
Step 3: Configure the hosts file in your local development environment
You must configure the hosts file on the machine that you use to develop and test applications. In the hosts file, map the jmenv.tbsite.net domain name to the IP address of the machine where the lightweight configuration and registration center is running.
Open the hosts file.
For the Windows operating system: C:\Windows\System32\drivers\etc\hosts.
For Unix/macOS operating systems: /etc/hosts.
Add the configuration for the lightweight configuration and registration center.
If you start the lightweight configuration and registration center on a machine with the IP address 192.168.1.100, add
192.168.1.100 jmenv.tbsite.netto the hosts file.If you start the lightweight configuration and registration center locally, add
127.0.0.1 jmenv.tbsite.netto the hosts file.
Result Validation
The verification process consists of two parts:
Availability of the lightweight configuration and registration center.
Feature availability. This includes configuration management, service registration, and namespaces. The namespaces feature is available only if you have previously used Nacos.
Verify the availability of the lightweight configuration and registration center
You can start the lightweight configuration and registration center on your local machine or on a separate machine. The access method depends on your setup.
On your local machine
In a browser, enter the address
http://127.0.0.1:8080and press Enter.On a separate machine
In a browser, enter the address
http://<Machine IP address>:8080and press Enter.
After you configure the hosts file, you can directly access the center using its domain name and port: jmenv.tbsite.net:8080.
The home page of the lightweight configuration and registration center is shown in the following figure:
If the home page does not display correctly, check the logs/start.log file in the installation directory to identify the cause of the startup failure and resolve the issue.
Verify feature availability
The lightweight configuration and registration center provides features such as service registration, service discovery, configuration management, and namespaces. The namespaces feature is available only to users who have previously used Nacos.
The verification process differs for existing users and new users.
Existing users can verify feature availability based on their business logic after they download and start the lightweight configuration and registration center.
New users must add or modify configurations in their applications after they download and start the lightweight configuration and registration center. For more information about how to verify feature availability, see the application development documents for the specific features.