MySQL—Replication

Reference

Setting Up Binary Log File Position Based Replication

配置步骤

NOTE Certain steps within the setup process require the SUPER privilege. If you do not have this privilege, it might not be possible to enable replication.

There are some generic tasks that are common to all setups:

On the master, you must enable binary logging and configure a unique server ID. This might require a server restart. See Section 16.1.2.1, “Setting the Replication Master Configuration”.

为了使用 replication,必须开启 log-bin & server-id,配置完成需要重启MySQL

配置 master

[mysqld]
log-bin=mysql-bin
server-id=1

NOTE

  • 如果没有 server-id,master 将拒绝slave连接

  • 为了最大的满足 持久性 和 一致性 ,应该在master里配置 innodb_flush_log_at_trx_commit=1sync_binlog=1

  • 确保 skip-networking 未启用。 如果网络被禁用,复制将会失败

    • replication 应该是采用 TCP/IP 的方式进行传输

    • 具体可以看看MySQL连接方式:TCP/IP, SOCKET

    • 连接不指定ip或使用localhost,应该走 socket

    • 其他走 TCP/IP

On each slave that you want to connect to the master, you must configure a unique server ID. This might require a server restart. See S

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值