68057.txt 777 0 0 71175 12073343776 5415 0 ############ API1-MASTER [root@ushastry mysql-cluster-7.2.10]# bin/mysql -u root --protocol=TCP --port=3306 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.5.29-ndb-7.2.10-debug-log Source distribution Copyright (c) 2000, 2012, 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 | 3306 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like 'server_id'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 100 | +---------------+-------+ 1 row in set (0.01 sec) mysql> show variables like 'binlog_format'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | binlog_format | ROW | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like '%engine%'; +---------------------------+------------+ | Variable_name | Value | +---------------------------+------------+ | default_storage_engine | ndbcluster | | engine_condition_pushdown | ON | | storage_engine | ndbcluster | +---------------------------+------------+ 3 rows in set (0.01 sec) mysql> show master status; +---------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +---------------------+----------+--------------+------------------+ | ushastry-bin.000001 | 112 | | | +---------------------+----------+--------------+------------------+ 1 row in set (0.00 sec) --- Created replication user a/c on master mysql> GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'localhost' IDENTIFIED BY 'slave_password'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> mysql> show processlist; +----+-------------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-------------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ | 1 | system user | | | Daemon | 0 | Waiting for event from ndbcluster | NULL | | 5 | root | localhost:57456 | NULL | Query | 0 | NULL | show processlist | | 6 | slave_user | localhost:56029 | NULL | Binlog Dump | 83 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL | +----+-------------+-----------------+------+-------------+------+-----------------------------------------------------------------------+------------------+ 3 rows in set (0.02 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | ndbinfo | | performance_schema | | test | +--------------------+ 5 rows in set (0.03 sec) mysql> mysql> create database defect68057; Query OK, 1 row affected (0.11 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | defect68057 | | mysql | | ndbinfo | | performance_schema | | test | +--------------------+ 6 rows in set (0.00 sec) mysql> mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 100 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 100 | 276 | GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'localhost' IDENTIFIED BY 'slave_password' | | ushastry-bin.000001 | 276 | Query | 100 | 351 | flush privileges | | ushastry-bin.000001 | 351 | Query | 100 | 448 | create database defect68057 | +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ mysql> use defect68057 Database changed mysql> mysql> create table t1_master(id int not null primary key); Query OK, 0 rows affected (0.46 sec) mysql> show tables; +-----------------------+ | Tables_in_defect68057 | +-----------------------+ | t1_master | +-----------------------+ 1 row in set (0.00 sec) mysql> show create table t1_master\G *************************** 1. row *************************** Table: t1_master Create Table: CREATE TABLE `t1_master` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 1 row in set (0.00 sec) mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 100 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 100 | 276 | GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'localhost' IDENTIFIED BY 'slave_password' | | ushastry-bin.000001 | 276 | Query | 100 | 351 | flush privileges | | ushastry-bin.000001 | 351 | Query | 100 | 448 | create database defect68057 | | ushastry-bin.000001 | 448 | Query | 100 | 569 | use `defect68057`; create table t1_master(id int not null primary key) | +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ 5 rows in set (0.00 sec) mysql> -- confirmed that table created on api 2 is replicated on master and slave mysql> show tables; +-----------------------+ | Tables_in_defect68057 | +-----------------------+ | t1_master | | t1_master_api2 | +-----------------------+ 2 rows in set (0.00 sec) mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 100 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 100 | 276 | GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'localhost' IDENTIFIED BY 'slave_password' | | ushastry-bin.000001 | 276 | Query | 100 | 351 | flush privileges | | ushastry-bin.000001 | 351 | Query | 100 | 448 | create database defect68057 | | ushastry-bin.000001 | 448 | Query | 100 | 569 | use `defect68057`; create table t1_master(id int not null primary key) | | ushastry-bin.000001 | 569 | Query | 100 | 695 | use `defect68057`; create table t1_master_api2(id int not null primary key) | +---------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ 6 rows in set (0.00 sec) mysql> mysql> insert into t1_master values(); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> insert into t1_master values(1); Query OK, 1 row affected (0.00 sec) mysql> select * from t1_master; +----+ | id | +----+ | 1 | | 0 | +----+ 2 rows in set (0.01 sec) mysql> show binlog events; +---------------------+------+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+------+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 100 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 100 | 276 | GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'localhost' IDENTIFIED BY 'slave_password' | | ushastry-bin.000001 | 276 | Query | 100 | 351 | flush privileges | | ushastry-bin.000001 | 351 | Query | 100 | 448 | create database defect68057 | | ushastry-bin.000001 | 448 | Query | 100 | 569 | use `defect68057`; create table t1_master(id int not null primary key) | | ushastry-bin.000001 | 569 | Query | 100 | 695 | use `defect68057`; create table t1_master_api2(id int not null primary key) | | ushastry-bin.000001 | 695 | Query | 100 | 759 | BEGIN | | ushastry-bin.000001 | 759 | Table_map | 100 | 814 | table_id: 45 (defect68057.t1_master) | | ushastry-bin.000001 | 814 | Table_map | 100 | 876 | table_id: 34 (mysql.ndb_apply_status) | | ushastry-bin.000001 | 876 | Write_rows | 100 | 937 | table_id: 34 | | ushastry-bin.000001 | 937 | Write_rows | 100 | 973 | table_id: 45 flags: STMT_END_F | | ushastry-bin.000001 | 973 | Query | 100 | 1038 | COMMIT | | ushastry-bin.000001 | 1038 | Query | 100 | 1102 | BEGIN | | ushastry-bin.000001 | 1102 | Table_map | 100 | 1157 | table_id: 45 (defect68057.t1_master) | | ushastry-bin.000001 | 1157 | Table_map | 100 | 1219 | table_id: 34 (mysql.ndb_apply_status) | | ushastry-bin.000001 | 1219 | Write_rows | 100 | 1280 | table_id: 34 | | ushastry-bin.000001 | 1280 | Write_rows | 100 | 1316 | table_id: 45 flags: STMT_END_F | | ushastry-bin.000001 | 1316 | Query | 100 | 1381 | COMMIT | +---------------------+------+-------------+-----------+-------------+-------------------------------------------------------------------------------------------+ 18 rows in set (0.00 sec) mysql> ############ API2 [ushastry@ushastry mysql-cluster-7.2.10]$ bin/mysql -u root --protocol=TCP --port=3307 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.29-ndb-7.2.10-debug-log Source distribution Copyright (c) 2000, 2012, 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 | 3307 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like 'server_id'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 101 | +---------------+-------+ 1 row in set (0.00 sec) mysql> mysql> show variables like 'binlog_format'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | binlog_format | ROW | +---------------+-------+ 1 row in set (0.00 sec) mysql> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | ndbinfo | | performance_schema | | test | +--------------------+ 5 rows in set (0.01 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | defect68057 | | mysql | | ndbinfo | | performance_schema | | test | +--------------------+ 6 rows in set (0.00 sec) mysql> mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 101 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 101 | 209 | create database defect68057 | +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ 2 rows in set (0.00 sec) mysql> use defect68057 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> mysql> show tables; +-----------------------+ | Tables_in_defect68057 | +-----------------------+ | t1_master | +-----------------------+ 1 row in set (0.02 sec) mysql> show create table t1_master\G *************************** 1. row *************************** Table: t1_master Create Table: CREATE TABLE `t1_master` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 1 row in set (0.00 sec) mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+------------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+------------------------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 101 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 101 | 209 | create database defect68057 | | ushastry-bin.000001 | 209 | Query | 101 | 330 | use `defect68057`; create table t1_master(id int not null primary key) | +---------------------+-----+-------------+-----------+-------------+------------------------------------------------------------------------+ 3 rows in set (0.00 sec) -- create table on api2 mysql> create table t1_master_api2(id int not null primary key); Query OK, 0 rows affected (0.51 sec) mysql> show create table t1_master_api2\G *************************** 1. row *************************** Table: t1_master_api2 Create Table: CREATE TABLE `t1_master_api2` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 1 row in set (0.01 sec) mysql> show tables; +-----------------------+ | Tables_in_defect68057 | +-----------------------+ | t1_master | | t1_master_api2 | +-----------------------+ 2 rows in set (0.00 sec) mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+-----------------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+-----------------------------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 101 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 101 | 209 | create database defect68057 | | ushastry-bin.000001 | 209 | Query | 101 | 330 | use `defect68057`; create table t1_master(id int not null primary key) | | ushastry-bin.000001 | 330 | Query | 101 | 456 | use `defect68057`; create table t1_master_api2(id int not null primary key) | +---------------------+-----+-------------+-----------+-------------+-----------------------------------------------------------------------------+ 4 rows in set (0.00 sec) mysql> select * from t1_master; +----+ | id | +----+ | 1 | | 0 | +----+ 2 rows in set (0.02 sec) mysql> show binlog events; +---------------------+------+-------------+-----------+-------------+-----------------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+------+-------------+-----------+-------------+-----------------------------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 101 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | | ushastry-bin.000001 | 112 | Query | 101 | 209 | create database defect68057 | | ushastry-bin.000001 | 209 | Query | 101 | 330 | use `defect68057`; create table t1_master(id int not null primary key) | | ushastry-bin.000001 | 330 | Query | 101 | 456 | use `defect68057`; create table t1_master_api2(id int not null primary key) | | ushastry-bin.000001 | 456 | Query | 101 | 520 | BEGIN | | ushastry-bin.000001 | 520 | Table_map | 101 | 575 | table_id: 37 (defect68057.t1_master) | | ushastry-bin.000001 | 575 | Table_map | 101 | 637 | table_id: 34 (mysql.ndb_apply_status) | | ushastry-bin.000001 | 637 | Write_rows | 101 | 698 | table_id: 34 | | ushastry-bin.000001 | 698 | Write_rows | 101 | 734 | table_id: 37 flags: STMT_END_F | | ushastry-bin.000001 | 734 | Query | 101 | 799 | COMMIT | | ushastry-bin.000001 | 799 | Query | 101 | 863 | BEGIN | | ushastry-bin.000001 | 863 | Table_map | 101 | 918 | table_id: 37 (defect68057.t1_master) | | ushastry-bin.000001 | 918 | Table_map | 101 | 980 | table_id: 34 (mysql.ndb_apply_status) | | ushastry-bin.000001 | 980 | Write_rows | 101 | 1041 | table_id: 34 | | ushastry-bin.000001 | 1041 | Write_rows | 101 | 1077 | table_id: 37 flags: STMT_END_F | | ushastry-bin.000001 | 1077 | Query | 101 | 1142 | COMMIT | +---------------------+------+-------------+-----------+-------------+-----------------------------------------------------------------------------+ 16 rows in set (0.00 sec) ############ API3-SLAVE [root@ushastry mysql-cluster-7.2.10]# bin/mysql -u root --protocol=TCP --port=3308 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.29-ndb-7.2.10-debug-log Source distribution Copyright (c) 2000, 2012, 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 | 3308 | +---------------+-------+ 1 row in set (0.01 sec) mysql> show variables like 'server_id'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | 102 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like 'binlog_format'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | binlog_format | ROW | +---------------+-------+ 1 row in set (0.01 sec) mysql> show variables like '%engine%'; +---------------------------+--------+ | Variable_name | Value | +---------------------------+--------+ | default_storage_engine | InnoDB | | engine_condition_pushdown | ON | | storage_engine | InnoDB | +---------------------------+--------+ 3 rows in set (0.00 sec) mysql> CHANGE MASTER TO MASTER_HOST='localhost',MASTER_USER='slave_user',MASTER_PASSWORD='slave_password',MASTER_PORT=3306,MASTER_LOG_FILE='ushastry-bin.000001',MASTER_LOG_POS=112,MASTER_CONNECT_RETRY=60; Query OK, 0 rows affected (0.14 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: slave_user Master_Port: 3306 Connect_Retry: 60 Master_Log_File: ushastry-bin.000001 Read_Master_Log_Pos: 351 Relay_Log_File: ushastry-relay-bin.000002 Relay_Log_Pos: 505 Relay_Master_Log_File: ushastry-bin.000001 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: 351 Relay_Log_Space: 669 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: 100 Master_Bind: 1 row in set (0.00 sec) mysql> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | defect68057 | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.02 sec) mysql> mysql> use defect68057 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> mysql> show tables; +-----------------------+ | Tables_in_defect68057 | +-----------------------+ | t1_master | +-----------------------+ 1 row in set (0.00 sec) mysql> show create table t1_master\G *************************** 1. row *************************** Table: t1_master Create Table: CREATE TABLE `t1_master` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 102 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ 1 row in set (0.00 sec) -- confirmed that table created on api2 is also replicated on slave mysql> show tables; +-----------------------+ | Tables_in_defect68057 | +-----------------------+ | t1_master | | t1_master_api2 | +-----------------------+ 2 rows in set (0.00 sec) mysql> show binlog events; +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ | ushastry-bin.000001 | 4 | Format_desc | 102 | 112 | Server ver: 5.5.29-ndb-7.2.10-debug-log, Binlog ver: 4 | +---------------------+-----+-------------+-----------+-------------+--------------------------------------------------------+ 1 row in set (0.00 sec) mysql> show tables; +-----------------------+ | Tables_in_defect68057 | +-----------------------+ | t1_master | | t1_master_api2 | +-----------------------+ 2 rows in set, 2 warnings (0.00 sec) mysql> select * from t1_master; +----+ | id | +----+ | 0 | | 1 | +----+ 2 rows in set (0.00 sec) mysql> mysqlconfigused.txt 777 0 0 2123 12073445056 10075 0:::::::::::::: my.cnf -- API1-Master :::::::::::::: [mysqld] basedir=/home/ushastry/mysql-cluster-7.2.10 datadir=/tmp/data3306 #user=root port=3306 ndbcluster ndb-connectstring=localhost default-storage-engine=NDBCLUSTER server_id=100 log_bin binlog_format=row ndb_log_orig # Enable core files core-file [mysql_cluster] ndb-connectstring=localhost :::::::::::::: my3307.cnf -- API2 :::::::::::::: [mysqld] basedir=/home/ushastry/mysql-cluster-7.2.10 datadir=/tmp/data3307 #user=root port=3307 ndbcluster ndb-connectstring=localhost default-storage-engine=NDBCLUSTER server_id=101 log_bin binlog_format=row ndb_log_orig # Enable core files core-file [mysql_cluster] ndb-connectstring=localhost :::::::::::::: my3308.cnf -- API3-Slave :::::::::::::: [mysqld] basedir=/home/ushastry/mysql-cluster-7.2.10 datadir=/tmp/data3308 #user=root port=3308 ndbcluster default-storage-engine=innodb server_id=102 log_bin binlog_format=row ndb_log_orig # Enable core files core-file #[mysql_cluster] #ndb-connectstring=localhost