You can use the lightweight configuration center in an on-premises environment for service registration, discovery, and configuration management when you develop and test applications. These features are still available after you deploy applications. This topic describes how to download the lightweight configuration center package, and then start and verify the lightweight configuration center in the Linux or macOS operating system.
Before you start
The light-weight configuration center has been updated to the lightweight configuration center. The lightweight configuration center is compatible with the light-weight configuration center and provides additional support for Nacos.
The following table compares the features before and after the update.
Feature | Light-weight configuration center | Lightweight configuration center |
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 High-speed Service Framework (HSF) applications | Supported | Supported |
Service registration, discovery, and configuration management by using Nacos | Not supported | Supported |
You can directly switch from the light-weight configuration center to the lightweight configuration center.
Nacos supports all the features in the preceding table.
Prerequisites
Before you use the lightweight configuration center, make sure that the following prerequisites are met:
Java Development Kit (JDK) 1.8 or later is downloaded. The environment variable
JAVA_HOME
is configured.Ports 8080, 8848, and 9600 are not in use.
NoteThe lightweight configuration center occupies ports 8080, 8848, and 9600. We recommend that you install and start the lightweight configuration center on a dedicated machine. If you use the lightweight configuration center on an on-premises machine, use other ports.
The lightweight configuration center does not support Dubbo 3.0.
Step 1: Download the lightweight configuration center package
Run the
wget http://edas.oss-cn-hangzhou.aliyuncs.com/edas-res/edas-lightweight-server-1.0.0.tar.gz
command to download the lightweight configuration center package.Run the
tar -zvxf edas-lightweight-server-1.0.0.tar.gz
command to decompress the package.
The lightweight configuration center can be used only for development and testing in an on-premises environment. Do not use the lightweight configuration center in the production environment. If you expose the lightweight configuration center to the Internet, use an IP address-based access policy for access control.
Step 2: Start the lightweight configuration center
Go to the
edas-lightweight\bin
directory.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.out
Optional: Check the started listening ports of the lightweight configuration center.
After startup, the lightweight configuration center listens on the following ports:
Port 8848: listens to the configuration management and service registration of Nacos applications.
Port 9600: listens to HSF or Apache Dubbo service registration and subscription.
Port 8080: listens to service registration by using ANS and configuration management by using ACM.
You can run the
netstat -an | grep -E "8080|8848|9600" | grep -i listen
command to check whether the three ports are in the listening state. For a Linux operating system, you can also run thenetstat -nltp | grep -E "8080|8848|9600"
command to check whether the three ports are enabled by the process of the lightweight configuration center.
Step 3: Configure hosts in the on-premises development environment
Configure the hosts of the lightweight configuration center on the machine where you want to develop and test applications by using the lightweight configuration center. 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 on which the lightweight configuration center is started.
Open the hosts file.
Linux or macOS operating system:
/etc/hosts
.Add the configuration of the lightweight configuration center.
If you start the lightweight configuration center on a machine whose IP address is 192.168.1.100, add
192.168.1.100 jmenv.tbsite.net
to the hosts file.If you start the lightweight configuration center on an on-premises machine, change the preceding IP address and add
127.0.0.1 jmenv.tbsite.net
to the hosts file.
Verify the result
Verify the lightweight configuration center in the following aspects:
Availability of the lightweight configuration center.
Functionality of the lightweight configuration center, including configuration management, service registration, and namespaces. Namespaces are available only if you previously used Nacos.
Verify the availability of the lightweight configuration center
You can start the lightweight configuration center on an on-premises or independent machine. This results in two access modes.
On-premises machine
Enter the URL
http://127.0.0.1:8080
of the lightweight configuration center in the address bar of a browser and press the ENTER key.Independent machine
Enter the URL
http://Machine IP address:8080
of the lightweight configuration center in the address bar of a browser and press the ENTER key.
After the hosts file is modified, you can access the lightweight configuration center 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 functionality of the lightweight configuration center
The lightweight configuration center provides features such as service registration, discovery, configuration management, and namespaces. Namespaces are available only if you previously used Nacos.
Some users previously used the light-weight configuration center or Nacos, and some users use the lightweight configuration center for the first time. Therefore, the functionality 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 functionality based on the business logic after you start the lightweight configuration center.
If you use the lightweight configuration center for the first time, you must add and modify configurations in your application after you start the lightweight configuration center. We recommend that you verify the functionality by referring to the application development documents for specific features.