失效链接处理 |
MySQL Master Slaves 主从复制 PDF 下载
本站整理下载:
相关截图:
主要内容:
环境
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
|