当前位置:网站首页>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
边栏推荐
- Reading notes. This is the psychology: see through the essence of the pseudo psychology (version 10)"
- [Cloud native Kubernetes] Build a Kubernetes cluster in binary (middle) - deploy node nodes
- opencv基本图像的滤波
- Codeforces Round #805 (Div. 3) Summary
- KDE Frameworks 5.20.0:Plasma迎来诸多改进
- 【励志】科比精神
- 谷歌浏览器(google)设置翻译中文,翻译选项不生效或没有弹出翻译选项
- How Filebeat ensures that the log file is still correctly read when the log file is split (or rolled)
- Superficial understanding of CNN
- [Experience] Experience Summary - Lessons Learned
猜你喜欢

Introduction to Worthington Elastase & Hyaluronidase

rk-boot framework combat (1)

低压差线性稳压器MPQ2013A-AEC1品牌MPS国产替代

Mysql internal and external connections

绘制几何图形

go语言解决自定义header的跨域问题

头条号自媒体运营:如何在今日头条涨500+粉丝?

The range of motion of the robot

Douyin short video traffic acquisition strategy, mastering these will definitely be a hit

Chinese semantic matching
随机推荐
新媒体运营必备的4个热点查询网
【分层强化学习】HAC源码解读
Worthington细胞分离技术丨基本原代细胞分离方法和材料
窗口函数笔记
Nacos配置中心用法详细介绍
Navicat报错:1045-Access denied for user [email protected](using passwordYES)
Laravel 预防 SQL 注入
中文语义匹配
"The lighthouse factory" of China path: smart roll out from point to surface
重新定义分析 - EventBridge 实时事件分析平台发布
Finding a 2D Array
Towhee 每周模型
Introduction to Worthington Elastase & Hyaluronidase
Douyin short video traffic acquisition strategy, mastering these will definitely be a hit
转发和重定向的区别及使用场景
Worthington's tried and tested cell isolation system protocols
Worthington酶促细胞收获&细胞粘附和收获
How Filebeat ensures that the log file is still correctly read when the log file is split (or rolled)
Chinese semantic matching
『牛客|每日一题』走迷宫