Mysql Replication Error Reading Master Configuration
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more error 1201 hy000 could not initialize master info structure about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges error counting relay log space Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each failed to open the relay log other. Join them; it only takes a minute: Sign up Error: “could not initailize master info structure” while doing Master Slave Replication in MySQL up vote 26 down vote favorite 6 I am trying to do Master Slave Replication could not find target log during relay log initialization for MySQL. When i am typing the following command: CHANGE MASTER TO MASTER_HOST='10.1.100.1', MASTER_USER='slave_user', MASTER_PASSWORD='slave_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=451228; mysql> START SLAVE; it throws the following error: ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log Any help would be greatly appreciated. mysql replication master slave share|improve this question edited Feb 17 '11 at 20:51 Vijay Dev 9,261145589 asked Feb 17 '11 at 13:22 user619684 131123 add a
Change Master To
comment| 2 Answers 2 active oldest votes up vote 89 down vote TRY TO RESET IT, IT DOES MAGIC! ON SLAVE THE SLAVE MYSQL COMMAND TYPE: RESET SLAVE; THEN TRY AGAIN: CHANGE MASTER TO MASTER_HOST='10.1.100.1', MASTER_USER='slave_user', MASTER_PASSWORD='slave_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=451228; mysql> START SLAVE; share|improve this answer answered Mar 29 '12 at 21:10 Neo 4,73913655 1 thanks a lot, had same problem here... –eran Nov 12 '12 at 16:15 1 Thanks a lot. This worked for me :D Power! (y) hehe –marknt15 May 15 '14 at 7:13 2 Worked for me. This blew my mind. –Logan Bissonnette May 28 '14 at 20:51 2 This is the solution, in my case in happened after doing start slave with a wrong server_id in the slave, stop and start did not work before doing reset. –danigosa Oct 8 '14 at 11:49 awesome man !!! –Pankaj Katiyar Aug 10 at 12:57 add a comment| up vote 4 down vote Please check several things: 1) Make sure the Master's /etc/my.cnf has server_id actually set Here is why: Replication relies on the server_id. Whenever a query is executed and is recorded in the master's binary log, the server_id of the master is recorded with it. By default, if a server_id is not defined in /etc/my.cnf, the server_id is defaulted to 1. However, the rules MySQL Replication demand that a server_id be explicitly def
Pinera Email Updates: Status: Closed Impact on me: None Category:MySQL Cluster: Replication Severity:S2 (Serious) Version:mysql-5.1-telco-7.1 OS:Linux (RedHad 5.4 and CentOS) Assigned to: Martin Skold Tags: 7.1.3, replication, sql node restart, telco-7.1 bzr Triage: Triaged: D2 (Serious) / R6 (Needs Assessment) / E6 (Needs Assessment) View Add Comment Files Developer Edit Submission View Progress Log Contributions [15 Apr 2010 14:42] Carlos Pinera Description: We have http://stackoverflow.com/questions/5029485/error-could-not-initailize-master-info-structure-while-doing-master-slave-rep multi-master replication between two machines. Initially the slave status shows everything is fine. After an SQL node is restarted (/etc/init.d/mysql restart), the slave on that SQL node get an error: 100413 10:15:36 [ERROR] Error reading master configuration 100413 10:15:36 [ERROR] Failed to initialize the master info structure This was working https://bugs.mysql.com/bug.php?id=52859 fine with cluster version 7.0.9 and earlier. Setting an explicit entry in my.cnf for master-info-file has no effect. For simplicity I reduced the configuration to two machines, with each machine running a single storage node. It fails the same way with the configuration of two macnines in each cluster and replication between the clusters (total of 4 machines). After the restart the storage and sql nodes are up but the slave has not started. The my.cnf file content for 'andorinha' is: # MySQL Cluster configuation file. [mysqld] ndbcluster # Run the NDB storage engine ndb-connectstring=andorinha.isxinc.com server_id=3 auto_increment_increment=10 auto_increment_offset=3 binlog-format=ROW log-bin=row binlog-ignore-db=test ndb-log-update-as-write=OFF log-slave-updates replicate-same-server-id=0 replicate-ignore-db=test replicate-do-table=mysql.ndb_apply_status replicate-wild-ignore-table=mysql.% relay-log=/var/lib/mysql/andorinha.isxinc.com_rl relay-log-index=/var/lib/mysql/andorinha.isxinc.com_rl1 relay-log-info-file=/var/lib/mysql/relay-log.info slave-net-timeout=60 [mysql_cluster] ndb-connectstring=andorinha.isxinc.com The my.cnf file content for 'canario' is: # MySQL Cluster configuation file. [mysqld] ndbcluster # Run the NDB storage engine ndb-connectstring=canario.isxinc.com server_id=1 auto_increment_increment=10 auto_increment_offset=1 binlog-format=ROW log-bin=row binlog-ignore-db=test ndb-log-update-as-write=OFF log-slave-updates replicate-same-server-id=0 replicate-ignore-db=test replicate-do-table=mysql.ndb_apply_status replicate-wild-ignore-table=mysql.% relay-log=/var/lib/mysql/canario.isxinc.com_rl relay-log-index=/var/lib/mysql/canario.isxinc.com_rl1 relay-log-info-file=/var/lib/mysql/relay-log.info
created relay files in /var/run/mysqld/ which filled up the whole of the partition and caused errors in the logs. http://perplexed.co.uk/301_restoring_a_broken_slave.htm To repair the problem i ran {{{RESET MASTER}}} on the master db server and removed the relay files from the slave. This didn't have the desired affect. >Start slave; "Error reading slave log configuration" I then banged my head against the wall. A blog documented a similar problem whereby the files master.info and relay-bin.info relay log were both empty. And to delete them Gung-Ho I deleted the following sudo rm /var/lib/mysql/relay-log.info sudo rm /var/lib/mysql/master.info sudo rm /var/runmysqld/* Restarted slave and everything was back to normal.... apart from the data loss. See Mysqldump and restore slave from master using bash Handling other Errors Error "ERROR 1201 (HY000): Could not initialize master mysql replication error info structure; more error messages can be found in the MySQL error log" I opened the syslog where the message said >sudo less /var/log/syslog [ERROR] Failed to open the relay log '/var/run/mysqld/mysqld-relay-bin.000040' (relay_log_pos 202987) I opened up the relay-log.info file >sudo nano /var/lib/mysql/relay-log.info /var/run/mysqld/mysqld-relay-bin.000040 ... In the directory /var/run/mysqld/ and the mysql directory log file mysqld-relay-bin.index there were only three files mentioned, which did not include mysqld-relay-bin.000040. I deleted the the relay-log.info file sudo rm /var/lib/mysql/relay-log.info And restarted mysql slave successfully. Error: "Slave_IO_Running: No" I got this another day mysql> SHOW SLAVE STATUS\G ... Slave_IO_Running: No Slave_SQL_Running: Yes ... The log file defined in "my.cnf" err-log=/data/logs/mysqld/mysqld.log Looking in err-log=/data/logs/mysqld/mysqld.log contained the following lines. 080718 10:35:34 [Note] Slave I/O thread: connected to master 'replicateuser@1.2.3.4:3306', replication started in log 'db1-bin.000125' at position 920655371 080718 10:35:34 [ERROR] Error reading packet from server: log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master (server_errno=1236) 080718 10:35:34 [ERROR] Got fatal error 1236: 'log event entry exceeded max_allowed_packet;