MySQL 5.1 リファレンスマニュアル :: 5 レプリケーション :: 5.2 Replication Topologies :: 5.2.4 Replication with Circular Masters
« 5.2.3.1 Auto-Increment in Multiple-Master Replication

5.2.5 Replication Chains »
Section Navigation      [Toggle]
  • 5.2 Replication Topologies
  • 5.2.1 Replication with a Single Slave
  • 5.2.2 Replication with Multiple Slaves
  • 5.2.3 Replication with Two Masters
  • 5.2.4 Replication with Circular Masters
  • 5.2.5 Replication Chains
  • 5.2.6 Replicating Multiple Masters to One Slave

5.2.4. Replication with Circular Masters

Multiple masters

It is safe to connect servers in a circular master/slave relationship if you use the --log-slave-updates option. That means that you can create a setup as shown in 図 5.5. 「Replication with multiple masters in a chain topology」.

図 5.4. Replication with multiple masters in a circular topology

Replication with multiple masters in a
          circular topology

However, many statements do not work correctly in this kind of setup unless your client code is written to take care of the potential problems that can occur from updates that occur in different sequence on different servers.

Server IDs are encoded in binary log events, so server A knows when an event that it reads was originally created by itself and does not execute the event (unless server A was started with the --replicate-same-server-id option, which is meaningful only in rare cases). Thus, there are no infinite loops. This type of circular setup works only if you perform no conflicting updates between the tables. In other words, if you insert data in both A and C, you should never insert a row in A that may have a key that conflicts with a row inserted in C. You should also not update the same rows on two servers if the order in which the updates are applied is significant.

Copyright © 1997, 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices
Top / Previous / Next / Up / Table of Contents
© 2010, Oracle Corporation and/or its affiliates