ps如何做网站动漫网站建设的目标
ps如何做网站,动漫网站建设的目标,邮票上的化学史网站开发,专门做团购的网站有哪些前言在发生故障切换后#xff0c;经常遇到的问题就是同步报错#xff0c;下面是最近收集的报错信息。记录删除失败在master上删除一条记录#xff0c;而slave上找不到Last_SQL_Error: Could not execute Delete_rows event on table hcy.t1;Cant find record in t1,Error_co…前言在发生故障切换后经常遇到的问题就是同步报错下面是最近收集的报错信息。记录删除失败在master上删除一条记录而slave上找不到Last_SQL_Error: Could not execute Delete_rows event on table hcy.t1;Cant find record in t1,Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;the events master log mysql-bin.000006, end_log_pos 254解决方法master要删除一条记录而slave上找不到报错这种情况主都已经删除了那么从机可以直接跳过。stop slave;set global sql_slave_skip_counter1;start slave;如果这种情况很多需要针对这种错误专门写相关脚本。主键重复在slave已经有该记录又在master上插入了同一条记录。Last_SQL_Error: Could not execute Write_rows event on table hcy.t1;Duplicate entry 2 for key PRIMARY,Error_code: 1062;handler error HA_ERR_FOUND_DUPP_KEY; the events master log mysql-bin.000006, end_log_pos 924解决方法在slave上用desc hcy.t1; 先看下表结构mysql desc hcy.t1;-------------------------------------------| Field | Type | Null | Key | Default | Extra |-------------------------------------------| id | int(11) | NO | PRI | 0 | || name | char(4) | YES | | NULL | |-------------------------------------------删除重复的主键mysql delete from t1 where id2;Query OK, 1 row affected (0.00 sec)mysql start slave;Query OK, 0 rows affected (0.00 sec)mysql show slave status\G;……Slave_IO_Running: YesSlave_SQL_Running: Yes……mysql select * from t1 where id2;在master上和slave上再分别确认一下。更新丢失在master上更新一条记录而slave上找不到丢失了数据。Last_SQL_Error: Could not execute Update_rows event on table hcy.t1;Cant find record in t1,Error_code: 1032;handler error HA_ERR_KEY_NOT_FOUND;the events master log mysql-bin.000010, end_log_pos 794解决方法在master上用mysqlbinlog 分析下出错的binlog日志在干什么。/usr/local/mysql/bin/mysqlbinlog --no-defaults -v -v --base64-outputDECODE-ROWS mysql-bin.000010 | grep -A 10 794#120302 12:08:36 server id 22 end_log_pos 794 Update_rows: table id 33 flags: STMT_END_F### UPDATE hcy.t1### WHERE### 12 /* INT meta0 nullable0 is_null0 */### 2bbc /* STRING(4) meta65028 nullable1 is_null0 */### SET### 12 /* INT meta0 nullable0 is_null0 */### 2BTV /* STRING(4) meta65028 nullable1 is_null0 */# at 794#120302 12:08:36 server id 22 end_log_pos 821 Xid 60COMMIT/*!*/;DELIMITER ;# End of log fileROLLBACK /* added by mysqlbinlog */;/*!50003 SET COMPLETION_TYPEOLD_COMPLETION_TYPE*/;在slave上查找下更新后的那条记录应该是不存在的。mysql select * from t1 where id2;Empty set (0.00 sec)然后再到master查看mysql select * from t1 where id2;----------| id | name |----------| 2 | BTV |----------1 row in set (0.00 sec)把丢失的数据在slave上填补然后跳过报错即可。mysql insert into t1 values (2,BTV);Query OK, 1 row affected (0.00 sec)mysql select * from t1 where id2;----------| id | name |----------| 2 | BTV |----------1 row in set (0.00 sec)mysql stop slave ;set global sql_slave_skip_counter1;start slave;Query OK, 0 rows affected (0.01 sec)Query OK, 0 rows affected (0.00 sec)Query OK, 0 rows affected (0.00 sec)mysql show slave status\G;……Slave_IO_Running: YesSlave_SQL_Running: Yes……1236错误, 二进制文件缺失误删二进制文件等各种原因导致主库mysql-bin.000012文件丢失从库同步失败。Master_Log_File: mysql-bin.000012Slave_IO_Running: NoSlave_SQL_Running: YesLast_IO_Error: Got fatal error 1236 from master when reading data from binary log: Could not find first log file name in binary log index file首先停止从库同步slave stop;查看主库日志文件和位置mysql show master logs;-----------------------------| Log_name | File_size |-----------------------------| mysql-bin.000013 | 154 |-----------------------------回从库使日志文件和位置对应主库CHANGE MASTER TO MASTER_LOG_FILElog-bin.000013,MASTER_LOG_POS154;最后启动从库slave start;show slave status\G;Master_Log_File: mysql-bin.000013Slave_IO_Running: YesSlave_SQL_Running: YesLast_IO_Error:中继日志损坏slave的中继日志relay-bin损坏。Last_SQL_Error: Error initializing relay log position: I/O error reading the header from the binary logLast_SQL_Error: Error initializing relay log position: Binlog has bad magic number;Its not a binary log file that can be used by this version of MySQL1、手工修复解决方法找到同步的binlog和POS点然后重新做同步这样就可以有新的中继日值了。例子mysql show slave status\G;*************************** 1. row ***************************Master_Log_File: mysql-bin.000010Read_Master_Log_Pos: 1191Relay_Log_File: vm02-relay-bin.000005Relay_Log_Pos: 253Relay_Master_Log_File: mysql-bin.000010Slave_IO_Running: YesSlave_SQL_Running: NoReplicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table:Replicate_Ignore_Table:Replicate_Wild_Do_Table:Replicate_Wild_Ignore_Table:Last_Errno: 1593Last_Error: Error initializing relay log position: I/O error reading the header from the binary logSkip_Counter: 1Exec_Master_Log_Pos: 821Slave_IO_Running 接收master的binlog信息Master_Log_FileRead_Master_Log_PosSlave_SQL_Running执行写操作Relay_Master_Log_FileExec_Master_Log_Pos以执行写的binlog和POS点为准。Relay_Master_Log_File: mysql-bin.000010Exec_Master_Log_Pos: 821mysql stop slave;Query OK, 0 rows affected (0.01 sec)mysql CHANGE MASTER TO MASTER_LOG_FILEmysql-bin.000010,MASTER_LOG_POS821;Query OK, 0 rows affected (0.01 sec)mysql start slave;Query OK, 0 rows affected (0.00 sec)mysql show slave status\G;*************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.8.22Master_User: replMaster_Port: 3306Connect_Retry: 10Master_Log_File: mysql-bin.000010Read_Master_Log_Pos: 1191Relay_Log_File: vm02-relay-bin.000002Relay_Log_Pos: 623Relay_Master_Log_File: mysql-bin.000010Slave_IO_Running: YesSlave_SQL_Running: YesReplicate_Do_DB:Replicate_Ignore_DB:Replicate_Do_Table:Replicate_Ignore_Table:Replicate_Wild_Do_Table:Replicate_Wild_Ignore_Table:Last_Errno: 0Last_Error:Skip_Counter: 0Exec_Master_Log_Pos: 1191Relay_Log_Space: 778Until_Condition: NoneUntil_Log_File:Until_Log_Pos: 0Master_SSL_Allowed: NoMaster_SSL_CA_File:Master_SSL_CA_Path:Master_SSL_Cert:Master_SSL_Cipher:Master_SSL_Key:Seconds_Behind_Master: 0Master_SSL_Verify_Server_Cert: NoLast_IO_Errno: 0Last_IO_Error:Last_SQL_Errno: 0Last_SQL_Error:2、Ibbackup各种大招都用上了无奈slave数据丢失过多ibbackup(需要银子)该你登场了。Ibbackup热备份工具是付费的。xtrabackup是免费的功能上一样。Ibbackup备份期间不锁表备份时开启一个事务(相当于做一个快照)然后会记录一个点之后数据的更改保存在ibbackup_logfile文件里恢复时把ibbackup_logfile 变化的数据再写入到ibdata里。Ibbackup 只备份数据( ibdata、.ibd )表结构.frm不备份。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/86925.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!