Current location - Quotes Website - Team slogan - Nacos Configuration Center changed from single-click mode to cluster mode.
Nacos Configuration Center changed from single-click mode to cluster mode.
Nacos, as the configuration center, can extract the configuration of configuration items to the outside and manage them independently. When deploying nacos alone, the project can't get the correct configuration information when the nacos service is abnormal. If nacos is built into a cluster environment, as long as all the machines in the cluster are not hung up, the configuration can be read normally, which can improve the stability of the project.

Need multiple linux machines as a cluster environment.

In addition, linux machines are required to include maven environment and java environment.

Github address: /alibaba/nacos

Create a new cluster.conf file, or rename cluster.conf.example to cluster.conf.

Add the cluster address and port number to the file.

Create a new application.properties file or rename application.properties.example to application.properties.

Execute the startup.sh script in the bin directory.

Ps: sh startup.sh starts in cluster mode by default, and sh startup.sh -m standalone starts in stand-alone mode.

After successful startup, visit the address (ip:8848/nacos/#/login), user name and password of each machine: nacos/nacos.

If everyone can visit normally, then everything is normal.

Start the project, and you can see the related logs of nacos connection in the background.

And the project can read the configuration content normally, then everything is normal.

If you use jenkins to deploy the project, you need to modify jenkins' nacos configuration so that it can correctly read every machine in the nacos cluster.