install

#wget https://github.com/alibaba/nacos/releases/download/1.1.4/nacos-server-1.1.4.tar.gz
wget https://github.com/alibaba/nacos/releases/download/1.4.0/nacos-server-1.4.0.tar.gz

run-standalone

cd bin
bash startup.sh -m standalone

vi conf/application.properties

run-cluster

# 参考 conf/cluster.conf.example
vi conf/cluster.conf
# 配置3个或3个以上节点
# 创建数据库并导入conf/nacos-mysql.sql
# 修改application.properties中数据库
# 默认用户名密码nacos/nacos
bash startup.sh -m cluster

docker

docker network create nacos-net;

docker run -d \
--name nacos1 \
--hostname nacos1 \
--restart on-failure \
-p 10148:8848 \
--network nacos-net \
--env MODE=cluster \
--env PREFER_HOST_MODE=hostname \
--env NACOS_SERVERS="nacos1:8848 nacos2:8848 nacos3:8848" \
--env NACOS_APPLICATION_PORT=8848 \
--env SPRING_DATASOURCE_PLATFORM=mysql \
--env MYSQL_SERVICE_HOST=192.168.122.37 \
--env MYSQL_SERVICE_PORT=3306 \
--env MYSQL_SERVICE_DB_NAME=nacos \
--env MYSQL_SERVICE_USER=root \
--env MYSQL_SERVICE_PASSWORD=root \
--env NACOS_DEBUG=y \
nacos/nacos-server:1.3.2

docker run -d \
--name nacos2 \
--hostname nacos2 \
--restart on-failure \
-p 11248:8848 \
--network nacos-net \
--env MODE=cluster \
--env PREFER_HOST_MODE=hostname \
--env NACOS_SERVERS="nacos1:8848 nacos2:8848 nacos3:8848" \
--env NACOS_APPLICATION_PORT=8848 \
--env SPRING_DATASOURCE_PLATFORM=mysql \
--env MYSQL_SERVICE_HOST=192.168.122.37 \
--env MYSQL_SERVICE_PORT=3306 \
--env MYSQL_SERVICE_DB_NAME=nacos \
--env MYSQL_SERVICE_USER=root \
--env MYSQL_SERVICE_PASSWORD=root \
--env NACOS_DEBUG=y \
nacos/nacos-server:1.3.2

docker run -d \
--name nacos3 \
--hostname nacos3 \
--restart on-failure \
-p 11348:8848 \
--network nacos-net \
--env MODE=cluster \
--env PREFER_HOST_MODE=hostname \
--env NACOS_SERVERS="nacos1:8848 nacos2:8848 nacos3:8848" \
--env NACOS_APPLICATION_PORT=8848 \
--env SPRING_DATASOURCE_PLATFORM=mysql \
--env MYSQL_SERVICE_HOST=192.168.122.37 \
--env MYSQL_SERVICE_PORT=3306 \
--env MYSQL_SERVICE_DB_NAME=nacos \
--env MYSQL_SERVICE_USER=root \
--env MYSQL_SERVICE_PASSWORD=root \
--env NACOS_DEBUG=y \
nacos/nacos-server:1.3.2



 mysqldump -S /var/run/mysqld/mysqld.sock nacos_config \
 --no-create-db \
 --no-create-info \
 --extended-insert \
 --add-drop-table=FALSE \
 --add-locks=FALSE

To drop all conditional comments use one of the following:

mysqldump ... | grep -v '^\/\*![0-9]\{5\}.*\/;$'
mysqldump ... | sed -e 's/^\/\*![0-9]\{5\}.*\/;$//g'

grep -v '^\s*$'

ref