当前位置:网站首页>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=#;边栏推荐
- Cmu15445 (fall 2019) project 2 - hash table details
- Charles: four ways to modify the input parameters or return results of the interface
- 2022-07-07 Daily: Ian Goodfellow, the inventor of Gan, officially joined deepmind
- 关于 appium 启动 app 后闪退的问题 - (已解决)
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- 事务的七种传播行为
- 红杉中国完成新一期90亿美元基金募集
- 用mysql查询某字段是否有索引
- MySQL导入SQL文件及常用命令
- PHP calls the pure IP database to return the specific address
猜你喜欢

关于 appium 如何关闭 app (已解决)

Master公式。(用于计算递归的时间复杂度。)

图像像素读写操作

Leetcode skimming: binary tree 20 (search in binary search tree)

Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]

Day-19 IO stream

Day-14 common APIs

智云健康上市:市值150亿港元 SIG经纬与京新基金是股东

Polymorphism, final, etc

Day-15 common APIs and exception mechanisms
随机推荐
Ip2long and long2ip analysis
[疑难杂症]pip运行突然出现ModuleNotFoundError: No module named ‘pip‘
Day-20 file operation, recursive copy, serialization
[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
Blog recommendation | Apache pulsar cross regional replication scheme selection practice
[binary tree] delete points to form a forest
详解ThinkPHP支持的URL模式有四种普通模式、PATHINFO、REWRITE和兼容模式
@Resource和@Autowired的区别?
Layer pop-up layer closing problem
如何将 @Transactional 事务注解运用到炉火纯青?
[crawler] avoid script detection when using selenium
PHP calls the pure IP database to return the specific address
Day-18 hash table, generic
Cryptography series: detailed explanation of online certificate status protocol OCSP
Day26 IP query items
非分区表转换成分区表以及注意事项
明星企业普渡科技大裁员:曾募资超10亿 腾讯红杉是股东
[爬虫]使用selenium时,躲避脚本检测
ip2long之后有什么好处?
聊聊Redis缓存4种集群方案、及优缺点对比