0

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.

  • What relevant messages are in your logs ? – user9517 May 21 '14 at 12:27
  • Is empty /var/log/mysql.err and /var/log/mysql.log too. :( The servers is in kimsurfi, I don't belive that it is relevant, but is one information more. –  May 21 '14 at 12:37
  • What about on the master's logs ? and what exact error messages are shown in `show slave status G;` ? You should also check where your mysql is logging to and take appropriate actions to enable logging. – user9517 May 21 '14 at 12:40
  • logs in two servers is empty, I don't understand it but are files with 0 bytes. In show slave status say: 1045 | error connecting to master 'myuser@188.165.207.57:3306' - retry-time: 60 retries: 86400 –  May 21 '14 at 12:42
  • I try now in GRANT use % for host and don't connect –  May 22 '14 at 07:58

0 Answers0