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 ...
随机推荐
- java strtus2 DynamicMethodInvocation配置入门 " ! "访问action里面的方法
这里来讲解一下strtus2动态配置的用法. 配置之后不用通过 <action method="">去配置调用的具体方法. 第一:web.xml <?xml ve ...
- C# 调用Java Webservice 加入SoapHeader 验证信息
C#调用java 编写的webservice时不会自动生成 soapheader 类接口的,需要改动Reference.cs. 在生成的代理类referende.cs中进行如下操作: 一.在声明pub ...
- C# Callback 回调实用讲解 [原创]
这个是2011年写的一个技术贴,现在看可能有点过时了,有兴趣的朋友也可以看一下. 一. 描述 在开发winform程序时不会考虑页面刷新问题,只要控制好线程别导致假死就ok了,但是在开发web页面程序 ...
- Container.ItemIndex 获取到行的序号
如果在ASP.NET中应用了Repeater.Gridview,想获取到行的序号,很简单,使用Container.ItemIndex即可.在Gridview中使用<%# Container.Da ...
- Log4Net 在多层项目中的使用小记
原文地址:http://www.cnblogs.com/zdh8675/p/3645556.html 这几天刚好在调整一个项目,把一些自己不是很清楚的东西先试验一下,这篇文章主要是对我在项目中需要使用 ...
- FastFrameWork 快速开发框架
前言 FastFrameWork 快速开发框架是一款基于敏捷并行开发思想和Microsoft .Net构件(插件)开发技术而构建的一个快速开发应用平台.用于帮助中小型软件企业建立一条适合市场快速变化的 ...
- SQL Server系统表sysobjects介绍与使用(转)
SQL Server系统表sysobjects介绍与使用 关于SQL Server数据库的一切信息都保存在它的系统表格里.我怀疑你是否花过比较多的时间来检查系统表格,因为你总是忙于用户表格.但是,你可 ...
- React-Native牛刀小试仿京东砍啊砍砍到你手软
React-Native牛刀小试仿京东砍啊砍砍到你手软 React-Native基础教程 *React-Native基础篇作者git *React-Native官方文档 *Demo 几个月前faceb ...
- iOS的Mantle实战分析
公司项目之前的model层代码是我使用JSON工具直接生成Objective-C代码的,当时还是觉得相当省事的,毕竟我经历过无model层的NSDictionary“黑暗”时期.但是随着项目的推进,问 ...
- mybatis()
---------------------------------mysql分页---------------------------------- public void selectList(in ...