FAQ
Hi,

Have you heard this:

master to master replication replicated its own queries (replicated to another server and replicated back)? Although both two servers has own server id. For example, master A reads binlog on master B, and executed, got duplicate key error. master B reads binlog from master A, and got duplicate key error. (these two queries are different). The condition is, On master B, there are no application setup to access database, it only replicates from master A. No updates on server B.

MySQL used v5.037.

Thanks,
Lisa

Search Discussions

  • ANIL YADAV at Jun 3, 2010 at 12:29 pm
    HI

    If there is no update on Master B Then U can use Master-->> Slave
    replication ,why are you using Master--->> Master replication.?


    On Thu, Jun 3, 2010 at 8:21 AM, Database System wrote:

    Hi,

    Have you heard this:

    master to master replication replicated its own queries (replicated to
    another server and replicated back)? Although both two servers has own
    server id. For example, master A reads binlog on master B, and executed, got
    duplicate key error. master B reads binlog from master A, and got duplicate
    key error. (these two queries are different). The condition is, On master B,
    there are no application setup to access database, it only replicates from
    master A. No updates on server B.

    MySQL used v5.037.

    Thanks,
    Lisa




    --
    MySQL Replication Mailing List
    For list archives: http://lists.mysql.com/replication
    To unsubscribe:
    http://lists.mysql.com/replication?unsub=uranil@gmail.com

    --
    Thanks & Regards
    -----------------------------
    ANIL YADAV
    +91-9871047883
    LinkedIn:-http://www.linkedin.com/in/anilyadav
    ---------------------------------------------------------
    "We judge ourselves by what we feel capable of doing, while others judge us
    by what we have already done."
    ----------------------------------------------------------
  • Johan De Meersman at Jun 3, 2010 at 12:30 pm
    Can you verify

    a) that the server IDs are also different in the mysql global variables
    (show global variables like 'server_id') ?
    b) that the servers do have an identical dataset to start with ?


    Anil,

    That's not an uncommon thing, it allows for easy failovers by simply moving
    a virtual IP around, or you might have separate applications writing to the
    second master and not the first.



    --
    Bier met grenadyn
    Is als mosterd by den wyn
    Sy die't drinkt, is eene kwezel
    Hy die't drinkt, is ras een ezel
  • Marcus Bointon at Jun 3, 2010 at 12:39 pm

    On 3 Jun 2010, at 14:21, Database System wrote:

    master to master replication replicated its own queries (replicated to another server and replicated back)? Although both two servers has own server id. For example, master A reads binlog on master B, and executed, got duplicate key error. master B reads binlog from master A, and got duplicate key error. (these two queries are different). The condition is, On master B, there are no application setup to access database, it only replicates from master A. No updates on server B.
    Make sure you have this set in your my.cnf:

    replicate-same-server-id=0

    This stops replication loops.

    It's also a good idea to set read-only on your slave. mmm does this for you.

    You're running quite an old version of MySQL there.

    Anil said:
    If there is no update on Master B Then U can use Master-->> Slave
    replication ,why are you using Master--->> Master replication.?
    Because writing to both masters in a master-master config is generally a bad idea. Like Johan said, master-master replication is for redundancy and failover, not scalability.

    Marcus
    --
    Marcus Bointon
    Synchromedia Limited: Creators of http://www.smartmessages.net/
    UK resellers of info@hand CRM solutions
    marcus@synchromedia.co.uk | http://www.synchromedia.co.uk/
  • Database System at Jun 4, 2010 at 3:43 am
    Marcus,

    My two servers' ids are different. Since there is such setting, replicate-same-server-id=0 is that means server probably could execute its own updates by mistake?

    Thanks, Marcus.

    To answer another question: although there is no update on one server, it is master - slave replication. I just to prepare for future, when we shutdown master and run on slave, after master is up, I don't need to sync database.

    Lisa

    --- On Thu, 6/3/10, Marcus Bointon wrote:
    From: Marcus Bointon <marcus@synchromedia.co.uk>
    Subject: Re: Bug on master to master rep?
    To: "Replication" <replication@lists.mysql.com>
    Date: Thursday, June 3, 2010, 7:38 AM
    On 3 Jun 2010, at 14:21, Database
    System wrote:
    master to master replication replicated its own
    queries (replicated to another server and replicated back)?
    Although both two servers has own server id. For example,
    master A reads binlog on master B, and executed, got
    duplicate key error. master B reads binlog from master A,
    and got duplicate key error. (these two queries are
    different). The condition is, On master B, there are no
    application setup to access database, it only replicates
    from master A. No updates on server B.

    Make sure you have this set in your my.cnf:

    replicate-same-server-id=0

    This stops replication loops.

    It's also a good idea to set read-only on your slave. mmm
    does this for you.

    You're running quite an old version of MySQL there.

    Anil said:
    If there is no update on  Master B Then U can use
    Master-->> Slave
    replication ,why are you using Master--->>
    Master replication.?

    Because writing to both masters in a master-master config
    is generally a bad idea. Like Johan said, master-master
    replication is for redundancy and failover, not
    scalability.

    Marcus
    --
    Marcus Bointon
    Synchromedia Limited: Creators of http://www.smartmessages.net/
    UK resellers of info@hand CRM solutions
    marcus@synchromedia.co.uk
  • Marcus Bointon at Jun 4, 2010 at 6:44 am

    On 4 Jun 2010, at 05:42, Database System wrote:

    My two servers' ids are different. Since there is such setting, replicate-same-server-id=0 is that means server probably could execute its own updates by mistake?
    That's not what it does. That setting says whether it should replicate statements that match its own id. If server A runs a query, replicates to B and runs there. If the query then somehow gets back to A, it won't run because the server ID matches, thus preventing a replication loop.

    http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-same-server-id

    There is some confusion about master-master terminology. Master-master is merely two sets of master-slave replication, and each direction is identical to a master-slave config, there's nothing magic or different about it.

    Marcus
    --
    Marcus Bointon
    Synchromedia Limited: Creators of http://www.smartmessages.net/
    UK resellers of info@hand CRM solutions
    marcus@synchromedia.co.uk | http://www.synchromedia.co.uk/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupreplication @
categoriesmysql
postedJun 3, '10 at 12:21p
activeJun 4, '10 at 6:44a
posts6
users4
websitemysql.com
irc#mysql

People

Translate

site design / logo © 2022 Grokbase