I try in mi LAN with 2 VM a master-to-master replication, configure:
#bind-address = 127.0.0.1
server-id = 2
auto_increment_increment = 2
auto_increment_offset = 2
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = blog
And:
#bind-address = 127.0.0.1
server-id = 1
auto_increment_increment = 1
auto_increment_offset = 2
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = blog
And execute:
GRANT REPLICATION SLAVE ON *.* TO 'myuser'@'192.168.1.2' IDENTIFIED BY 'x';
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.2';
FLUSH PRIVILEGES;
USE mydb;
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
UNLOCK TABLES;
In other server execute it too, change password and IP. After, I configure slaves:
stop slave;
CHANGE MASTER TO MASTER_HOST='192.168.1.3', MASTER_USER='myuser', MASTER_PASSWORD='y’, MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=512;
start slave;
Etc. Database is empty. I use show slave status and say "error connecting to master", with netstat I look conection only one connection like it:
tcp 0 0 ns2174.ip-192-1:mysql ns2167.ip-192-1:36453 TIME_WAIT
I have tryed restart, reboot, stop one slave,etc; I can conect with mysql -h 192.168.1.3 -p etc but replication don't connect.