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.3.2/nacos-server-1.3.2.tar.gz

run-standalone

cd bin
bash startup.sh -m standalone

vi conf/application.properties

run-cluster

bash startup.sh -m cluster
vi conf/cluster.conf
# 配置3个或3个以上节点

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

ref