Chinaunix

标题: 请教:mysql5.1.30同步出错 [打印本页]

作者: jingzhongyue_1    时间: 2009-01-03 10:21
标题: 请教:mysql5.1.30同步出错
配置了mysql互为主从
mysql 5.1.30 二进制包解压安装的
已经设置server-id分别为1.2
先遇到的问题是:
B同步A正常 
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
能正常同步
A同步B出现错误提示:
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Last_IO_Error: error reconnecting to master 'repl@192.168.1.111:3306' - retry-time: 60 retries: 86400
同步也正常。
查google,大都说是5.0的版本升级就可以解决这错误提示。
但此版本已经是5.1.30稳定版
之前错误依旧存在。

同步不久后,B同步A出现另一问题,
mysql一直重启并不断生成日志文件
查错误提示中有:
一直循环这个错误提示:

081231 00:04:33 mysqld_safe Number of processes running now: 0
081231 00:04:33 mysqld_safe mysqld restarted
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
081231 0:04:33 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 90771, file name ./MySQLbak-bin.000003
081231 0:04:33 InnoDB: Started; log sequence number 0 220688251
081231 0:04:33 [Note] Recovering after a crash using MySQLbak-bin
081231 0:04:33 [Note] Starting crash recovery...
081231 0:04:33 [Note] Crash recovery finished.
081231 0:04:33 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL serve
r acts as a slave and has his hostname changed!! Please use '--relay-log=MySQLbak-relay-bin' to avoid this problem.
081231 0:04:33 [Note] Event Scheduler: Loaded 0 events
081231 0:04:33 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.30-log' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
081231 0:04:33 [Note] Slave SQL thread initialized, starting replication in log 'MySQLmain-bin.000002' at position 1715893,
relay log './MySQLbak-relay-bin.000008' position: 1554022
081231 0:04:33 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=268435456
read_buffer_size=262144
max_used_connections=0
max_threads=1000
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1036495 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0xa523f28
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x5013b8 thread_stack 0x30000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x16) [0x84fdd94]
/usr/local/mysql/bin/mysqld(threads+0) [0x8740d84]
/usr/local/mysql/bin/mysqld(THD::~THD()+0) [0x81d1b7e]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xa515cfe = UPDATE sys_stat SET st5 = NAME_CONST('$st5',9), st5Now = NOW() WHERE stDate = NAME_CONST('$stDate
',_binary'2008-12-31' COLLATE 'binary')
thd->thread_id=2
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

网上查,针对错误提示
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1036495 K
bytes of memory
已经调整了my.cnf
仍然存在。
而此错误
thd->query at 0xa515cfe = UPDATE sys_stat SET st5 = NAME_CONST('$st5',9), st5Now = NOW() WHERE stDate = NAME_CONST('$stDate
',_binary'2008-12-31' COLLATE 'binary')
thd->thread_id=2
thd->killed=NOT_KILLED
不明白具体会是哪出错问题。

[ 本帖最后由 jingzhongyue_1 于 2009-1-3 11:39 编辑 ]
作者: huzi1986    时间: 2009-01-03 11:12
你做的双重复制?
作者: jingzhongyue_1    时间: 2009-01-03 11:15
是的,做双向同步。
现在A->B,就一直遇到错误重启。用--skip-slave-start启动B,是正常启动。
作者: simeiren    时间: 2009-01-03 11:20
Last_IO_Error: error reconnecting to master 'repl@192.168.1.111:3306' - retry-time: 60 retries: 86400

你说的同步出错是上面这条信息吧。

这个正常,因为你做了Master/Master复制,但是两边不是同时启动的;
所以必然有一边会报这个信息!

另外重启的问题我装MySQL-5.1.30后也出现过;
把内存利用的相关参数调小后,重启的频率减少了,但还是重启;
不清楚是不是和master/slave有关。
作者: jingzhongyue_1    时间: 2009-01-03 11:32
另外重启的问题我装MySQL-5.1.30后也出现过;
把内存利用的相关参数调小后,重启的频率减少了,但还是重启;
不清楚是不是和master/slave有关。


从mysql服务器
用mysqld_safe --skip-slave-start --user=mysql& 可正常启动(不开同步)
不会重启,能正常运行。

即便参数调小后,开启mysql(带slave),一直启动不了mysql(一直在重启那样).
作者: yueliangdao0608    时间: 2009-01-03 13:52
内存分配太大了。
作者: jingzhongyue_1    时间: 2009-01-03 14:14
已经把内存调整了
[mysqld]
port                = 3306
socket                = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

错误提示是:
090103 14:09:21 mysqld_safe Number of processes running now: 0
090103 14:09:21 mysqld_safe mysqld restarted
090103 14:09:21  InnoDB: Started; log sequence number 0 220688251
090103 14:09:21 [Note] Recovering after a crash using MySQLbak-bin
090103 14:09:21 [Note] Starting crash recovery...
090103 14:09:21 [Note] Crash recovery finished.
090103 14:09:22 [Note] Event Scheduler: Loaded 0 events
090103 14:09:22 [Note] Slave SQL thread initialized, starting replication in log 'MySQLmain-bin.000002' at position 1715893,
relay log './MySQLbak-relay-bin.000008' position: 1554022
090103 14:09:22 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.30-log'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)
090103 14:09:22 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=16777216
read_buffer_size=262144
max_used_connections=0
max_threads=151
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 133311 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x8e9a718
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7c13b8 thread_stack 0x30000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x16) [0x84fdd94]
/usr/local/mysql/bin/mysqld(threads+0) [0x8740d84]
/usr/local/mysql/bin/mysqld(THD::~THD()+0) [0x81d1b7e]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x8e95a6e = UPDATE sys_stat SET st5 =  NAME_CONST('$st5',9), st5Now = NOW() WHERE stDate =  NAME_CONST('$stDate
',_binary'2008-12-31' COLLATE 'binary')
thd->thread_id=2
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
090103 14:09:22 mysqld_safe Number of processes running now: 0
090103 14:09:22 mysqld_safe mysqld restarted




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2