Linux - Install nacos 2.1.0

  1. Installation package download
  • The URL is https://github.com/alibaba/nacos/tags click to visit
    Insert image description here
  • 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>

Insert image description here

  1. Linux server usr/local/creates a new foldermkdir nacos
    Insert image description here

  2. 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 nacosand use the command mv * ../
    to move all the things inside, and then use the command rmdir nacosto delete the empty nacos folder inside.Insert image description here
  1. Enter the configuration folder cd /usr/local/nacos/confand execute the command cp cluster.conf.example cluster.confto copy a configuration file.
    Insert image description here
  2. Then edit vi cluster.confand modify your nacos cluster server address and port number

Insert image description here

  1. Modify the startup configuration file parameters vi application.properties, as shown in the figure below, remove the commented #numbers and modify the corresponding parameters.

Insert image description here
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 firewallsystemctl stop firewalld

  • Restart firewallsystemctl start firewalld

  • View open portsfirewall-cmd --list-port

  1. Configure automatic startup at boot (optional) Click to view
  2. Start nacos (Note: JDK environment needs to be configured, click to view )
    sh /usr/local/nacos/bin/startup.sh

Guess you like

Origin blog.csdn.net/weixin_45495923/article/details/131514904