[umshastr@hod03]/export/umesh/server/binaries: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz --2015-07-16 13:22:16-- http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz Resolving www-proxy.us.oracle.com (www-proxy.us.oracle.com)... 148.87.19.20 Connecting to www-proxy.us.oracle.com (www-proxy.us.oracle.com)|148.87.19.20|:80... connected. Proxy request sent, awaiting response... 302 Found Location: http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz [following] --2015-07-16 13:22:16-- http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz Reusing existing connection to www-proxy.us.oracle.com:80. Proxy request sent, awaiting response... 200 OK Length: 312352560 (298M) [application/x-tar-gz] Saving to: ‘mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz’ 100%[========================================================================================================================================================>] 312,352,560 340KB/s in 19m 33s 2015-07-16 13:41:50 (260 KB/s) - ‘mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz’ saved [312352560/312352560] [umshastr@hod03]/export/umesh/server/binaries: md5sum mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz 74fcbcc52874fdf52a0c95ea5d4579a7 mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz [umshastr@hod03]/export/umesh/server/binaries: tar -zxvf mysql-5.6.25-linux-glibc2.5-x86_64.tar.gz ### conf used #Master [mysqld] pid-file = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/master.pid socket = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/master.sock log-error=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master.log slow_query_log_file=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slow.log general_log_file=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/general.log port = 15000 server-id = 1 basedir = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64 datadir = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/master tmpdir = /tmp log-bin = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master-bin log-bin-index = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master-bin.index binlog_format=ROW # Uncomment at the time of enabling gtid #gtid_mode=ON #log_slave_updates #enforce_gtid_consistency #Slave [mysqld] core-file pid-file = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/slave.pid socket = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/slave.sock log-error=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave.log port = 15001 server-id = 2 basedir = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64 datadir = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave tmpdir = /tmp relay-log-index = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave-relay-bin.index relay-log = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave-relay-bin log-bin = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave-bin log-bin-index = /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave-bin.index binlog_format=ROW log_slow_slave_statements=ON slow_query_log=ON long_query_time=0 skip_slave_start # Uncomment at the time of enabling gtid #gtid_mode=ON #log_slave_updates #enforce_gtid_consistency ## Startup [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64:scripts/mysql_install_db --defaults-file=./master.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64:scripts/mysql_install_db --defaults-file=./slave.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqld_safe --defaults-file=./master.cnf & [1] 7552 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: 150716 14:26:47 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master.log'. 150716 14:26:47 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqld_safe --defaults-file=./slave.cnf & [2] 7801 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: 150716 14:26:57 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave.log'. 150716 14:26:57 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: ps aux|grep mysqld|grep -v grep umshastr 7552 0.0 0.0 113236 1604 pts/1 S 14:26 0:00 /bin/sh bin/mysqld_safe --defaults-file=./master.cnf umshastr 7779 3.2 0.1 1010212 449720 pts/1 Sl 14:26 0:00 /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/bin/mysqld --defaults-file=./master.cnf --basedir=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64 --datadir=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/master --plugin-dir=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/lib/plugin --log-error=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master.log --pid-file=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/master.pid --socket=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/master.sock --port=15000 umshastr 7801 0.0 0.0 113232 1612 pts/1 S 14:26 0:00 /bin/sh bin/mysqld_safe --defaults-file=./slave.cnf umshastr 8084 5.8 0.1 1010220 449744 pts/1 Sl 14:26 0:00 /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/bin/mysqld --defaults-file=./slave.cnf --basedir=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64 --datadir=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave --plugin-dir=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/lib/plugin --log-error=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave.log --pid-file=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/slave.pid --socket=/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/slave.sock --port=15001 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: -- master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysql -uroot -S run/master.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-log MySQL Community Server (GPL) 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> prompt master> PROMPT set to 'master>' master> master> master>CREATE USER 'repl'@'localhost' IDENTIFIED BY 'slavepass'; Query OK, 0 rows affected (0.00 sec) master>GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost'; Query OK, 0 rows affected (0.00 sec) master>show master status; +-------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +-------------------+----------+--------------+------------------+-------------------+ | master-bin.000003 | 427 | | | | +-------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec) -- slave [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysql -uroot -S run/slave.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-log MySQL Community Server (GPL) 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> prompt slave> PROMPT set to 'slave>' slave> slave>CHANGE MASTER TO -> MASTER_HOST='localhost', -> MASTER_PORT=15000, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_LOG_FILE='master-bin.000003', -> MASTER_LOG_POS=427; Query OK, 0 rows affected, 2 warnings (0.01 sec) slave>start slave; Query OK, 0 rows affected (0.00 sec) slave>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: 427 Relay_Log_File: slave-relay-bin.000002 Relay_Log_Pos: 284 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: 427 Relay_Log_Space: 457 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 Master_UUID: edc72be0-2bb5-11e5-aa8e-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 1 row in set (0.00 sec) slave> ###### Enable GTID - follow steps from https://dev.mysql.com/doc/refman/5.6/en/replication-gtids-howto.html Step 1: Synchronize the servers - master master>SET @@global.read_only = ON; Query OK, 0 rows affected (0.00 sec) - slave slave>SET @@global.read_only = ON; Query OK, 0 rows affected (0.00 sec) Step 2: Stop both servers [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqladmin -uroot -S run/master.sock shutdown 150716 14:37:11 mysqld_safe mysqld from pid file /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/master.pid ended [1]- Done bin/mysqld_safe --defaults-file=./master.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqladmin -uroot -S run/slave.sock shutdown 150716 14:37:21 mysqld_safe mysqld from pid file /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/slave.pid ended [2]+ Done bin/mysqld_safe --defaults-file=./slave.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: Step 3: Restart both servers with GTIDs enabled [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: vi master.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: vi slave.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: tail -4 master.cnf gtid_mode=ON log_slave_updates enforce_gtid_consistency [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: tail -4 slave.cnf # Uncomment at the time of enabling gtid gtid_mode=ON log_slave_updates enforce_gtid_consistency [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqld_safe --defaults-file=./master.cnf & [1] 8849 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: 150716 14:39:36 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master.log'. 150716 14:39:36 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqld_safe --defaults-file=./slave.cnf & [2] 9131 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: 150716 14:39:46 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/slave.log'. 150716 14:39:46 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binar Step 4: Direct the slave to use the master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysql -uroot -S run/slave.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-log MySQL Community Server (GPL) 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> prompt slave> PROMPT set to 'slave>' slave> slave>CHANGE MASTER TO -> MASTER_HOST='127.0.0.1', -> MASTER_PORT=15000, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_AUTO_POSITION = 1; Query OK, 0 rows affected, 2 warnings (0.00 sec) slave>start slave; Query OK, 0 rows affected (0.00 sec) slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000004 Read_Master_Log_Pos: 151 Relay_Log_File: slave-relay-bin.000002 Relay_Log_Pos: 363 Relay_Master_Log_File: master-bin.000004 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: 151 Relay_Log_Space: 567 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 Master_UUID: edc72be0-2bb5-11e5-aa8e-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 1 1 row in set (0.00 sec) slave> ###### Create schema/populate some rows (make sure memory table is created) -- master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysql -uroot -S run/master.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-log MySQL Community Server (GPL) 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> prompt master> PROMPT set to 'master>' master> master>use test Database changed master> master>CREATE TABLE t (i INT) ENGINE = MEMORY; Query OK, 0 rows affected (0.00 sec) master>insert into t values(1),(2),(3); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 master>select * from t; +------+ | i | +------+ | 1 | | 2 | | 3 | +------+ 3 rows in set (0.00 sec) master> -- slave slave>use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed slave>select * from t; +------+ | i | +------+ | 1 | | 2 | | 3 | +------+ 3 rows in set (0.00 sec) ###### restart master, check data -- master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqladmin -uroot -S run/master.sock shutdown 150716 14:43:09 mysqld_safe mysqld from pid file /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/master.pid ended [1]- Done bin/mysqld_safe --defaults-file=./master.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqld_safe --defaults-file=./master.cnf & [3] 9831 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: 150716 14:43:15 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master.log'. 150716 14:43:15 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysql -uroot -S run/master.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-log MySQL Community Server (GPL) 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> use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from t; Empty set (0.00 sec) mysql> show master logs; +-------------------+-----------+ | Log_name | File_size | +-------------------+-----------+ | master-bin.000001 | 65420 | | master-bin.000002 | 1175289 | | master-bin.000003 | 450 | | master-bin.000004 | 621 | | master-bin.000005 | 328 | +-------------------+-----------+ 5 rows in set (0.00 sec) mysql> SHOW BINLOG EVENTS IN 'master-bin.000005'; +-------------------+-----+----------------+-----------+-------------+-------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +-------------------+-----+----------------+-----------+-------------+-------------------------------------------------------------------+ | master-bin.000005 | 4 | Format_desc | 1 | 120 | Server ver: 5.6.25-log, Binlog ver: 4 | | master-bin.000005 | 120 | Previous_gtids | 1 | 191 | edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-2 | | master-bin.000005 | 191 | Gtid | 1 | 239 | SET @@SESSION.GTID_NEXT= 'edc72be0-2bb5-11e5-aa8e-0010e05f3e06:3' | | master-bin.000005 | 239 | Query | 1 | 328 | use `test`; DELETE FROM `test`.`t` | +-------------------+-----+----------------+-----------+-------------+-------------------------------------------------------------------+ 4 rows in set (0.00 sec) -- slave slave>select * from t; Empty set (0.00 sec) slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000005 Read_Master_Log_Pos: 328 Relay_Log_File: slave-relay-bin.000003 Relay_Log_Pos: 540 Relay_Master_Log_File: master-bin.000005 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: 328 Relay_Log_Space: 1403 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 Master_UUID: edc72be0-2bb5-11e5-aa8e-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-3 Executed_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-3 Auto_Position: 1 1 row in set (0.00 sec) ### Again, restarted master mysql> insert into t values(1),(2),(3); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select * from t; +------+ | i | +------+ | 1 | | 2 | | 3 | +------+ 3 rows in set (0.00 sec) mysql> \q Bye [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqladmin -uroot -S run/master.sock shutdown 150716 14:49:30 mysqld_safe mysqld from pid file /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/run/master.pid ended [3]+ Done bin/mysqld_safe --defaults-file=./master.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysqld_safe --defaults-file=./master.cnf & [3] 10477 [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: 150716 14:49:34 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/log/master.log'. 150716 14:49:34 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: [umshastr@hod03]/export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64: bin/mysql -uroot -S run/master.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-log MySQL Community Server (GPL) 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> use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from t; Empty set (0.00 sec) mysql> show master status; +-------------------+----------+--------------+------------------+------------------------------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +-------------------+----------+--------------+------------------+------------------------------------------+ | master-bin.000006 | 328 | | | edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-5 | +-------------------+----------+--------------+------------------+------------------------------------------+ 1 row in set (0.00 sec) mysql> SHOW BINLOG EVENTS IN 'master-bin.000006'; +-------------------+-----+----------------+-----------+-------------+-------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +-------------------+-----+----------------+-----------+-------------+-------------------------------------------------------------------+ | master-bin.000006 | 4 | Format_desc | 1 | 120 | Server ver: 5.6.25-log, Binlog ver: 4 | | master-bin.000006 | 120 | Previous_gtids | 1 | 191 | edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-4 | | master-bin.000006 | 191 | Gtid | 1 | 239 | SET @@SESSION.GTID_NEXT= 'edc72be0-2bb5-11e5-aa8e-0010e05f3e06:5' | | master-bin.000006 | 239 | Query | 1 | 328 | use `test`; DELETE FROM `test`.`t` | +-------------------+-----+----------------+-----------+-------------+-------------------------------------------------------------------+ 4 rows in set (0.00 sec) ## slave slave>select * from test.t; +------+ | i | +------+ | 3 | | 2 | | 1 | +------+ 3 rows in set (0.00 sec) slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Reconnecting after a failed master event read Master_Host: 127.0.0.1 Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000005 Read_Master_Log_Pos: 615 Relay_Log_File: slave-relay-bin.000003 Relay_Log_Pos: 827 Relay_Master_Log_File: master-bin.000005 Slave_IO_Running: Connecting 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: 615 Relay_Log_Space: 1690 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: 2003 Last_IO_Error: error reconnecting to master 'repl@127.0.0.1:15000' - retry-time: 60 retries: 1 Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: edc72be0-2bb5-11e5-aa8e-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: 150716 14:49:26 Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-4 Executed_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-4 Auto_Position: 1 1 row in set (0.00 sec) slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Reconnecting after a failed master event read Master_Host: 127.0.0.1 Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000005 Read_Master_Log_Pos: 615 Relay_Log_File: slave-relay-bin.000003 Relay_Log_Pos: 827 Relay_Master_Log_File: master-bin.000005 Slave_IO_Running: Connecting 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: 615 Relay_Log_Space: 1690 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: 2003 Last_IO_Error: error reconnecting to master 'repl@127.0.0.1:15000' - retry-time: 60 retries: 1 Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: edc72be0-2bb5-11e5-aa8e-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: 150716 14:49:26 Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-4 Executed_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-4 Auto_Position: 1 1 row in set (0.00 sec) slave> slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000006 Read_Master_Log_Pos: 328 Relay_Log_File: slave-relay-bin.000004 Relay_Log_Pos: 540 Relay_Master_Log_File: master-bin.000006 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: 328 Relay_Log_Space: 1420 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 Master_UUID: edc72be0-2bb5-11e5-aa8e-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-5.6.25-linux-glibc2.5-x86_64/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-5 Executed_Gtid_Set: edc72be0-2bb5-11e5-aa8e-0010e05f3e06:1-5 Auto_Position: 1 1 row in set (0.00 sec) slave>select * from test.t; Empty set (0.00 sec) ########### 5.6.27 ## build used: [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: cat docs/INFO_SRC commit: 4ca9dbe2ef159e33d7a788eabe9aa013cf5cdf1e date: 2015-07-14 07:38:36 +0530 build-date: 2015-07-14 04:23:18 +0200 short: 4ca9dbe branch: mysql-5.6 MySQL source 5.6.27 Conf file used: #Master [mysqld] pid-file = /export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.pid socket = /export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.sock log-error=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/master.log slow_query_log_file=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/slow.log general_log_file=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/general.log port = 15000 server-id = 1 basedir = /export/umesh/server/binaries/mysql-advanced-5.6.27 datadir = /export/umesh/server/binaries/mysql-advanced-5.6.27/master tmpdir = /tmp log-bin = /export/umesh/server/binaries/mysql-advanced-5.6.27/log/master-bin log-bin-index = /export/umesh/server/binaries/mysql-advanced-5.6.27/log/master-bin.index binlog_format=ROW # Uncomment at the time of enabling gtid #gtid_mode=ON #log_slave_updates #enforce_gtid_consistency #Slave [mysqld] core-file pid-file = /export/umesh/server/binaries/mysql-advanced-5.6.27/run/slave.pid socket = /export/umesh/server/binaries/mysql-advanced-5.6.27/run/slave.sock log-error=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave.log port = 15001 server-id = 2 basedir = /export/umesh/server/binaries/mysql-advanced-5.6.27 datadir = /export/umesh/server/binaries/mysql-advanced-5.6.27/slave tmpdir = /tmp relay-log-index = /export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave-relay-bin.index relay-log = /export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave-relay-bin log-bin = /export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave-bin log-bin-index = /export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave-bin.index binlog_format=ROW log_slow_slave_statements=ON slow_query_log=ON long_query_time=0 skip_slave_start # Uncomment at the time of enabling gtid #gtid_mode=ON #log_slave_updates #enforce_gtid_consistency ## Startup 2 nodes, Setup replication [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: scripts/mysql_install_db --defaults-file=./m77729.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: scripts/mysql_install_db --defaults-file=./s77729.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqld_safe --defaults-file=./m77729.cnf & [1] 14247 [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: 150715 14:06:00 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-advanced-5.6.27/log/master.log'. 150715 14:06:00 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-advanced-5.6.27/master [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqld_safe --defaults-file=./s77729.cnf & [2] 14492 [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: 150715 14:06:08 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave.log'. 150715 14:06:08 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-advanced-5.6.27/slave [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: ps aux|grep mysqld|grep -v grep umshastr 14247 0.0 0.0 113236 1620 pts/0 S 14:05 0:00 /bin/sh bin/mysqld_safe --defaults-file=./m77729.cnf umshastr 14470 1.5 0.1 1011600 450656 pts/0 Sl 14:05 0:00 /export/umesh/server/binaries/mysql-advanced-5.6.27/bin/mysqld --defaults-file=./m77729.cnf --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.27 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.27/master --plugin-dir=/export/umesh/server/binaries/mysql-advanced-5.6.27/lib/plugin --log-error=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/master.log --pid-file=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.pid --socket=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.sock --port=15000 umshastr 14492 0.0 0.0 113236 1600 pts/0 S 14:06 0:00 /bin/sh bin/mysqld_safe --defaults-file=./s77729.cnf umshastr 14775 2.3 0.1 1011604 450672 pts/0 Sl 14:06 0:00 /export/umesh/server/binaries/mysql-advanced-5.6.27/bin/mysqld --defaults-file=./s77729.cnf --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.27 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.27/slave --plugin-dir=/export/umesh/server/binaries/mysql-advanced-5.6.27/lib/plugin --log-error=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave.log --pid-file=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/slave.pid --socket=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/slave.sock --port=15001 -- master [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysql -uroot -S run/master.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.27-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> 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\G *************************** 1. row *************************** File: master-bin.000003 Position: 813 Binlog_Do_DB: Binlog_Ignore_DB: Executed_Gtid_Set: 1 row in set (0.00 sec) mysql> -- slave [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysql -u root -S run/slave.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.27-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> CHANGE MASTER TO -> MASTER_HOST='localhost', -> MASTER_PORT=15000, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_LOG_FILE='master-bin.000003', -> MASTER_LOG_POS=813; Query OK, 0 rows affected, 2 warnings (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: 813 Relay_Log_File: slave-relay-bin.000002 Relay_Log_Pos: 284 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: 813 Relay_Log_Space: 457 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 Master_UUID: dbcefc4c-2ae9-11e5-a55b-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-advanced-5.6.27/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 1 row in set (0.00 sec) ###### Enable GTID - follow steps from https://dev.mysql.com/doc/refman/5.6/en/replication-gtids-howto.html Step 1: Synchronize the servers - master mysql> SET @@global.read_only = ON; Query OK, 0 rows affected (0.00 sec) - slave mysql> SET @@global.read_only = ON; Query OK, 0 rows affected (0.00 sec) Step 2: Stop both servers [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqladmin -uroot -S run/master.sock shutdown 150715 14:11:41 mysqld_safe mysqld from pid file /export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.pid ended [1]- Done bin/mysqld_safe --defaults-file=./m77729.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqladmin -uroot -S run/slave.sock shutdown 150715 14:12:20 mysqld_safe mysqld from pid file /export/umesh/server/binaries/mysql-advanced-5.6.27/run/slave.pid ended [2]+ Done bin/mysqld_safe --defaults-file=./s77729.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: Step 3: Restart both servers with GTIDs enabled [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: vi m77729.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: vi s77729.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: tail -3 m77729.cnf gtid_mode=ON log_slave_updates enforce_gtid_consistency [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: tail -3 s77729.cnf gtid_mode=ON log_slave_updates enforce_gtid_consistency [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqld_safe --defaults-file=./m77729.cnf & [1] 15197 [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: 150715 14:14:47 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-advanced-5.6.27/log/master.log'. 150715 14:14:47 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-advanced-5.6.27/master [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqld_safe --defaults-file=./s77729.cnf & [2] 15480 [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: 150715 14:15:00 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave.log'. 150715 14:15:00 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-advanced-5.6.27/slave [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: ps aux|grep mysqld|grep -v grep umshastr 15197 0.0 0.0 113236 1616 pts/0 S 14:14 0:00 /bin/sh bin/mysqld_safe --defaults-file=./m77729.cnf umshastr 15457 1.8 0.1 1011600 450492 pts/0 Sl 14:14 0:00 /export/umesh/server/binaries/mysql-advanced-5.6.27/bin/mysqld --defaults-file=./m77729.cnf --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.27 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.27/master --plugin-dir=/export/umesh/server/binaries/mysql-advanced-5.6.27/lib/plugin --log-error=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/master.log --pid-file=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.pid --socket=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.sock --port=15000 umshastr 15480 0.1 0.0 113236 1608 pts/0 S 14:15 0:00 /bin/sh bin/mysqld_safe --defaults-file=./s77729.cnf umshastr 15799 4.1 0.1 1011600 450496 pts/0 Sl 14:15 0:00 /export/umesh/server/binaries/mysql-advanced-5.6.27/bin/mysqld --defaults-file=./s77729.cnf --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.27 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.27/slave --plugin-dir=/export/umesh/server/binaries/mysql-advanced-5.6.27/lib/plugin --log-error=/export/umesh/server/binaries/mysql-advanced-5.6.27/log/slave.log --pid-file=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/slave.pid --socket=/export/umesh/server/binaries/mysql-advanced-5.6.27/run/slave.sock --port=15001 Step 4: Direct the slave to use the master [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysql -u root -S run/slave.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.27-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> CHANGE MASTER TO -> MASTER_HOST='127.0.0.1', -> MASTER_PORT=15000, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_AUTO_POSITION = 1; Query OK, 0 rows affected, 2 warnings (0.00 sec) mysql> start slave; Query OK, 0 rows affected (0.01 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000004 Read_Master_Log_Pos: 151 Relay_Log_File: slave-relay-bin.000002 Relay_Log_Pos: 363 Relay_Master_Log_File: master-bin.000004 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: 151 Relay_Log_Space: 567 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 Master_UUID: dbcefc4c-2ae9-11e5-a55b-0010e05f3e06 Master_Info_File: /export/umesh/server/binaries/mysql-advanced-5.6.27/slave/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 1 1 row in set (0.00 sec) ###### Create schema/populate some rows (make sure memory table is created) -- master [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysql -uroot -S run/master.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.27-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> use test Database changed mysql> CREATE TABLE t (i INT) ENGINE = MEMORY; Query OK, 0 rows affected (0.00 sec) mysql> insert into t values(1),(2),(3); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select * from t; +------+ | i | +------+ | 1 | | 2 | | 3 | +------+ 3 rows in set (0.00 sec) -- slave mysql> use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from t; +------+ | i | +------+ | 1 | | 2 | | 3 | +------+ 3 rows in set (0.00 sec) ###### restart master, check data -- master [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqladmin -uroot -S run/master.sock shutdown 150715 14:20:05 mysqld_safe mysqld from pid file /export/umesh/server/binaries/mysql-advanced-5.6.27/run/master.pid ended [1]- Done bin/mysqld_safe --defaults-file=./m77729.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysqld_safe --defaults-file=./m77729.cnf & [3] 16519 [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: 150715 14:20:15 mysqld_safe Logging to '/export/umesh/server/binaries/mysql-advanced-5.6.27/log/master.log'. 150715 14:20:15 mysqld_safe Starting mysqld daemon with databases from /export/umesh/server/binaries/mysql-advanced-5.6.27/master [umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.27: bin/mysql -uroot -S run/master.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.27-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> mysql> use information_schema Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from test.t; Empty set (0.00 sec) -- slave