MySQL Replication after restart

Discussion in 'Server Operation' started by Jayock, Dec 17, 2007.

  1. Jayock

    Jayock New Member

    Is there a way to keep replication settings current after restarting the master server, without having to change master on the slave. I notice that everytime the master restarts, you must change master bin log to the new name (eg. mysql-bin.000006 will becoem mysql-bin.000007). Is there a way to automate this without having to reconfigure the bin log settings on the slave?
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Run
    Code:
    STOP SLAVE;
    on the MySQL shell on the slave before you take down the master.
    What's in the my.cnf on the master?
     
  3. Jayock

    Jayock New Member

    Code:
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1
    log-bin = /var/log/mysql/mysql-bin.log
    binlog-do-db=CRISData
    binlog-do-db=cellular_bruce
    
    server-id=1
    
    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    
    Will running stop slave make slave increment the bin log suffix?
     
  4. falko

    falko Super Moderator ISPConfig Developer

    I'd also add
    Code:
    expire_logs_days        = 10
    max_binlog_size         = 500M
    to the [mysqld] section so that the slave can catch ip again if any of the servers is down for a longer time.
     

Share This Page