当前位置:网站首页>MariaDB's Galera cluster application scenario -- multi master and multi active databases
MariaDB's Galera cluster application scenario -- multi master and multi active databases
2022-07-04 23:13:00 【Zuo Mingshui】
Implementation environment
Centos 7.2V 1511
MySQL 5.5.52V
Application scenario description
Previously, there was no dual active cluster ;
A database node has historical data ;
Now we need to do double master and double work Galera colony .
Scenario simulation exercise
- Create a database node with historical data
From the other MySQL In the database , Back up all the data , Then import the data to the local database node .
Install the same version yum -y install mariadb-server.x86_64

Open database service : systemctl start mysql
Initialize database
mysql_secure_installation
Import the backup data into the newly installed database :

Data has also been stored in the database :

This will be a database node with historical data that has not been a database cluster and has been running for some time .
- Install on the database node with historical data that has been running for a period of time Galera Cluster software
yum --enablerepo=mariadb -y install MariaDB-Galera-server

The same is 5.5.52 Of MariaDB-Galera-server The software will work with 5.5.52 Of MariaDB-server Cause conflict !!
Smooth transition of the same version is not allowed !!!
Use method :
Uninstall the originally installed database software , Then install the cluster software
yum –y remove mariadb-server ( Database server )
yum –y remove mariadb ( Database client )
Unloading the database directly will not cause loss of data in the database . The data is in /var/lib/mysql It's in the directory .

yum --enablerepo=mariadb -y install MariaDB-Galera-server
After entering the database , Query data still exists
here , The database node only has cluster software installed , The cluster has not been configured .
- On the second database node , Install the cluster software
yum --enablerepo=mariadb -y install MariaDB-Galera-server

here , There is no relevant synchronization data in the node database :

- Start configuration Galera Configuration files for the cluster
vim /etc/my.cnf.d/server.cnf

Initialize the newly added database node
mysql_secure_installation
- Start cluster
Firewalls and SLinux It is required to close

View the cluster status :

- View the data synchronization of the new database node



- risk assessment
If the database cluster software can't make a smooth transition as above , You need to uninstall the conflicting database software , During this period, business needs to be stopped .
2. Risk aversion
When setting up a cluster, you must make a full backup of the database !
3. Deployment optimization scheme
It is recommended that at least 3 Database nodes . reason , In general ,3 Two databases are used for primary and standby , When a database goes down , At least two databases in the cluster are active and standby .
- Evaded 2 In the process of primary primary standby of machine database , continuity 2 The risk of database downtime
- Evaded 2 In the process of primary primary standby of machine database ,1 There is a risk that the machine will fail to recover in time due to irresistible factors .
- For the downtime of some nodes in the database cluster , Carry out recovery work , Win valuable time .
- The failure risk rate of primary and standby databases , From the beginning 2 Two machines are prepared for each other 50% above , Down to 3 The host and the host are prepared for each other 30% following .
边栏推荐
- Redis入门完整教程:Pipeline
- Async await used in map
- Question brushing guide public
- Pagoda 7.9.2 pagoda control panel bypasses mobile phone binding authentication bypasses official authentication
- 字体设计符号组合多功能微信小程序源码
- Common methods in string class
- SPH中的粒子初始排列问题(两张图解决)
- Photoshop batch adds different numbers to different pictures
- JS card style countdown days
- vim编辑器知识总结
猜你喜欢

【图论】拓扑排序

EditPlus--用法--快捷键/配置/背景色/字体大小

Redis入門完整教程:Pipeline

Redis getting started complete tutorial: Key Management

On-off and on-off of quality system construction

Redis入门完整教程:有序集合详解
![[OpenGL] note 29 anti aliasing (MSAA)](/img/66/61f29e1c41d3099d55e2ead0a3b01e.png)
[OpenGL] note 29 anti aliasing (MSAA)

Redis入门完整教程:HyperLogLog

Redis入门完整教程:键管理

Redis introduction complete tutorial: client communication protocol
随机推荐
该如何去选择证券公司,手机上开户安不安全
Header file duplicate definition problem solving "c1014 error“
Sword finger offer 67 Convert a string to an integer
ETCD数据库源码分析——处理Entry记录简要流程
Async await used in map
时间 (计算)总工具类 例子: 今年开始时间和今年结束时间等
Redis introduction complete tutorial: detailed explanation of ordered collection
How can enterprises cross the digital divide? In cloud native 2.0
SPH中的粒子初始排列问题(两张图解决)
ScriptableObject
A complete tutorial for getting started with redis: redis usage scenarios
Editplus-- usage -- shortcut key / configuration / background color / font size
PICT 生成正交测试用例教程
【ODX Studio编辑PDX】-0.3-如何删除/修改Variant变体中继承的(Inherited)元素
Redis入门完整教程:Bitmaps
C语言快速解决反转链表
phpcms付费阅读功能支付宝支付
vim编辑器知识总结
Redis introduction complete tutorial: List explanation
【爬虫】数据提取之xpath