当前位置:网站首页>Nacos cluster construction
Nacos cluster construction
2022-08-05 06:50:00 【User Nickname 23】
Nacos cluster construction
I. Introduction
This article mainly introduces how to build a nacos cluster. The example uses 3 servers to build.
Tips: The following is the text of this article, the following cases are for reference
Second, installation preparation
Nacos is developed based on java, and its operation depends on the java environment.Depends on 64 bit JDK 1.8+, please install jdk by yourself.
1. Download
The download of nacos project is slow from github due to the influence of the network, and it can be downloaded from gitee
git clone https://gitee.com/mirrors/Nacos.git
2. Compile
Open the command line in the downloaded nacos root directory, execute mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U to compile and package (maven environment needs to be installed), it is recommended to download the official compiled onepackage, the address is: https://github.com/alibaba/nacos/releases/download/1.3.0/nacos-server-1.3.0.tar.gz.
Copy nacos/distribution/target/nacos-server-1.3.0.tar.gz to the /app directory of server1.
Extract the tar -zxf nacos-server-1.3.0.tar.gz.
Third, modify related configuration
1. Modify the cluster configuration file /app/nacos/conf/cluster.conf
#Open the directory where the configuration file is located
cd /data/nacos/conf/
#Modify the cluster configuration file name
mv cluster.conf.example cluster.conf
#Modify cluster configuration
vim cluster.conf10.18.10.148:884810.18.10.149:884810.18.10.150:8848
2. Modify the data source configuration file /app/nacos/conf/application.properties
### If use MySQL as datasource:spring.datasource.platform=mysql### Count of DB:db.num=1### Connect URL of DB:db.url.0=jdbc:mysql://192.168.2.168:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTCdb.user=nacosdb.password=nacos123
3. Create database nacos and create account nacos/nacos123
CREATE USER 'nacos'@'%' IDENTIFIED BY 'nacos123';GRANT ALL ON nacos.* TO 'nacos'@'%';
4. Execute /app/nacos/conf/nacos-mysql.sql script
Fourth, copy nacos to the other two servers
scp -r /app/nacos/ [email protected]:/app/scp -r /app/nacos/ [email protected]:/app/
V. Start and log in to test
1. Start nacos with 3 servers
Execute the following command to start the nacos service
sh /app/nacos/startup.sh
2. Login test, default account password nacos/nacos
http://10.18.10.148:8848/nacos
http://10.18.10.149:8848/nacos
http://10.18.10.150:8848/nacos
Let me introduce myself first. The editor graduated from Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Ali 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
边栏推荐
猜你喜欢
随机推荐
The use of three parameters of ref, out, and Params in Unity3D
Collision, character controller, Cloth components (cloth), joints in the Unity physics engine
【2022 DSCTF决赛wp】
白鹭egret添加新页面教程,如何添加新页面
设置文本向两边居中展示
DevOps - Understanding Learning
golang-条件语句
D46_Force applied to rigid body
【FAQ】What is Canon CCAPI
浮点数基础知识
Detailed explanation of the construction process of Nacos cluster
Nacos配置服务的源码解析(全)
格式化代码缩进的小技巧
浏览器兼容汇总
LeetCode练习及自己理解记录(1)
八大排序之快速排序
微信小程序仿input组件、虚拟键盘
uniapp打包次数限制怎么办?只需两步就能解决
利用将网页项目部署到阿里云上(ngnix)
【考研结束第一天,过于空虚,想对自己进行总结一下】