当前位置:网站首页>[microservice] Nacos data persistence and cluster building
[microservice] Nacos data persistence and cluster building
2022-07-18 09:01:00 【Classmate Tao Ran】

Here is 【 Microservices 】, Pay attention to me to learn micro services without getting lost
If it helps you , Give the blogger a free praise to show encouragement
You are welcome to comment on the collection ️
Column introduction
【 Microservices 】 At present, it mainly updates micro services , Learn together and progress together .
Introduction to this issue
This issue focuses on Nacos Data persistence and cluster building
List of articles
Data persistence
In stand-alone mode nacos Using embedded database to realize data storage ,0.7 Added after the version mysql Store the data .
Initialize database
stay conf Under the table of contents , Provides
nacos-mysql.sqlSQL sentence , Initialize the databaserequirement :5.6+ mysql
Be careful : If you use mysql 5.5, Need modification sql sentence

- Provided SQL Statement not created database, Manually create
nacos_config

Turn on mysql Storage
conf Under the table of contents , Provides
application.propertiesYou can modify the database configuration information

### If use MySQL as datasource:
spring.datasource.platform=mysql
### Count of DB:
db.num=1
### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos_config_2_1?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=1234
test
- Add configuration information

- Check the database storage

Nacos Cluster building
summary
3 Or 3 More than Nacos Only nodes can form a cluster
Configure data sources
Use built-in data sources
startup.cmd -p embedded
Use external data sources (MySQL, Reference resources 4.4.2)
Configure port numbers of multiple nodes on one host == Can't be continuous ==.
for example :8841/8842/8843 Unavailable
for example :8841/8843/8845 You can use
Configuration steps

node 1: To configure Nacos8841
Configure data sources
Modify port number :8841
Configure the cluster configuration file
Start the service :startup.cmd
node 2: Copy Nacos8843
Modify port number :8843
Start the service :startup.cmd
node 3: Copy Nacos8845
Modify port number :8845
Start the service :startup.cmd
Configuration details
1) Configuration node 1
Copy nacos, And rename
nacos-2.1.0-8841Configure data sources

Modify port number :8841

Configure the cluster configuration file :conf/cluster.conf

Start the service :startup.cmd

Successful startup

2) Configuration node 2
Replication node nacos-2.1.0-8841, And rename nacos-2.1.0-8843
Modify port number

Start the service

3) Configuration node 3
Replication node nacos-2.1.0-8841, And rename nacos-2.1.0-8845
Modify port number

Start the service

4) Configuration is successful

Common mistakes
1)db.num is null
Error message :
db.num is nullreason : No configuration database

2) unable to start embedded tomcat
Error message :
unable to start embedded tomcatreason 1: No cluster configuration file is written

3) Out of memory
Prompt information :
reason : Out of memory , Modify the allocated memory size

4) Cannot determine JNI library name for ARCH='x86' OS='windows 10' name='rocksdb'
Prompt information :Cannot determine JNI library name for ARCH='x86' OS='windows 10' name='rocksdb'
reason :nacos And jdk System digits (64 Bit and 32 position ,) atypism
5) JNI Related errors
Prompt information :
C:\Users\Administrator\AppData\Local\Temp\/librocksdbjni1411968517689619912.dll: Can't find dependent librariesreason :JAVA_HOME Configured jdk The installation directory , instead of jre The installation directory
边栏推荐
- Google Earth engine app (GEE) - view every image of Amazon plain from 1984 to now
- (codeforce453) A.little pony and expected maximum (mathematical expectation)
- 《学习的底层逻辑》精华
- 蓝帽杯2022初赛电子取证
- 阿左的心声
- 行业首个「视频直播技术最佳实践图」发布!
- How to clean up your email subscriber list to improve email marketing
- Edusoho enterprise training version does not connect to the cloud and starts double speed playback
- 运行时数据区&方法区(永久代/元空间)&栈帧
- 简约不简单的编程语言go
猜你喜欢

解析结合劳动教育的steam新课程

HMS Core图形图像技术展现最新功能和应用场景,加速构建数智生活

edusoho企培版 外部资讯抓取 有时无法获取图片问题/无法获取微信公众号图片

Modifying background photos and using skills of idea

ROS (25): release a static odometer Odom information
![[training Day1] maximum benefit [discretization] [greed]](/img/7d/929d581010c2fbcf94f5c38be8700e.png)
[training Day1] maximum benefit [discretization] [greed]

When the wechat applet activates the account, it will prompt "this account has been activated, please log in directly with the account password"

九联科技开发板正式合入OpenHarmony主干

浅析综合型大厦视频监控平台建设的必要性和重点功能

上海的这一新数字规划,为 NFT、元宇宙等带来了新的可能性
随机推荐
【Renesas RA6M4开发板之两路PWM驱动】
Is it safe for tonghuashun to open an account? Is tongfushun a securities company?
Steam课堂教育理念的延伸与扩展
浅析综合型大厦视频监控平台建设的必要性和重点功能
(codeforce631)C.Report(单调栈)
【MATLAB项目实战】基于GUI的数字信号处理系统
Force deduction solution summary 558- intersection of quadtrees
Application of spectral normalization in Gan with LSTM as discriminator (tensorflow2)
阿左的心声
[in depth study of 4g/5g/6g topic -36]: urllc-7 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -1- business scenarios, evolution routes and performa
iNFTnews | NFT门票将改变参与活动的方式
字符设备之poll
(手工)【sqli-labs40、41】堆叠注入、盲注
HybridCLR——划时代的Unity原生C#热更新技术
什么是真正的HTAP?(一)背景篇
sql计算前top n%的数据
ROS(功能包重命名)
在 SQL Server 中查找活动的 SQL 连接
SSH learning notes
九联科技开发板正式合入OpenHarmony主干