docker安装nacos

时间:2025-04-03 15:55:03

一、docker安装nacos

# 拉取nacos
docker pull nacos/nacos-server
# 创建文件夹
mkdir -p /kikiguli/mydata/nacos/logs/
mkdir -p /kikiguli/mydata/nacos/init.d/
# 修改配置文件
vim /mydata/nacos/init.d/custom.properties        #修改配置文件
# mysql新建nacos的数据库,并执行脚本 sql脚本地址如下:
https://github.com/alibaba/nacos/blob/master/config/src/main/resources/META-INF/nacos-db.sql

# 运行nacos 
docker  run \
--name nacos-kiki -d \
-p 8849:8848 \
--privileged=true \
--restart=always \
-e JVM_XMS=256m \
-e JVM_XMX=256m \
-e MODE=standalone \
-e PREFER_HOST_MODE=hostname \
-v /kikiguli/mydata/nacos/logs:/etc/nacos/logs \
-v /kikiguli/mydata/nacos/init.d/custom.properties:/etc/nacos/init.d/custom.properties \
nacos/nacos-server


二、

=/nacos
=/nacos
=8848
 
=mysql
=1
.0=jdbc:mysql://8.131.80.230:3316/nacos_devtest_prod?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
=root
=root
 
=3600
=10
=300
=false
=false
=false
=true
=%h %l %u %t "%r" %s %b %D %{User-Agent}i
=/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health/**,/v1/cs/**,/v1/ns/**,/v1/cmdb/**,/actuator/**,/v1/console/server/**
=1
=200
=1000
=0.9
=5000
=true
=true