当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
MyCat安装
Successful indie developers deal with failure & imposters
【FAQ】CCAPI Compatible EOS Camera List (Updated in August 2022)
Email management Filter emails
LabVIEW中如何实现任意形状的不规则按键
reduce()方法的学习和整理
D39_ coordinate transformation
Network Protocol Fundamentals - Study Notes
字体样式及其分类
白鹭egret添加新页面教程,如何添加新页面
微信小程序仿input组件、虚拟键盘
ev加密视频转换成MP4格式,亲测可用
Transformer详细解读与预测实例记录
ES2020新特性
长度以及颜色单位基本概念
Pytorch distributed parallel processing
In-depth analysis if according to data authority @datascope (annotation + AOP + dynamic sql splicing) [step by step, with analysis process]
txt文件英语单词词频统计
D39_Vector
docker部署完mysql无法连接