17.1.1.1 Setting the Replication Master Configuration  设置复制的master 配置:

在一个复制master,你必须启用binary logging和创建一个唯一的server ID.

如果这个没有提前做,server 重启是需要的。

Binary logging 是需要启用的在master上,因为binary log 是复制的基础 从master上的改变到slaves.

如果binary log 是没有启用使用 log-bin option,  复制是不可能的

每个server 在复制组必须配置一个唯一的server ID.

这个ID 是用于确定唯一的servers 在组内,配置一个整数

配置 binary log and server ID 选项,关闭MySQL server 编辑my.cnf或者 my.ini file.

在[mysqld]章节,增加log-bin and server-id options.

如果那些选项已经存在,但是注释掉了,取消注释选项根据你的需要改变它们。

比如, 让binary logging 使用一个log file mysql-bin的名字前缀,配置一个server ID 为1

zabbix:/root# cat /etc/my.cnf | grep log-bin
log-bin=/data01/mysqllog/binlog/mysql-bin
zabbix:/root# ls -ltr /data01/mysqllog/binlog/mysql-bin
ls: cannot access /data01/mysqllog/binlog/mysql-bin: No such file or directory
zabbix:/root# ls -ltr /data01/mysqllog/binlog/mysql-bin*
-rw-rw----. 1 mysql mysql 3351694 Oct 27 09:53 /data01/mysqllog/binlog/mysql-bin.000001
-rw-rw---- 1 mysql mysql 436 Oct 27 09:57 /data01/mysqllog/binlog/mysql-bin.000002
-rw-rw---- 1 mysql mysql 143 Oct 27 10:00 /data01/mysqllog/binlog/mysql-bin.000003
-rw-rw---- 1 mysql mysql 143 Oct 27 10:02 /data01/mysqllog/binlog/mysql-bin.000004
-rw-rw---- 1 mysql mysql 514616 Oct 27 11:30 /data01/mysqllog/binlog/mysql-bin.000005
-rw-rw---- 1 mysql mysql 26752 Oct 27 11:36 /data01/mysqllog/binlog/mysql-bin.000006
-rw-rw---- 1 mysql mysql 42293 Oct 27 11:44 /data01/mysqllog/binlog/mysql-bin.000007
-rw-rw---- 1 mysql mysql 1401536 Oct 27 13:42 /data01/mysqllog/binlog/mysql-bin.000008
-rw-rw---- 1 mysql mysql 536871235 Nov 2 05:30 /data01/mysqllog/binlog/mysql-bin.000009
-rw-rw---- 1 mysql mysql 536871228 Nov 4 05:52 /data01/mysqllog/binlog/mysql-bin.000010
-rw-rw---- 1 mysql mysql 536871010 Nov 6 05:40 /data01/mysqllog/binlog/mysql-bin.000011
-rw-rw---- 1 mysql mysql 536871041 Nov 8 05:54 /data01/mysqllog/binlog/mysql-bin.000012
-rw-rw---- 1 mysql mysql 536871189 Nov 10 06:19 /data01/mysqllog/binlog/mysql-bin.000013
-rw-rw---- 1 mysql mysql 536871366 Nov 12 01:37 /data01/mysqllog/binlog/mysql-bin.000014
-rw-rw---- 1 mysql mysql 536871289 Nov 13 12:26 /data01/mysqllog/binlog/mysql-bin.000015
-rw-rw---- 1 mysql mysql 656 Nov 13 12:26 /data01/mysqllog/binlog/mysql-bin.index
-rw-rw---- 1 mysql mysql 347374418 Nov 14 11:13 /data01/mysqllog/binlog/mysql-bin.000016 [mysqld]
log-bin=mysql-bin
server-id=1 在做了这些修改后,重启服务器: 注意: 如果你省略server-id(或者设置为默认值0),master 拒绝任何slaves的链接 注意: 为了最大的可用的耐久性和一致性 在一个复制设置使用InnoDB,你需要使用innodb_flush_log_at_trx_commit=1 and sync_binlog=1 在master的my.cnf文件 注意: 请确保skip-networking 选项是不被启用的在你的复制master上,
mysql> show variables like '%skip_networking%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| skip_networking | OFF |
+-----------------+-------+
1 row in set (0.00 sec)

17.1.1.1 Setting the Replication Master Configuration 设置复制的master 配置:的更多相关文章

  1. 17.1.1.2 Setting the Replication Slave Configuration

    17.1.1.2 Setting the Replication Slave Configuration 在一个复制slave, 你必须创建一个唯一的server ID,如果这个没有做,slave设置 ...

  2. 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves:

    17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves: 最简单和最直接方式是设置复制使用新的 ...

  3. 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制对于新的Master和Slaves:

    17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制对于新的Master和Slaves: 最简单和最直接的方法是设置复制用于使 ...

  4. 17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据

    17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据 当设置复制使用存在的数据,你需要确定如何最好的从master 得到数据到sl ...

  5. mysql (master/slave)复制原理及配置

    1 复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重 ...

  6. 17.1.1 How to Set Up Replication 设置复制:

    17.1.1 How to Set Up Replication 设置复制: 17.1.1.1 Setting the Replication Master Configuration 17.1.1. ...

  7. 17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 得到复制master binary log 位置:

    17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 得到复制master binary log 位置: 你需要master ...

  8. 17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 获取复制Master Binary Log的坐标:

    17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 获取复制Master Binary Log的坐标: 你需要master ...

  9. mysql同步复制报Slave can not handle replication events with the checksum that master 错误

    slave服务器,查看状态时,发现下面的错误: Last_IO_Error: Got fatal error 1236 from master when reading data from binar ...

随机推荐

  1. iOS Crash文件的解析

    iOS Crash文件的解析 开发程序的过程中不管我们已经如何小心,总是会在不经意间遇到程序闪退.脑补一下当你在一群人面前自信的拿着你的App做功能预演的时候,流畅的操作被无情地Crash打断.联想起 ...

  2. hpple 简单使用

    最近项目使用到hpple,简单说一下使用方式,做做笔记 let responseData = response as! NSData let utf8Html = responseData.strin ...

  3. 如何在windows server 2008的桌面上显示 我的电脑

    装完windows server2008 r2 x64后发现桌面只有一个回收站图标,这一点和xp 20003都差不多,但是xp 2003很容易就把桌面上的 我的电脑 我的文档 网上邻居找到,但是win ...

  4. java web-----DAO设计模式(数据库访问)

    一,DAO设计模式用于 j2ee 的数据层访问,包括五部分, 数据库连接类(包含数据库的连接与关闭操作的一个类), VO类(私有变量与数据库表格对应,接收数据库中表格各字段内容), DAO接口类(包含 ...

  5. Microsoft Windows Installer 工具 Msiexec.exe 的命令行选项

    摘自:http://support.microsoft.com/kb/314881/zh-cn 概要 本文列出了 Windows Installer 工具 Msiexec.exe 的命令行选项.Msi ...

  6. IniParse解析类

    说明 iniParse这个类是一个解析ini文件的类,他的功能和Windows下GetPrivateProfileString的功能一样,可以很方便的保存读取配置. 当然他不是只有GetPrivate ...

  7. UDP协议疑难杂症全景解析

    转载:http://blog.csdn.net/dog250/article/details/6896949 UDP协议疑难杂症全景解析 2011-10-22 19:26 2989人阅读 评论(4)  ...

  8. linux 信号处理

    查看信号 kill -l 信号实际就是一个进程发送给另一个进程的消息

  9. FBX SDK 从2012.1 到 2013.3 变化

    ==================================================== ============================== 译文               ...

  10. Spring Cloud Eureka Server例子程序

    Spring-Cloud-Eureka-Server 及Client 例子程序 参考源代码:https://github.com/spring-cloud-samples/eureka 可以启动成功, ...