当前位置:网站首页>nacos外置数据库的配置与使用
nacos外置数据库的配置与使用
2022-07-29 05:21:00 【麻辣隔壁4】
在nacos进行集群配置时,如果使用其内置数据库derby会产生数据配置的不对称和不同步。
上述是官网的nacos服务配置的关系图。我们假设现在nacos有3台机器。101,102,103.如果使用内置的服务数据库,则这三台nacos各自都有自己的数据库。如果我们在每一台都进行文件的配置和注册,那修改起来比较麻烦。并且你也保证不了数据文件的同步更新。容易产生遗漏和不对称。所以nacos官网给我们提供了外置数据库的方法。即三台nacos配置统一的nacos.
步骤:
1.在你的数据库中建立nacos数据库。将mysql的脚本文件导入。脚本文件的地址:https://github.com/alibaba/nacos/blob/master/distribution/conf/nacos-mysql.sql
2.修改nacos中的mysql连接配置:
spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://localhost:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=123456
注意:此配置放的位置必须是在其说明的位置,要不会找不到mysql配置。启动nacos会报错,起不来。
配置完成后,启动nacos,则可以换到自己的mysql数据库了,最后来张图镇楼:
边栏推荐
- Thinkphp6 output QR code image format to solve the conflict with debug
- IDEA使用JDBC连接MySQL数据库个人详细教程
- Differences between href and SRC
- The completely decentralized programming mode does not need servers or IP, just like a aimless network extending everywhere
- The difference between link and @import importing external styles
- Elastic box flex
- Research and implementation of flash loan DAPP
- 与张小姐的春夏秋冬(2)
- How does PHP generate QR code?
- 如何在加密市场熊市中生存?
猜你喜欢
麦当娜“Hellbent”购买130万美元的nft无聊猿,现在被认为太贵了
PHP write a diaper to buy the lowest price in the whole network
"Shandong University mobile Internet development technology teaching website construction" project training log I
如何零代码制作深度学习的趣味app(适合新手)
Starfish OS: create a new paradigm of the meta universe with reality as the link
DAO赛道异军突起,M-DAO的优势在哪里?
以‘智’提‘质|金融影像平台解决方案
Breaking through the hardware bottleneck (I): the development of Intel Architecture and bottleneck mining
Extreme deflation and perpetual motion machine model will promote the outbreak of platofarm
Madonna "hellent" bought $1.3 million NFT boring ape, which is now considered too expensive
随机推荐
Breaking through the hardware bottleneck (I): the development of Intel Architecture and bottleneck mining
微信内置浏览器禁止缓存的问题
Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round
并发编程学习笔记 之 ReentrantLock实现原理的探究
剑指核心-TaoCloud全闪SDS助力构建高性能云服务
运动健康深入人心,MOVE PROTOCOL引领品质生活
“山东大学移动互联网开发技术教学网站建设”项目实训日志五
Laravel swagger add access password
Fantom (FTM) surged 45% before the FOMC meeting
Gluster集群管理小分析
How to survive in the bear market of encryption market?
重庆大道云行作为软件产业代表受邀参加渝中区重点项目签约仪式
Fantom (FTM) 价格将在未来几天飙升 20%
“山东大学移动互联网开发技术教学网站建设”项目实训日志三
day02作业之进程管理
Madonna "hellent" bought $1.3 million NFT boring ape, which is now considered too expensive
MySQL decompressed version windows installation
My ideal job, the absolute freedom of coder farmers is the most important - the pursuit of entrepreneurship in the future
性能对比|FASS iSCSI vs NVMe/TCP
“山东大学移动互联网开发技术教学网站建设”项目实训日志六