17.1.1.1 Setting the Replication Master Configuration 设置复制的master 配置:
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 配置:的更多相关文章
- 17.1.1.2 Setting the Replication Slave Configuration
17.1.1.2 Setting the Replication Slave Configuration 在一个复制slave, 你必须创建一个唯一的server ID,如果这个没有做,slave设置 ...
- 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: 最简单和最直接方式是设置复制使用新的 ...
- 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: 最简单和最直接的方法是设置复制用于使 ...
- 17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据
17.1.1.8?Setting Up Replication with Existing Data设置复制使用存在的数据 当设置复制使用存在的数据,你需要确定如何最好的从master 得到数据到sl ...
- mysql (master/slave)复制原理及配置
1 复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重 ...
- 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. ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- sqlite 数据库打开失败
今天在做Android电子词典的时候,数据库打不开,报错为:Could not open the database in read/write mode. 后来才发现犯了一个低级错误,没有设置权限. ...
- Virtual Studio C++ Version Macro - _MSC_VER
MSVC++ (Visual Studio ) MSVC++ (Visual Studio ) MSVC++ (Visual Studio ) MSVC++ (Visual Studio ) MSVC ...
- OC - 1.面向过程和面向对象的思想对比
一.面向过程 1> 思想 面向过程是一种以过程为中心的最基础编程思想,不支持面向对象的特性. 面向过程是一种模块化程序设计方法 2> 开发方法 面向过程的开发方法是以过程(也可以说是模块) ...
- ZIP压缩文件夹中上个月的文件,并将备份文件拷贝到服务器
遍历文件夹的子文件夹下的所有文件,将上个月的文件集中到一起,然互压缩,并copy到服务器的映射磁盘. static void Main(string[] args) { //原始文件存放的位置 Dir ...
- 如何在Angular2中使用Forms
在Angular2中形成两个基本对象是Control和ControlGroup. 控制用户输入 Control 一个控制表示一个输入字段(ngFormControl) 一个控制可以绑定到一个input ...
- 桥接模式(Bridge Pattern)
桥接模式,用于将抽象化与实现化解偶,使得二者可以独立变化. 举一个数据库JDBC的例子: 定义一个Driver接口,不同的数据库实现的接口,如MySQL,SQLServer public interf ...
- greenlet代码解读
协程 上次已经讲解了协程的的实现方法,和我对协程的一些理解.这里指我就先以代码说明协程的运行.def test1(): print 12 (2) gr2.switch() ...
- processon完全装逼指南
一.引言 作为一名IT从业者,不仅要有扎实的知识储备,出色的业务能力,还需要具备一定的软实力.软实力体现在具体事务的处理能力,包括沟通,协作,团队领导,问题的解决方案等,这些能力在关键时刻比硬性的技术 ...
- android BitmapFacty.Options的用法
通常我们在开发android应用程序时,在加载图片时常常需要与Bitmap打交道,一般会使用BitmapFactory中提供的相关decode方法获取: 如果一张很大的图片,我们不加处理直接decod ...
- C程序的构成及动态内存分配
对一个程序,通常的理解就是,源码编译成机器代码,然后通过机器解释运行.不过是怎样编译成机器代码,和怎样运行的,无疑是个值得探讨的问题.怎样编译成机器代码,过程就是源码的编译.链接,编译器做了这些事.而 ...