replication question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wireman

    #1

    replication question

    Hi,

    I have a simple master/slave replication environment that is working
    smoothly with one exception. If I restart the master server the Master
    Log File is incremented by one (e.g. the original master log is named
    data-bin.000001 and the new master log is named data-bin.000002) the
    slave server never notices that the Master Log File and the Master Log
    Position have changed. Instead, the slave sits there waiting for new
    entries in the old Master Log File. I can tell this by executing a
    SHOW SLAVE STATUS on the slave server.

    I am not sure about this because I can't find any documentation on the
    proper behavior of mysql during this scenario, however, I am under the
    impression that slave server should be able to figure this out and
    continue replicating, without requiring me to execute an "CHANGE
    MASTER..." command on the slave server every time the master is
    restarted. Of course, I assume this same problem will occur when the
    Master Log File grows to its maximum size and a new Master Log File is
    created.

    If anybody who has experience with mysql replication could just confirm
    that the behavior I am seeing is not correct, that would be great. Or
    if anybody has any suggestions as to what, if anything, is wrong with
    my setup.

    Both MySQL instances are running MySQL 4.1.10 on Linux. The servers
    are in remote locations, separated by two firewalls. I have opened up
    the standard MySQL ports in the firewall so that the servers can
    communicate (which, as I mention, they do successfully, almost!).

    The relevant lines from my master my.cnf file are:

    log-bin
    server-id = 1

    The relevant lines from my slave my.cnf file are:

    log-bin
    server-id = 2
    log-slave-updates
    log-warnings
    replicate-ignore-db=mysql

    # master server information
    master-host = master.ip.addre ss
    master-port = 3306
    master-user = xxxxx
    master-password = xxxxx
    master-connect-retry = 10
    report-host = slave.ip.addres s
    report-port = 3306

    Any help would be greatly appreciated.

    Thanks,
    Steve

  • wireman

    #2
    Re: replication question

    Of course, I just found the issue (not 2 minutes after I made this
    post).

    As it turns out the slave actually *was* noticing that the master
    server had restarted, it just took the slave an hour or 3600 seconds to
    notice! I added the slave_net_timeo ut setting to my slave my.cnf file
    and gave it a lower value (than the default 3600) which will make the
    slave server notice a master server restart sooner.

    --Steve

    Comment

    Working...