17.1.1.9 Introducing Additional Slaves to an Existing Replication Environment   引入额外的Slaves 到一个存在的复制环境:

如果添加另外的slave 到一个存在的复制配置,你可以这样做 不需要停止master.

代替的是,设置新的slave 通过 拷贝一份存在的slave,除了配置新的slave 使用不同的server-id值

复制现有的存在slave:

1.关闭存在的slave:

shell> mysqladmin shutdown

2.将数据目录从存在的slave 复制到新的slave,你可以通过创建tar或者WinZip文件,

或者通过执行一个cp或者rsync,确保也包括log files和relay log files.

一个通用的问题是遇到 当增加新的复制slaves 是新的slaves 失败 一系列的警告和错误信息如下:

071118 16:44:10 [Warning] Neither --relay-log nor --relay-log-index were used; so
replication may break when this MySQL server acts as a slave and has his hostname
changed!! Please use '--relay-log=new_slave_hostname-relay-bin' to avoid this problem.
071118 16:44:10 [ERROR] Failed to open the relay log './old_slave_hostname-relay-bin.003525'
(relay_log_pos 22940879)
071118 16:44:10 [ERROR] Could not find target log during relay log initialization
071118 16:44:10 [ERROR] Failed to initialize the master info structure 这是由于事实,如果--relay-log 选项没有被指定,relay log 文件包含了主机名作为文件名的部分 (这个对于relay log index 文件也是一样 如果 --relay-log-index 选项没有被指定 为了避免这个问题,使用 相同的值对于--relay-log 在新的slave,和用于存在的slave (如果选项没有被指定在存在的slave上,使用existing_slave_hostname-relay-bin.) 如果这个是不行的,复制存在的slave的relay log index file 到新的slave 设置 --relay-log-index 在新的slave 来匹配 在存在的slave上。(如果这个选项没有被指定在存在的slave上,使用existing_slave_hostname-relay-bin.index) 作为一种选择--如果你已经尝试启动新的slave(遵循下面存在的步骤) a.如果你没有这么做,执行stop slave 在新的slave上 如果 你已经启动存在的slave,执行一个stop slave 在存在的slave上 b. 复制存在的slave的relay log 文件的内容到新的slave的relay log index file,确保覆盖任何存在的文件的内容. c.继续在本节中其余步骤: 复制master info 和relay log info 信息库从存在的slave到新的slave. 那些保留当前的log的位置对于master的binary log和slave的relay log 4.启动存在的slave 5.在新的slave上, 编辑配置和给定新的slave 一个唯一的server-id 不被master和其他任何的slave使用 开始新的slave,slave使用信息在它的master info 信息库来开始复制

17.1.1.9 Introducing Additional Slaves to an Existing Replication Environment 引入额外的Slaves 到一个存在的复制的更多相关文章

  1. 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: 最简单和最直接方式是设置复制使用新的 ...

  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.3 Creating a User for Replication 创建一个用于用于复制:

    17.1.1.3 Creating a User for Replication 创建一个用于用于复制: 每个slave 连接到master 使用一个MySQL 用户名和密码, 因此必须有一个用户账户 ...

  4. 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. ...

  5. 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.2 Sett ...

  6. Slony-I 文摘

    http://www.onlamp.com/pub/a/onlamp/2004/11/18/slony.html  我特别喜欢这篇文章,就进行了转载和翻译. Introducing Slony by  ...

  7. 17.1.4 Replication and Binary Logging Options and Variables 复制和Binary logging 选项和变量

    17.1.4 Replication and Binary Logging Options and Variables 复制和Binary logging 选项和变量 下面的章节包含信息关于mysql ...

  8. 17.1 Replication Configuration

    17.1 Replication Configuration 17.1.1 How to Set Up Replication 17.1.2 Replication Formats 17.1.3 Re ...

  9. 17.1 Replication Configuration 复制:

    17.1 Replication Configuration 复制: 17.1.1 How to Set Up Replication 17.1.2 Replication Formats 17.1. ...

随机推荐

  1. 提交服务器 post get

    HttpRequest Post or Get // method --- WebRequestMethods.Http.Post 或 WebRequestMethods.Http.Get priva ...

  2. JavaSE学习总结第13天_API常用对象3

      13.01 StringBuffer的概述 StringBuffer类概述:线程安全的可变字符序列.一个类似于 String 的字符串缓冲区,但不能修改.虽然在任意时间点上它都包含某种特定的字符序 ...

  3. leetcode add two numbers python

    # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = ...

  4. Oracle游标

    转自:http://www.cnblogs.com/fjfzhkb/archive/2007/09/12/891031.html 游标-----内存中的一块区域,存放的是select 的结果      ...

  5. HDU2955-Robberies

    描述: The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usual ...

  6. python读取word表格内容(1)

    1.首页介绍下word表格内容,实例如下: 每两个表格后面是一个合并的单元格

  7. linux 定时执行任务

    测试可以了,做个笔记 系统是centos 6.3 1,直接命令 crontab -e 编辑文件,里面写时间和你想要执行的命令. 例子 */1 * * * * sh /home/guanliyang/t ...

  8. android小知识之注释模板(转载)

    设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元 ...

  9. chrome extensions

        chrome web store   AppsGamesExtensionsThemes   CATEGORIES   All FEATURESClear   Runs Offline By ...

  10. 《windows程序设计》学习_2.1:初识消息

    #include <windows.h> //#define WM_MYMSG (WM_USER +100) LRESULT CALLBACK WndProc(HWND,UINT,WPAR ...