我们运行一个充当复制主服务器的 MySQL 5.6 服务器。最近,由于从 5.5 升级时出现其他错误,复制似乎不同步,因此我们尝试在另一台机器上创建新的复制。
因此,我们在另一台机器上安装了 MySQL5.6,并测试了它是否正常工作并可以连接。它与主服务器具有相同的 my.cnf,但略有不同(最明显的是 serverid)。
然后,我们在 master 上启动
mysqldump -p --all-databases --master-data --single-transaction --opt > all_databases.sql
将结果复制到新的复制服务器并尝试启动
mysql -p < all_databases150214.sql
这导致了
ERROR 2013 (HY000) at line 2640: Lost connection to MySQL server during query
检查错误日志,你会看到以下内容:
2015-02-14 09:12:51 21932 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-02-14 09:12:51 21932 [Note] InnoDB: The InnoDB memory heap is disabled
2015-02-14 09:12:51 21932 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-02-14 09:12:51 21932 [Note] InnoDB: Memory barrier is not used
2015-02-14 09:12:51 21932 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-02-14 09:12:51 21932 [Note] InnoDB: Using Linux native AIO
2015-02-14 09:12:51 21932 [Note] InnoDB: Using CPU crc32 instructions
2015-02-14 09:12:51 21932 [Note] InnoDB: Initializing buffer pool, size = 8.0G
2015-02-14 09:12:51 21932 [Note] InnoDB: Completed initialization of buffer pool
2015-02-14 09:12:51 21932 [Note] InnoDB: Highest supported file format is Barracuda.
2015-02-14 09:12:52 21932 [Note] InnoDB: 128 rollback segment(s) are active.
2015-02-14 09:12:52 21932 [Note] InnoDB: Waiting for purge to start
2015-02-14 09:12:52 21932 [Note] InnoDB: 5.6.22 started; log sequence number 3511207353
2015-02-14 09:12:52 21932 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2015-02-14 09:12:52 21932 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2015-02-14 09:12:52 21932 [Note] Server hostname (bind-address): '*'; port: 3306
2015-02-14 09:12:52 21932 [Note] IPv6 is available.
2015-02-14 09:12:52 21932 [Note] - '::' resolves to '::';
2015-02-14 09:12:52 21932 [Note] Server socket created on IP: '::'.
2015-02-14 09:12:52 21932 [Warning] 'user' entry 'root@nectol' ignored in --skip-name-resolve mode.
2015-02-14 09:12:52 21932 [Warning] 'user' entry '@nectol' ignored in --skip-name-resolve mode.
2015-02-14 09:12:52 21932 [Warning] 'proxies_priv' entry '@ root@nectol' ignored in --skip-name-resolve mode.
2015-02-14 09:12:52 21932 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=mysqld-relay-bin' to avoid this problem.
2015-02-14 09:12:52 21932 [Note] Event Scheduler: Loaded 0 events
2015-02-14 09:12:52 21932 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.22-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Source distribution
2015-02-14 09:13:25 21932 [Note] 'CHANGE MASTER TO executed'. Previous state master_host='', master_port= 3306, master_log_file='mysql-bin.000215', master_log_pos= 53150355, master_bind=''. New state master_host='', master_port= 3306, master_log_file='mysql-bin.000215', master_log_pos= 53150355, master_bind=''.
11:26:40 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.
key_buffer_size=262144
read_buffer_size=524288
max_used_connections=1
max_threads=300
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 234759 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0xfad7cf0
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 = 7ff34b3d8ec8 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x20)[0x83f6f0]
/usr/sbin/mysqld(handle_fatal_signal+0x34d)[0x61fb9d]
/lib64/libpthread.so.0(+0x11240)[0x7ff588a61240]
/usr/sbin/mysqld(_Z12setup_fieldsP3THD20Bounds_checked_arrayIP4ItemER4ListIS2_E17enum_mark_columnsPS6_b+0x19c)[0x65051c]
/usr/sbin/mysqld(_Z12mysql_insertP3THDP10TABLE_LISTR4ListI4ItemERS3_IS5_ES6_S6_15enum_duplicatesb+0x7d4)[0x679184]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x2a4c)[0x68d62c]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x328)[0x691838]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x20fb)[0x693f3b]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x1a6)[0x665576]
/usr/sbin/mysqld(handle_one_connection+0x38)[0x6655c8]
/usr/sbin/mysqld(pfs_spawn_thread+0x123)[0xa22483]
/lib64/libpthread.so.0(+0x91da)[0x7ff588a591da]
/lib64/libc.so.6(clone+0x6d)[0x7ff5881999cd]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7ff3340a10f0): is an invalid pointer
Connection ID (thread ID): 2
Status: 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.
因此,目前我们怀疑某些查询引发了 MySQL 错误,但不知道从哪里开始调查以启动并运行新的复制。有什么想法吗?
谢谢