Linux installation Nacos cluster [detailed steps]


Recommended Reading articles

Micro-Services, has this one is enough
Distributed micro-services architecture (primary articles)
Dubbo depth understanding of core concepts, you can not miss this article

Cluster mode deployment

  • Therefore, when the open-source users to recommend a list of all services into a vip below, then hang on to a domain name below

  • http: // ip1: port / openAPI direct mode ip, ip hang the machine needs to be modified before they can be used.

  • http: // VIP: port / openAPI mount VIP mode, can be directly connected vip, hanging below the real server ip, readability bad.

  • http://nacos.com:port/openAPI domain name + VIP mode, readable, and easy to change ip, the recommended mode
    Here Insert Picture Description

Installing MySQL database

Installation Nacos

  • Upload Package to usr/local/directory
  • Unzip the installation package
tar -zxvf 包名
  • Copy the contents of nacos-mysql.sql
cd /nacos/conf
cat nacos-mysql.sql
  • Then copy the construction of the table statement, in the implementation of the database table prior to installation of the construction
    Here Insert Picture Description
  • application.properties
cd /usr/local/nacos/conf
vi application.properties

Add the following

spring.datasource.platform=mysql
 
db.num=1
db.url.0=jdbc:mysql://192.168.25.129:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=123456
  • cluster.conf
cp cluster.conf.example cluster.conf
vi cluster.conf

Add the following

192.168.25.129:8848
192.168.25.130:8848
192.168.25.131:8848
  • Modify startup.sh
cd /nacos/bin
vi startup.sh

Before the amendment
Here Insert Picture Description
before the amendment
Here Insert Picture Description
modified
Here Insert Picture Description

  • Software startup
./startup.sh -s nacos-address
//启动指定端口号的nacos
./startup.sh -p 8848
  • View the number of running nacos
ps -ef|grep nacos|grep -v grep|wc -l
  • Software off:
    • In linux command execution lookups ID
ps -ef | grep nacos-address
  • In linux execute the kill command ID:
kill -9 进程ID号

The more you know, the more you do not know.
Proper way without surgery, patients can still seek, there is no way to surgery, ending surgery.
If you have other questions, welcome message, we can discuss, learn together and progress together

He published 195 original articles · won praise 118 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_40722827/article/details/105122812