mysql master master replication not working

Discussion in 'HOWTO-Related Questions' started by SoftDux, Mar 6, 2007.

  1. SoftDux

    SoftDux New Member

    Hi

    Can someone please help me?

    I have followed the mysql master-master replication howto, but it doesn't seem to work.

    if I run the command "slave start;" I get the following error:

    Code:
    ERROR 1200 (HY000): The server is not configured as slave; fix in config file or
     with CHANGE MASTER TO
    Empty set (0.00 sec)
    
    Can someone please tell me where / how to set the slave?
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What's in the my.cnf file of the slave?
     
  3. 1soproni

    1soproni New Member

    My problem is the same as SoftDux's.
    mysql-5.0.37
    Step10:
    Master1/Slave2:

    [client]
    port = 3307
    socket = /tmp/mysql.sock

    [mysqld]
    port = 3307
    socket = /tmp/mysql.sock
    skip-locking
    key_buffer = 16M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M
    log-bin=mysql-bin

    binlog_do_db=valami
    binlog_ignore_db=mysql
    binlog_ignore_db=test
    server-id = 1
    master-host = 1.2.3.4
    master-user = replication
    master-password = slave2
    master-port = 3307

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash
    [isamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M

    [myisamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M

    [mysqlhotcopy]
    interactive-timeout
    ------------------------------------------
    Slave1/Master2:

    [client]
    port = 3307
    socket = /tmp/mysql.sock

    [mysqld]
    port = 3307
    socket = /tmp/mysql.sock
    skip-locking
    key_buffer = 16M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M

    log-bin=mysql-bin

    binlog_do_db=valami
    binlog_ignore_db=mysql
    binlog_ignore_db=test

    server-id = 2
    master-host = 5.6.7.8
    master-user = replication
    master-password = slave
    master-port = 3307

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash

    [isamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M

    [myisamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M

    [mysqlhotcopy]
    interactive-timeout


    Master1/Slave2 log:
    070327 17:11:21 [Warning] Neither --relay-log nor --relay-log-index were used; s
    o replication may break when this MySQL server acts as a slave and has his hostn
    ame changed!! Please use '--relay-log=www3-relay-bin' to avoid this problem.
    070327 17:11:21 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
    Version: '5.0.37-log' socket: '/tmp/mysql.sock' port: 3307 MySQL Community Se
    rver (GPL)
    070327 17:11:21 [Note] Slave SQL thread initialized, starting replication in log
    'FIRST' at position 0, relay log './www3-relay-bin.000011' position: 98
    070327 17:11:21 [Note] Slave I/O thread: connected to master 'test@:3307', repl
    ication started in log 'FIRST' at position 4
    070327 17:11:21 [ERROR] The slave I/O thread stops because master and slave have
    equal MySQL server ids; these ids must be different for replication to work (or
    the --replicate-same-server-id option must be used on slave but this does not a
    lways make sense; please check the manual before using it).
    070327 17:11:21 [Note] Slave I/O thread exiting, read up to log 'FIRST', positio
    n 4
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Please try to add
    Code:
    relay-log = www3-relay-bin
    to the my.cnf files and try again.
     
  5. 1soproni

    1soproni New Member

    070328 18:19:39 [Note] Slave SQL thread initialized, starting replication in log
    'FIRST' at position 0, relay log './www3-relay-bin.000013' position: 98
    070328 18:19:39 [Note] Slave I/O thread: connected to master 'test@:3307', repl
    ication started in log 'FIRST' at position 4
    070328 18:19:39 [ERROR] The slave I/O thread stops because master and slave have
    equal MySQL server ids; these ids must be different for replication to work (or
    the --replicate-same-server-id option must be used on slave but this does not a
    lways make sense; please check the manual before using it).
    070328 18:19:39 [Note] Slave I/O thread exiting, read up to log 'FIRST', positio
    n 4

    "Show variables;" shows differents server-ids.
     
  6. falko

    falko Super Moderator Howtoforge Staff

Share This Page