温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

docker怎么搭建nacos server

发布时间:2021-12-10 18:01:31 阅读:187 作者:柒染 栏目:大数据
亿速云云数据库,读写分离,安全稳定,弹性扩容,低至0.3元/天!! 点击查看>>

这篇文章将为大家详细讲解有关docker怎么搭建nacos server,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

docker 获取 nacos 镜像

docker pull nacos/nacos-server
获取nacos 最新版本

创建映射目录 (忽略)

配置 maria 数据库

编写配置文件 custom.properties
server.contextPath=/nacos
server.servlet.contextPath=/nacos
server.port=8848

spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://xxx.xx.xx.xx:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=1234

nacos.cmdb.dumpTaskInterval=3600
nacos.cmdb.eventTaskInterval=10
nacos.cmdb.labelTaskInterval=300
nacos.cmdb.loadDataAtStart=false
management.metrics.export.elastic.enabled=false
management.metrics.export.influx.enabled=false
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i
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/**
nacos.naming.distro.taskDispatchThreadCount=1
nacos.naming.distro.taskDispatchPeriod=200
nacos.naming.distro.batchSyncKeyCount=1000
nacos.naming.distro.initDataRatio=0.9
nacos.naming.distro.syncRetryDelay=5000
nacos.naming.data.warmup=true
nacos.naming.expireInstance=true
试过映射 conf/appcalition.properties 但是不起作用

启动 nacos

docker  run --name nacos --8848:8848 --privileged=true --restart=always -JVM_XMS=256m -JVM_XMX=256m -MODE=standalone -PREFER_HOST_MODE=hostname -D:/nacos/data:/home/nacos/data -v D:/nacos/logs:/home/nacos/logs -D:/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties nacos/nacos-server

日志

由于我将日志目录映射在本地,所以启动日志可以查看 D:\nacos\logs\start.out
启动成功后,可以在 http://127.0.0.1:8848/nacos/ 访问到nacos 
账号/密码 : nacos/nacos

关于docker怎么搭建nacos server就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

亿速云「云数据库 MySQL」免部署即开即用,比自行安装部署数据库高出1倍以上的性能,双节点冗余防止单节点故障,数据自动定期备份随时恢复。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

原文链接:https://my.oschina.net/mmuuyyuu/blog/4643680

AI

开发者交流群×