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. 安卓获取Assets目录下的资源

    获取Assets目录下的资源 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 ! ...

  2. MVC3中使用AuthorizeAttribute特性来完成登陆权限的验证

    以前判断用户是否登录,判断用户Session是否为空,一般会在这个页面写使用: if (HttpContext.Session.IsNewSession) { //todo Login } 每个需要验 ...

  3. sql的临时表使用小结

    1.创建方法: 方法一:create table TempTableName或select [字段1,字段2,...,] into TempTableName from table 方法二:creat ...

  4. IOS_OC_百度地图与社交分享

    前奏. 知识点介绍 一. 导航和画线 地图画线 (理解) 二. 百度地图 集成百度地图 (掌握) POI检索 (掌握) 三. 社交分享 系统自带分享 (了解) 友盟分享 (掌握) SSO授权 (理解) ...

  5. UIKit各类概述

    1.UIAcceleration: 被叫做加速事件的一个UIAcceleration类的实例是用来代表即时的三维加速数据.为了接收重力加速度,要注册一个应用应用程序作为一个共享UIAccelerate ...

  6. iOS开发——文本高度

    1.简单的计算文本高度 // 要计算的文本内容 NSString *testString = @"刘成利,软件工程专业毕业,iOS开发者,目前工作于北京,在证券金融领域从事iOS App开发 ...

  7. requirejs实践一 加载JavaScript文件

    首先,目录如下(根目录有一个index.html文件.有一个scripts文件夹): scripts文件夹有如下的文件 以下是index.html代码 <!DOCTYPE html> &l ...

  8. Mysql笔记【1】-数据库的基本操作(创建/删除)

    1.创建数据库 创建数据库(如果存在,则报错) #创建名称为test的数据库 create database test 查询创建完的数据库 show databases 2.删除数据库 删除数据库(如 ...

  9. ubuntu 13.10自定义启动顺序

    添加PPA sudo add-apt-repository ppa:danielrichter2007/grub-customizer sudo apt-get update sudo apt-get ...

  10. 如何通过CSS让DIV居中对齐

    给Div对应的CSS的添加如下设定即可: MARGIN-RIGHT: auto; MARGIN-LEFT: auto;