Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

        
AI编程,程序员挑战年入30~100万高级指南 - 职业规划
SpringBoot+SpringSecurity+Vue权限系统高级实战课程        

IDEA永久激活

Java微信小程序电商实战课程(SpringBoot+VUe)

     

AI人工智能学习大礼包

     

PyCharm永久激活

66套java实战课程无套路领取

     

Cursor+Claude AI编程 1天快速上手视频教程

     

MySQL Master Slaves 主从复制 PDF 下载


时间:2021-07-13 09:25来源:http://www.java1234.com 作者:转载  侵权举报
MySQL Master Slaves 主从复制 PDF 下载
失效链接处理

MySQL Master Slaves 主从复制 PDF 下载


本站整理下载:
提取码:x11g 
 
 
相关截图:
 
主要内容:

 环境
MySQL5.7
Centos7
主库主机地址:192.168.100.218
从库主机地址:192.168.100.219
3 主库配置
1 在主数据库上创建同步账号。
2 配置主节点,开启binlog
配置如下:开启binlog,设置节点id
重启mysql 服务
grant replication slave on *.* to 'repl'@'192.168.100.219' identified by
'Mike666!';
vi /etc/my.cfg
[mysqld]
log-bin=mysql-bin  # 日志文件名前缀
server-id=1   # 在集群中的唯一id,值可以为1~2^32-1的整数
查看主库状态
注意:
The following options have an impact on this procedure:
if you omit server-id (or set it explicitly to its default value of 0), the master refuses
any connections from slaves.
For the greatest possible durability and consistency in a replication setup using
InnoDB with transactions, you should use innodb_flush_log_at_trx_commit=1 and
sync_binlog=1 in the master my.cnf file.
Ensure that the skip-networking option is not enabled on your replication master. If
networking has been disabled, the slave cannot communicate with the master and
replication fails.
4 从库配置
从库可以多个,可以是主-从结构,也可是主-从-从结构,这里选择主-从结构。每个从库的配置
是一样的。
1 配置从库server-id

 

------分隔线----------------------------


锋哥推荐