Strange error coming on MariaDB Master server in /var/log/mariadb/mariadb.log
Hi Team,
We are receiving very strange error in /var/log/mariadb/mariadb.log in MariaDB Master server in master-salve scenario.
he error we are receiving for mariadb-relay-bin.000001, is also present in mysql data directory and owner, permission are correct.
ls -la /u/mysqldata/mariadb-relay-bin.000001
-rw-rw----. 1 mysql mysql 264 Sep 7 03:21 /u/mysqldata/mariadb-relay-bin.000001
171003 13:54:55 [ERROR] Failed to open the relay log './mariadb-relay-bin.000001' (relay_log_pos 4) 171003 13:54:55 [ERROR] Could not find target log during relay log initialization 171003 13:54:55 [ERROR] Failed to initialize the master info structure 171003 13:54:55 [Note] Event Scheduler: Loaded 0 events
Please help us on this issue.
Answer Answered by kanika satija in this comment.
Hi,
To resolve this issue "Failed to initialize the master info structure" please reset slave once and the change master info to slave. Please find complete steps below after connecting to mariadb
1) RESET SLAVE;
2) CHANGE MASTER TO MASTER_HOST='<Master_IP>', MASTER_USER='<created_slave_user>', MASTER_PASSWORD='<slave_password>', MASTER_LOG_FILE='<Bin_log_file>', MASTER_LOG_POS=<Bin_log_pos>;
3) START SLAVE;
I have also faced the same issue earlier in my setup and resolved this issue using above steps.
In case this problem is not resolved with above steps please provide below information:
1) Provide mariadb configuration files "my.cnf" of Master as well as slave
2) Master and slave status
a) show master status
b) show slave status
3) Also provide complete command "CHANGE MASTER TO" which you ran on slave