当前位置:网站首页>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数据库了,最后来张图镇楼:
边栏推荐
- Elastic box flex
- Crypto giants all in metauniverse, and platofarm may break through
- Gluster集群管理小分析
- Some opportunities for young people in rural brand building
- 初探fastJson的AutoType
- "Shandong University mobile Internet development technology teaching website construction" project training log I
- Go|gin quickly use swagger
- Reporting Services- Web Service
- SQL repair duplicate data
- 剑指核心-TaoCloud全闪SDS助力构建高性能云服务
猜你喜欢
Xsan is highly available - xdfs and San are integrated with new vitality
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
Novice introduction: download from PHP environment to thinkphp6 framework by hand
华为2020校招笔试编程题 看这篇就够了(上)
运动健康深入人心,MOVE PROTOCOL引领品质生活
Synchronous development with open source projects & codereview & pull request & Fork how to pull the original warehouse
并发编程学习笔记 之 Lock锁及其实现类ReentrantLock、ReentrantReadWriteLock和StampedLock的基本用法
How to survive in the bear market of encryption market?
Fantom (FTM) prices will soar by 20% in the next few days
性能对比|FASS iSCSI vs NVMe/TCP
随机推荐
7 月 28 日 ENS/USD 价值预测:ENS 吸引巨额利润
The Platonic metauniverse advocated by musk has long been verified by platofarm
麦当娜“Hellbent”购买130万美元的nft无聊猿,现在被认为太贵了
Fantom (FTM) 价格将在未来几天飙升 20%
Thinkphp6 pipeline mode pipeline use
裸金属云FASS高性能弹性块存储解决方案
并发编程学习笔记 之 工具类CountDownLatch、CyclicBarrier详解
How can Plato obtain premium income through elephant swap in a bear market?
Fantom (FTM) 在 FOMC会议之前飙升 45%
华为2020校招笔试编程题 看这篇就够了(上)
CMD window under Windows connects to MySQL and operates the table
The bear market is slow, and bit.store provides stable stacking products to help you get through the bull and bear market
以‘智’提‘质|金融影像平台解决方案
Laravel swagger add access password
My ideal job, the absolute freedom of coder farmers is the most important - the pursuit of entrepreneurship in the future
Flink connector Oracle CDC 实时同步数据到MySQL(Oracle12c)
识变!应变!求变!
完全去中心化的编程模式,不需要服务器,也不需要ip,就像一张漫无目的的网络、四处延伸
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
Most PHP programmers don't understand how to deploy safe code