首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >主-主复制在服务器重新启动后中断

主-主复制在服务器重新启动后中断
EN

Server Fault用户
提问于 2019-04-29 19:45:19
回答 1查看 951关注 0票数 0

我有一个具有以下配置的主-母复制。由于一些补丁,我们必须重新启动这两个主程序。但是当我检查复制时,S断了。

MASTER 1:

代码语言:javascript
复制
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

bind-address=Master 1
port=3306
query_cache_size=16M
query_cache_limit=4M
tmp_table_size=64M
max_heap_table_size=64M
key_buffer_size=32M
table_open_cache=32
innodb_file_per_table=1
max_connections=1000
server_id=2
binlog_format='MIXED'
log-bin=/var/log/mariadb/mariadb-bin.log
max_allowed_packet=1000M
general_log=1
auto_increment_increment=2
auto_increment_offset=2



[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

!includedir /etc/my.cnf.d

MASTER2:

代码语言:javascript
复制
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
bind-address=Master2
port=3306
query_cache_size=16M
query_cache_limit=4M
tmp_table_size=64M
max_heap_table_size=64M
key_buffer_size=32M
table_open_cache=32
innodb_file_per_table=1
#innodb_force_recovery=5
max_connections=1000
server_id=1
binlog_format='MIXED'
log-bin=/var/log/mariadb/mariadb-bin.log
max_allowed_packet=1000M
general_log=1
auto_increment_increment=2
auto_increment_offset=1

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

!includedir /etc/my.cnf.d

在配置过程中,我进行了大量的研究,发现如果设置增量值,复制会在复制崩溃后恢复,但在我的示例中,我看到复制由于以下错误而中断。

错误:

190428 3:21:02从SQL:未能在表nagios.nagios_servicestatus上执行nagios.nagios_servicestatus事件;无法在'nagios_servicestatus‘中找到记录,Error_code: 1032;处理程序错误HA_ERR_KEY_NOT_FOUND;事件的主日志mariadb-bin.000002,end_log_pos 259533668,Error_code: 1032 190428 3:21:02从Error_code:无法在'nagios_servicestatus’Error_code: 1032 190428 3:21:02中找到记录,运行查询的从SQL线程中止。修复此问题,并使用“从启动”重新启动从SQL线程。我们停在日志'mariadb-bin.000002‘位置259532745 190429 9:31:32从服务器读取数据包:在查询期间丢失到MySQL服务器的连接( server_errno=2013) 190429 9:31:32从I/O线程在读取事件190429 9:31:32从I/O线程退出时终止,读取到日志'mariadb-bin.000002',位置369070380 190429 9:31:33从SQL线程初始化,开始复制日志'mariadb-bin.000002’在位置259532745,中继日志‘/mariadb-中继-bin.000002’位置: 143476361 190429 9:31:33 'SQL_SLAVE_SKIP_COUNTER=1‘在中继_ log _file=’./mariadb-中继-bin.000002‘、中继_log_pos=’143476361‘、主日志_名称=’mariadb-bin.000002‘、主日志_pos=’259532745‘和在中继_log_file=’.主日志_pos=‘259533752’190429 9:31:33从SQL:未能在表Update_rows上执行nagios.nagios_customvariablestatus事件;无法在'nagios_customvariablestatus‘中找到记录,Error_code: 1032;处理程序错误HA_ERR_KEY_NOT_FOUND;事件的主日志mariadb-bin.000002,end_log_pos 259534029,Error_code: 1032 190429 9:31:33从Error_code中找不到记录:nagios_customvariablestatus中找不到记录: 1032 190429 9:31:33运行查询时出错,从nagios_customvariablestatus线程中止。修复此问题,并使用“从启动”重新启动从SQL线程。我们停留在日志'mariadb-bin.000002‘位置259533752

是否需要向my.cnf添加更多配置,以便在重新启动后自动恢复复制?

谢谢,

EN

回答 1

Server Fault用户

发布于 2019-04-30 01:56:34

我认为次母版没有同步和应用程序点击到次主以改变记录,请检查主主,如果这是健康的,并指出应用程序的连接。如果您正在使用easy,这可能更容易对您。我认为最好的选择是重新设置次要的主人。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/965160

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档