// Master - 5.6.26, Slave's - 5.5.45 // Conf used [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.26: more master.cnf #Master [mysqld] user = root pid-file = /export/umesh/server/binaries/mysql-5.6.26/run/master.pid socket = /export/umesh/server/binaries/mysql-5.6.26/run/master.sock log-error=/export/umesh/server/binaries/mysql-5.6.26/log/master.log slow_query_log_file=/export/umesh/server/binaries/mysql-5.6.26/log/slow.log general_log_file=/export/umesh/server/binaries/mysql-5.6.26/log/general.log port = 15000 server-id = 1 basedir = /export/umesh/server/binaries/mysql-5.6.26 datadir = /export/umesh/server/binaries/mysql-5.6.26/master tmpdir = /tmp log-bin = /export/umesh/server/binaries/mysql-5.6.26/log/master-bin log-bin-index = /export/umesh/server/binaries/mysql-5.6.26/log/master-bin.index binlog_format=STATEMENT binlog_checksum=NONE [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: more slave_A.cnf slave_B.cnf :::::::::::::: slave_A.cnf :::::::::::::: #Slave [mysqld] pid-file = /export/umesh/server/binaries/mysql-5.5.45/run/slave_A.pid socket = /export/umesh/server/binaries/mysql-5.5.45/run/slave_A.sock log-error=/export/umesh/server/binaries/mysql-5.5.45/log/slave_A.log port = 15001 server-id = 2 basedir = /export/umesh/server/binaries/mysql-5.5.45 datadir = /export/umesh/server/binaries/mysql-5.5.45/slave_A tmpdir = /tmp relay-log-index = /export/umesh/server/binaries/mysql-5.5.45/log/slave_A-relay-bin.index relay-log = /export/umesh/server/binaries/mysql-5.5.45/log/slave_A-relay-bin binlog_format=STATEMENT log_slow_slave_statements=ON slow_query_log=ON long_query_time=0 :::::::::::::: slave_B.cnf :::::::::::::: #Slave [mysqld] pid-file = /export/umesh/server/binaries/mysql-5.5.45/run/slave_B.pid socket = /export/umesh/server/binaries/mysql-5.5.45/run/slave_B.sock log-error=/export/umesh/server/binaries/mysql-5.5.45/log/slave_B.log port = 15002 server-id = 2 basedir = /export/umesh/server/binaries/mysql-5.5.45 datadir = /export/umesh/server/binaries/mysql-5.5.45/slave_B tmpdir = /tmp relay-log-index = /export/umesh/server/binaries/mysql-5.5.45/log/slave_B-relay-bin.index relay-log = /export/umesh/server/binaries/mysql-5.5.45/log/slave_B-relay-bin binlog_format=STATEMENT log_slow_slave_statements=ON slow_query_log=ON long_query_time=0 // Start up # Master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.26: scripts/mysql_install_db --defaults-file=./master.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.26: bin/mysqld_safe --defaults-file=./master.cnf & [1] 17113 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.26: 150601 16:20:46 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.6.26/log/master.log'. 150601 16:20:46 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.6.26/master # Slave's [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: scripts/mysql_install_db --defaults-file=./slave_A.cnf Installing MySQL system tables... [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: scripts/mysql_install_db --defaults-file=./slave_B.cnf Installing MySQL system tables... [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysqld_safe --defaults-file=./slave_A.cnf & [1] 18113 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: 150601 16:23:27 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.5.45/log/slave_A.log'. 150601 16:23:27 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.5.45/slave_A [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysqld_safe --defaults-file=./slave_B.cnf & [2] 18369 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: 150601 16:23:32 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.5.45/log/slave_B.log'. 150601 16:23:32 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.5.45/slave_B // Master (make sure to use binlog_checksum=NONE to avoid Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log) [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.26: bin/mysql -u root -p -S ./run/master.sock Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.26-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like 'port'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | port | 15000 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like 'server_id'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 1 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show processlist; +----+------+-----------+------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+------+---------+------+-------+------------------+ | 1 | root | localhost | NULL | Query | 0 | init | show processlist | +----+------+-----------+------+---------+------+-------+------------------+ 1 row in set (0.00 sec) mysql> CREATE USER 'repl'@'localhost' IDENTIFIED BY 'slavepass'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> mysql> CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'slavepass'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> show master status; +-------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +-------------------+----------+--------------+------------------+-------------------+ | master-bin.000003 | 793 | | | | +-------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec) mysql> -- start first slave mysql> mysql> show processlist; +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | 1 | root | localhost | NULL | Query | 0 | init | show processlist | | 2 | repl | localhost:58516 | NULL | Binlog Dump | 19 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ 2 rows in set (0.00 sec) mysql> mysql> mysql> -- start second slave mysql> mysql> show processlist; +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | 1 | root | localhost | NULL | Query | 0 | init | show processlist | | 2 | repl | localhost:58516 | NULL | Binlog Dump | 63 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | | 3 | repl | localhost:58517 | NULL | Binlog Dump | 22 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ 3 rows in set (0.00 sec) .. . mysql> show processlist; +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | 1 | root | localhost | NULL | Query | 0 | init | show processlist | | 2 | repl | localhost:58516 | NULL | Binlog Dump | 1107 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | | 3 | repl | localhost:58517 | NULL | Binlog Dump | 1066 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ 3 rows in set (0.00 sec) mysql> mysql> -- stopped slaves mysql> show processlist; +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | 1 | root | localhost | NULL | Query | 0 | init | show processlist | | 2 | repl | localhost:58516 | NULL | Binlog Dump | 1577 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | | 3 | repl | localhost:58517 | NULL | Binlog Dump | 1536 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | +----+------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ 3 rows in set (0.00 sec) mysql> // Slave A [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysql -u root -p -S ./run/slave_A.sock Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.45-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like 'port'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | port | 15001 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like 'server_id'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 2 | +---------------+-------+ 1 row in set (0.00 sec) mysql> CHANGE MASTER TO -> MASTER_HOST='localhost', -> MASTER_PORT=15000, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_LOG_FILE='master-bin.000003', -> MASTER_LOG_POS=793; Query OK, 0 rows affected (0.01 sec) mysql> start slave; Query OK, 0 rows affected (0.00 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000003 Read_Master_Log_Pos: 793 Relay_Log_File: slave_A-relay-bin.000002 Relay_Log_Pos: 267 Relay_Master_Log_File: master-bin.000003 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 793 Relay_Log_Space: 425 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 1 row in set (0.00 sec) mysql> mysql> stop slave; Query OK, 0 rows affected (0.00 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Master_Host: localhost Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000003 Read_Master_Log_Pos: 793 Relay_Log_File: slave_A-relay-bin.000002 Relay_Log_Pos: 267 Relay_Master_Log_File: master-bin.000003 Slave_IO_Running: No Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 793 Relay_Log_Space: 425 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 1 row in set (0.00 sec) // Slave B [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysql -u root -p -S ./run/slave_B.sock Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.45-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like 'port'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | port | 15002 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like 'server_id'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 2 | +---------------+-------+ 1 row in set (0.00 sec) mysql> CHANGE MASTER TO -> MASTER_HOST='localhost', -> MASTER_PORT=15000, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_LOG_FILE='master-bin.000003', -> MASTER_LOG_POS=793; Query OK, 0 rows affected (0.00 sec) mysql> start slave; Query OK, 0 rows affected (0.00 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000003 Read_Master_Log_Pos: 793 Relay_Log_File: slave_B-relay-bin.000002 Relay_Log_Pos: 267 Relay_Master_Log_File: master-bin.000003 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 793 Relay_Log_Space: 425 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 1 row in set (0.00 sec) mysql> mysql> stop slave; Query OK, 0 rows affected (0.00 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Master_Host: localhost Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000003 Read_Master_Log_Pos: 793 Relay_Log_File: slave_B-relay-bin.000002 Relay_Log_Pos: 267 Relay_Master_Log_File: master-bin.000003 Slave_IO_Running: No Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 793 Relay_Log_Space: 425 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 1 row in set (0.00 sec)