当前位置:网站首页>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
边栏推荐
- Tencent Internal Technology: Evolution of Server Architecture of "The Legend of Xuanyuan"
- 【C语言】结构体变量数据通过 void* 传入到函数中
- 七夕!专属于程序员的浪漫表白
- 农场游戏果园系统+牧场养殖系统+广告联盟模式流量主游戏小程序APP V1
- Writing OpenCV in VSCode
- 数组&的运算
- LaTeX笔记
- Transformer interprets and predicts instance records in detail
- 花花省V5淘宝客APP源码无加密社交电商自营商城系统带抖音接口
- Q 2020, the latest senior interview Laya soul, do you know?
猜你喜欢
随机推荐
获取预训练模型的网络输入尺寸
多用户商城多商户B2B2C拼团砍价秒杀支持小程序H5+APP全开源
NB-IOT智能云家具项目系列实站
摆脱极域软件的限制
Network Protocol Fundamentals - Study Notes
cs231n learning record
滚动条问题,未解决
【内推】新相微电子
【2022 DSCTF决赛wp】
指针常量与常量指针 巧记
D41_buffer pool
Freeswitch操作基本配置
numpy.random usage documentation
Come, come, let you understand how Cocos Creator reads and writes JSON files
网络协议基础-学习笔记
花花省V5淘宝客APP源码无加密社交电商自营商城系统带抖音接口
The use of three parameters of ref, out, and Params in Unity3D
Seven Ways to Center a Box Horizontally and Vertically
浏览器兼容汇总
《PyTorch深度学习实践》第十一课(卷积神经网络CNN高级版)