1. docker pull nacos/nacos-server
    1. 下载地址
    2. https://github.com/alibaba/nacos/blob/master/config/src/main/resources/META-INF/nacos-db.sql
    1. mkdir -p /mydata/nacos/logs/ #新建logs目录
    2. mkdir -p /mydata/nacos/init.d/
    3. vim /mydata/nacos/init.d/custom.properties #修改配置文件
    1. server.contextPath=/nacos
    2. server.servlet.contextPath=/nacos
    3. server.port=8848
    4. spring.datasource.platform=mysql
    5. db.num=1
    6. db.url.0=jdbc:mysql://192.168.56.10:13306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
    7. db.user=root
    8. db.password=123456
    9. nacos.cmdb.dumpTaskInterval=3600
    10. nacos.cmdb.eventTaskInterval=10
    11. nacos.cmdb.labelTaskInterval=300
    12. nacos.cmdb.loadDataAtStart=false
    13. management.metrics.export.elastic.enabled=false
    14. management.metrics.export.influx.enabled=false
    15. server.tomcat.accesslog.enabled=true
    16. server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i
    17. nacos.security.ignore.urls=/,/**/*.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/**
    18. nacos.naming.distro.taskDispatchThreadCount=1
    19. nacos.naming.distro.taskDispatchPeriod=200
    20. nacos.naming.distro.batchSyncKeyCount=1000
    21. nacos.naming.distro.initDataRatio=0.9
    22. nacos.naming.distro.syncRetryDelay=5000
    23. nacos.naming.data.warmup=true
    24. nacos.naming.expireInstance=true
    1. docker run \
    2. --name nacos -d \
    3. -p 8848:8848 \
    4. --privileged=true \
    5. --restart=always \
    6. -e JVM_XMS=256m \
    7. -e JVM_XMX=256m \
    8. -e MODE=standalone \
    9. -e PREFER_HOST_MODE=hostname \
    10. -v /mydata/nacos/logs:/home/nacos/logs \
    11. -v /mydata/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties \
    12. nacos/nacos-server
    13. docker run -p 8848:8848 --name nacos \
    14. --privileged=true --restart=always \
    15. -e JVM_XMS=256m \
    16. -e JVM_XMX=256m \
    17. -e MODE=standalone \
    18. -e PERFER_HOST_MODE=hostname \
    19. -v /mtdata/nacos/logs:/home/nacos/logs \
    20. -v /mydata/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties \
    21. -d nacos/nacos-server
    1. 浏览器输入服务器地址:http://192.168.56.10:8848/nacos/index.html,账号nacos 密码nacos,登陆成功!