全部博文(389)
分类: Mysql/postgreSQL
2014-08-14 21:40:46
使用stack信息处理Mysql问题一则
某日需要部署几台mysql.部署第二台的时候,mysql服务无法启动了.报出如下错误信息.所有平台,os,mysql版本完本一样
140814 8:45:32 InnoDB: Initializing buffer pool, size = 128.0M
140814 8:45:33 InnoDB: Completed initialization of buffer pool
140814 8:45:33 InnoDB: highest supported file format is Barracuda.
140814 8:45:33 InnoDB: Waiting for the background threads to start
140814 8:45:34 Percona XtraDB () 5.5.33-rel31.1 started; log sequence number 1597945
12:45:34 UTC - 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.
Please help us make Percona Server better by reporting any
bugs at
key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=2002
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4389196 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
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 = 0 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x7e7fa5]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x3f4)[0x6a2fb4]
/lib64/libpthread.so.0(+0xf710)[0x7f0c45d89710]
/usr/local/mysql/bin/mysqld(_ZN9MYSQL_LOG17generate_new_nameEPcPKc+0x2b3)[0x746523]
/usr/local/mysql/bin/mysqld(_ZN9MYSQL_LOG26init_and_set_log_file_nameEPKcS1_13enum_log_type10cache_type+0x5f)[0x74667f]
/usr/local/mysql/bin/mysqld(_ZN13MYSQL_BIN_LOG4openEPKc13enum_log_typeS1_10cache_typebmbb+0x5f)[0x74dc5f]
/usr/local/mysql/bin/mysqld[0x50d337]
/usr/local/mysql/bin/mysqld(_Z11mysqld_mainiPPc+0x8d8)[0x50e088]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7f0c44992d1d]
/usr/local/mysql/bin/mysqld[0x503fb9]
You may download the Percona Server operations manual by visiting
. You may find information
in the manual which will help you identify the cause of the crash.
140814 08:45:34 mysqld_safe mysqld from pid file /usr/local/mysql/data/unions.pid ended
140814 08:46:31 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
^G/usr/local/mysql/bin/mysqld: File '/usr/local/mysql/binlog/sub.index' not found (Errcode: 2)
140814 8:46:31 [ERROR] Aborting
为什么第一台可以,而第二台不行.从报错的信息来看是内存不足?所有的服务器内存大小都是相同的.难道碰上bug了?
相同的OS和mysql已经部署很多次,应该不会这么巧吧.
根据显示的stack信息从下往上看,发现在bin_log函数处报的错
/usr/local/mysql/bin/mysqld(_ZN13MYSQL_BIN_LOG4openEPKc13enum_log_typeS1_10cache_typebmbb+0x5f)[0x74dc5f]
这个函数初始化一个binlog和设置日志名
/usr/local/mysql/bin/mysqld(_ZN9MYSQL_LOG26init_and_set_log_file_nameEPKcS1_13enum_log_type10cache_type+0x5f)[0x74667f]
再往上调用一个产生新的名字的函数
/usr/local/mysql/bin/mysqld(_ZN9MYSQL_LOG17generate_new_nameEPcPKc+0x2b3)[0x746523]
这个函数出错了,从而导致整个mysql进程无法初始化.最有可能是权限和目录问题
检查相关文件权限没有问题,最后是由于log_bin指定的位置在新服务器上还没有建立,建立该目录后问题解决.