当前位置:网站首页>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
边栏推荐
- MySql的初识感悟,以及sql语句中的DDL和DML和DQL的基本语法
- Worthington木瓜蛋白酶&胰凝乳蛋白酶&脱氧核糖核酸酶 I
- Introduction to Worthington Elastase & Hyaluronidase
- Worthington经过使用测试的细胞分离系统方案
- 经典论文-SqueezeNet论文及实践
- 绘制几何图形
- YoloV5数据集自动划分训练集、验证集、测试集
- try_catch捕获异常
- Worthington酶促细胞收获&细胞粘附和收获
- Worthington dissociating enzyme: detailed analysis of neutral protease (dispase)
猜你喜欢

Ubuntu中使用SQLite

Decision tree principle and code implementation

Selenium上传文件有多少种方式?不信你有我全

【Flutter】Flutter inspector 工具使用详解,查看Flutter布局,widget树,调试界面等

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

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

rk-boot framework combat (1)

BEVDetNet: Bird's Eye View LiDAR Point Cloud based Real-time 3D Object Detection for Autonomous Drivi

从尾到头打印链表

Paper Intensive Reading - YOLOv3: An Incremental Improvement
随机推荐
@RequestParam注解的详细介绍
[Best training DAY16] KC's Can [Dynamic programming]
Recurrent Neural Network (RNN)
CNN的粗浅理解
【MySQL系列】MySQL数据库基础
重建二叉树
【分层强化学习】HAC源码解读
canvas 中如何实现物体的框选(六)
QTableWidget使用示例
7.28
Google Chrome (google) is set to translate Chinese, the translation option does not take effect or the translation option does not pop up
At the age of 29, I was fired from a functional test. Can't find a job after 2 months of interviews?
Mysql internal and external connections
EA&UML日拱一卒-多任务编程超入门-(9)线程同步
Ubuntu中使用SQLite
Chinese semantic matching
servlet执行详解
Vmtouch - under Linux file cache management artifact
【经验】经验总结-经验教训
opencv基本图像的滤波