当前位置:网站首页>Detailed explanation of nacos cluster configuration
Detailed explanation of nacos cluster configuration
2022-07-30 00:33:00 【m0_67393157】
Preamble:
To avoid a single point of failure, nacos needs to adopt cluster mode, and the database must be replaced with a high-availability mysql database (the built-in derby database is difficult to achieve consistent cluster configurationsex)
- nacos switch mysql database
The downloaded nacos installation package comes with nacos-mysql.sql script
Execute this script in your own mysql database, and create a nacos_config database before executing it.After executing the script as shown in the figure:
Now start to modify nacos/In the application.properties configuration file under conf, configure the mysql configuration information.As shown in the figure:
Finally restart nacos and visit localhost:8848/nacos, you can log in.
If the startup is unsuccessful, it may be that the mysql version that comes with nacos is too low, and replace it with your own.
Solution: Create a new plugins/mysql (mkdir plugins &mkdir plugins/mysql) in the nacos directory, and add the own version of the mysql.jar package (I use 8.0.28)
> Restart the service and you are done!
Test it, you can add a configuration information by yourself
Local mysql query:
So far, nacos has completed switching mysql database. - Build a nacos cluster (1 nginx+3 nacos+mysql, it is recommended to complete it under Linux)
- Modify the nacos/bin/startup.sh configuration file
Before modifying, you can make a copy of the startup.sh file, cp startup.sh startup.sh.bk. Then modify startup.sh.
Modify the following points in order:
The first point:
Second place:
startup.sh, save and exit after modification.
Here we use ports to map 3 different nacos, so we have to configure port parameters. - Modify cluster.conf(nacos/conf/cluster.conf)

- Configure nginx
- Modify nginx.conf

- Start nacos and nginx
Execute ./startup.sh -p 3333, ./startup.sh -p 4444, ./startup.sh -p 5555 in sequence
The following information appears, indicating success
You can also view the log information output by start.out
View the number of nacos clusters: ps -ef|grep nacos|grep -v grep|wc -l
Display 3 is rightStart nginx
nginx -c nginx.conf (your nginx.conf directory)
Access nacos cluster through nginx
http://192.168.1.100:1111/nacos/#/login
Successful access to nacos indicates that the cluster configuration is complete, you can self-test and add some configuration information, query the local mysql.
The SpringBoot is integrated later, and the configuration of each microservice can be changed to the cluster configuration, that is, to the address monitored by nginx.
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- Towhee 每周模型
- 某团实习面经
- “ 我是一名阿里在职9年软件测试工程师,我的经历也许能帮到处于迷茫期的你 ”
- rk-boot framework combat (1)
- 【分层强化学习】HAC源码解读
- Codeforces Round #805 (Div. 3) Summary
- Elephant Swap: Provide arbitrage space in the crypto market with ePLATO
- 谷歌浏览器(google)设置翻译中文,翻译选项不生效或没有弹出翻译选项
- Genesis与Axis Ventures互动密切
- i.MX6U-driver development-3-new character driver
猜你喜欢

4 hotspot inquiry networks necessary for new media operations

Worthington弹性蛋白酶&透明质酸酶简介

重新定义分析 - EventBridge 实时事件分析平台发布

EA & UML Sun Arch - State Diagram :: Redraw Button State Diagram

Reading notes. This is the psychology: see through the essence of the pseudo psychology (version 10)"

vmtouch——Linux下的文件缓存管理神器

自媒体短视频标题怎么写?3个爆款标题,让你的视频收获更多流量

外包干了五年,废了...

EA&UML日拱一卒-多任务编程超入门-(9)线程同步

He cell separation technology 丨 basic primary cell separation methods and materials
随机推荐
Douyin short video traffic acquisition strategy, mastering these will definitely be a hit
The go language (functions, closures, defer, panic/recover, recursion, structure, json serialization and deserialization)
7.27
Worthington's tried and tested cell isolation system protocols
vmtouch——Linux下的文件缓存管理神器
某团实习面经
Filebeat如何保证在日志文件被切割(或滚动rolling)时依然正确读取文件
【集训DAY16】ALFA【凸壳】【计算几何】
Weekly recommended short video: What is R&D efficiency?It can achieve anti "involution"?
Towhee 每周模型
Introduction to Worthington Elastase & Hyaluronidase
Navicat for mysql破解版安装
抖音短视频流量获取攻略,掌握好这些一定可以出爆款
The range of motion of the robot
2022/7/29 Exam Summary
go语言解决自定义header的跨域问题
KDE Frameworks 5.20.0: Plasma welcomes many improvements
验证框架-01
WeChat developer tools set the tab size to 2
Finding a 2D Array