当前位置:网站首页>MySQL master-slave replication
MySQL master-slave replication
2022-07-07 12:57:00 【LC181119】
1. Master slave replication architecture and principle
1.1MySQL Master-slave replication of
- Read / write separation
- Copy : Each node has the same data set , To expand outward , One way replication based on binary logs
1.2 The replication of
- Load balanced read operations
- Backup
- High availability and fail over
- The data distribution
- MySQL upgrade
1.3 Replication Architecture

One master multi slave replication Architecture

1.4 Master slave replication principle

- Master node :
- From the node :
1.5 Master slave replication features
- Asynchronous replication : Good client performance
- Inconsistency between master and slave data is common
2. Implement master-slave replication configuration
2.1 Master configuration :
[mysqld]
server-id=# # Recommended setting is ip The last digit of the address
log_bin[mysqld]
server-id=# # Recommended setting is ip The last digit of the address
log-basename=master # optional , Set up datadir Log name in , Make sure you don't rely on host names server-id Value range of1 to 4294967295 (>= MariaDB 10.2.2), The default value is 10 to 4294967295 (<= MariaDB 10.2.1), The default value is 0, If the slave node is 0, all master Will reject this slave The connection of
(3) View and copy from the file and location of the binary log
SHOW MASTER STATUS;GRANT REPLICATION SLAVE ON *.* TO 'repluser'@'HOST' IDENTIFIED BY 'replpass';
#MySQL8.0 In two steps
mysql> create user [email protected]'10.0.0.%' identified by '123456';
mysql> grant replication slave on *.* to [email protected]'10.0.0.%';2.2 From node configuration :
[mysqld]
server_id=# # Set a global only... For the current node ID Number
log-bin
read_only=ON # Set database read-only , in the light of supper user Invalid
relay_log=relay-log #relay log File path , The default value is hostname-relay-bin
relay_log_index=relay-log.index # The default value is hostname-relay-bin.indexCHANGE MASTER TO
MASTER_HOST='10.0.0.8',
MASTER_USER='repluser',
MASTER_PASSWORD='123456',
MASTER_PORT=3306,
MASTER_LOG_FILE='mariadb-bin.xxxxxx',
MASTER_LOG_POS=#;边栏推荐
- 人均瑞数系列,瑞数 4 代 JS 逆向分析
- .Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
- [statistical learning methods] learning notes - Chapter 5: Decision Tree
- “新红旗杯”桌面应用创意大赛2022
- 2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
- [difficult and miscellaneous]pip running suddenly appears modulenotfounderror: no module named 'pip‘
- ACL 2022 | small sample ner of sequence annotation: dual tower Bert model integrating tag semantics
- 数据库安全的重要性
- 【从 0 开始学微服务】【00】课程概述
- Day-15 common APIs and exception mechanisms
猜你喜欢
![[statistical learning method] learning notes - support vector machine (I)](/img/3f/56db88d717d7cd6624b3d0867146e9.png)
[statistical learning method] learning notes - support vector machine (I)

认养一头牛冲刺A股:拟募资18.5亿 徐晓波持股近40%

“新红旗杯”桌面应用创意大赛2022

Creation and assignment of graphic objects

Aosikang biological sprint scientific innovation board of Hillhouse Investment: annual revenue of 450million yuan, lost cooperation with kangxinuo

达晨与小米投的凌云光上市:市值153亿 为机器植入眼睛和大脑

ACL 2022 | 序列标注的小样本NER:融合标签语义的双塔BERT模型

2022a special equipment related management (boiler, pressure vessel and pressure pipeline) simulated examination question bank simulated examination platform operation
![[pytorch practice] use pytorch to realize image style migration based on neural network](/img/20/8ed7113115709b6169be289b0c280a.png)
[pytorch practice] use pytorch to realize image style migration based on neural network

Leetcode skimming: binary tree 27 (delete nodes in the binary search tree)
随机推荐
【从 0 开始学微服务】【01】什么是微服务
环境配置篇
[statistical learning methods] learning notes - Chapter 4: naive Bayesian method
博文推荐|Apache Pulsar 跨地域复制方案选型实践
Day22 deadlock, thread communication, singleton mode
Users, groups, and permissions
2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试
处理链中断后如何继续/子链出错removed from scheduling
[pytorch practice] write poetry with RNN
[binary tree] delete points to form a forest
MySQL导入SQL文件及常用命令
Shortcut key of Bash
HZOJ #235. 递归实现指数型枚举
Aike AI frontier promotion (7.7)
2022聚合工艺考试题模拟考试题库及在线模拟考试
Leetcode skimming: binary tree 23 (mode in binary search tree)
MySQL importing SQL files and common commands
Simple implementation of call, bind and apply
3D content generation based on nerf