MySQL多实例部署启动异常分析及解决方法

最近在两台机器上部署MySQL双实例时,其中一台机器的第二个实例死活启动不来,奇怪的是另一台机器却没有问题。两台机器的配置如下:

A机器:


root@hz-433:~# cd /vobiledata/tmp
root@hz-433:/vobiledata/tmp# /usr/local/mysql-5.6/bin/mysqld_safe --defaults-file=/etc/mysql/my.mediawise.cnf &
[1] 14827
root@hz-433:/vobiledata/tmp# 160712 01:39:04 mysqld_safe Logging to '/vobiledata/mediawise/mysqldata/hz-433.err'.
160712 01:39:04 mysqld_safe Starting mysqld daemon with databases from /vobiledata/mediawise/mysqldata

root@hz-433:/vobiledata/tmp# 160712 01:39:09 mysqld_safe mysqld from pid file /vobiledata/tmp/mysqld.mediawise.pid ended

[1]+  Done                    /usr/local/mysql-5.6/bin/mysqld_safe --defaults-file=/etc/mysql/my.mediawise.cnf
root@hz-433:/vobiledata/tmp#


查看日志:

root@hz-433:/vobiledata/tmp# cat /vobiledata/mediawise/mysqldata/hz-433.err
160712 01:39:04 mysqld_safe Starting mysqld daemon with databases from /vobiledata/mediawise/mysqldata
160712  1:39:04 [ERROR] Can't read from messagefile '/usr/local/mysql-5.6/share/english/errmsg.sys'
160712  1:39:04 [Note] Plugin 'FEDERATED' is disabled.
160712  1:39:04 InnoDB: The InnoDB memory heap is disabled
160712  1:39:04 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160712  1:39:04 InnoDB: Compressed tables use zlib 1.2.3
160712  1:39:04 InnoDB: Using Linux native AIO
160712  1:39:04 InnoDB: Initializing buffer pool, size = 16.0G
160712  1:39:05 InnoDB: Completed initialization of buffer pool
160712  1:39:05 InnoDB: highest supported file format is Barracuda.
160712  1:39:07  InnoDB: Waiting for the background threads to start
160712  1:39:08 InnoDB: 5.5.42 started; log sequence number 1293720470315
160712  1:39:08 [ERROR] Aborting

160712  1:39:08  InnoDB: Starting shutdown...
160712  1:39:08  InnoDB: Warning: table 'mysql/innodb_table_stats'
InnoDB: in InnoDB data dictionary has unknown flags 50.
160712  1:39:09  InnoDB: Shutdown completed; log sequence number 1293720470315
160712  1:39:09 [Note]
160712 01:39:09 mysqld_safe mysqld from pid file /vobiledata/tmp/mysqld.mediawise.pid ended
root@hz-433:/vobiledata/tmp#

分析:

第一反应是errmsg.sys文件不存在或没有权限,对比了一下另外一台正常机器的文件,发现文件大小和权限都没问题。怀疑是mysql程序本身出问题了,因为mysql程序是通过scp 直接从另外一台机器拷贝过来的,拷贝过程中可能出错,于是删掉,重新拷贝了一次,发现还是不行,基本排除是mysql程序的问题。转而怀疑配置文件和数据文件可能有问题,修改配置文件,重新初始化后,将数据目录指向原来的数据,重启mysql,服务正常启动。

root@hz-433:/vobiledata/tmp# chmod a+x /usr/local/mysql-5.6/share/english/errmsg.sys
root@hz-433:/vobiledata/tmp# ls -l /usr/local/mysql-5.6/share/english/errmsg.sys
-rwxr-xr-x 1 root staff 60110 Jul 11 07:08 /usr/local/mysql-5.6/share/english/errmsg.sys
root@hz-433:/vobiledata/tmp#




你可能感兴趣的:(疑难杂症)