简体   繁体   中英

mysql slave db error connecting to master

Errors I'm getting in my mysqld.log on the Slave DB. This suddenly stopped working...

180917 18:01:44 mysqld_safe Starting mysqld daemon with databases from /var/www/ncc-web/var/mysql
180917 18:01:44 InnoDB: The InnoDB memory heap is disabled
180917 18:01:44 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180917 18:01:44 InnoDB: Compressed tables use zlib 1.2.7
180917 18:01:44 InnoDB: Initializing buffer pool, size = 2.0G
180917 18:01:44 InnoDB: Completed initialization of buffer pool
180917 18:01:44 InnoDB: highest supported file format is Barracuda.
180917 18:01:44  InnoDB: Waiting for the background threads to start
180917 18:01:45 InnoDB: 1.1.8 started; log sequence number 106350794935
180917 18:01:45 [Warning] Failed to setup SSL
180917 18:01:45 [Warning] SSL error: Failed to set ciphers to use
180917 18:01:45 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
180917 18:01:45 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
180917 18:01:45 [Note] Server socket created on IP: '0.0.0.0'.
180917 18:01:45 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000214' at position 11716747, relay log '/<path>/var/mysql/mysql-relay-bin.000681' position: 11716893
180917 18:01:45 [ERROR] Slave SQL: Could not execute Update_rows event on table performance_schema.setup_instruments; Can't find record in 'setup_instruments', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log mysql-bin.000214, end_log_pos 11717881, Error_code: 1032
180917 18:01:45 [Warning] Slave: Can't find record in 'setup_instruments' Error_code: 1032
180917 18:01:45 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000214' position 11716747
180917 18:01:45 [Note] Event Scheduler: Loaded 0 events
180917 18:01:45 [Note] /<path>/parts/mysql/bin/mysqld: ready for connections.
Version: '5.5.28-log'  socket: '/<path>/var/mysql/mysql.sock'  port: 3306  Source distribution
180917 18:01:45 [ERROR] Slave I/O: error connecting to master 'replication@xx.xx.xx.xx:3306' - retry-time: 60  retries: 86400, Error_code: 1129

I'm not sure how to fix. I inherited this so I never set it up.

SOLUTION:

In addition to the following advice for getting over the errors regarding updating rows:

SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
Stop slave;
start slave;

I found that the slave I/O error Error_code: 1129 had to do with max connections:

I tried to connect to the master server from the slave:

[$ bin/mysql -h xx.xx.xx.xx -u ERROR 1129 (HY000): Host 'xx.xx.xx.xx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

I executed mysqladmin flush-hosts on the master server and all is repaired!!!

Slave is trating to delete a record that is not there so is getting on error state.

If is a single error you can just skipp that line on the binary log to continue without running that sentence.

Just run the following on your mysql client (slave).

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql> STOP SLAVE;
mysql> START SLAVE;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM