- Installation package download
- The URL is
https://github.com/alibaba/nacos/tags
click to visit
- The nacos version I chose is 2.1.0 and the corresponding spring code version is
<spring.boot.version>2.3.12.RELEASE</spring.boot.version>
<spring.cloud.version>Hoxton.SR12</spring.cloud.version>
<spring.cloud.alibaba.version>2.2.9.RELEASE</spring.cloud.alibaba.version>
-
Linux server
usr/local/
creates a new foldermkdir nacos
-
Switch directories
cd /usr/local/nacos
, put the compressed package in and decompress ittar -zxvf nacos-2.2.4.tar.gz
- If there is an extra layer of nacos in the directory, you can enter the nacos inside
cd nacos
and use the commandmv * ../
to move all the things inside, and then use the commandrmdir nacos
to delete the empty nacos folder inside.
- Enter the configuration folder
cd /usr/local/nacos/conf
and execute the commandcp cluster.conf.example cluster.conf
to copy a configuration file.
- Then edit
vi cluster.conf
and modify your nacos cluster server address and port number
- Modify the startup configuration file parameters
vi application.properties
, as shown in the figure below, remove the commented#
numbers and modify the corresponding parameters.
7. Open port nacos 2.0 corresponding port
-
Open port 8848.
firewall-cmd --add-port=8848/tcp --permanent
Port 8848 is used to expose the API and synchronize data between clusters. -
Open port 7848
firewall-cmd --add-port=7848/tcp --permanent
Port 7848 is used for node election to determine the cluster leader (Leader) -
Open port 9849. Port
firewall-cmd --add-port=9849/tcp --permanent
9849, the client gRPC request server port, is used by the client to initiate connections and requests to the server. -
Open port 9848.
firewall-cmd --add-port=9848/tcp --permanent
The server gRPC requests the server port for inter-service synchronization, etc. -
Turn off firewall
systemctl stop firewalld
-
Restart firewall
systemctl start firewalld
-
View open ports
firewall-cmd --list-port
- Configure automatic startup at boot (optional) Click to view
- Start nacos (Note: JDK environment needs to be configured, click to view )
sh /usr/local/nacos/bin/startup.sh