mysqld got signal 11

問題發生背景

問題實例以前使用的是percona server,是安裝pmm鏡像自帶的數據庫,以後經過mysqldump遷移到了MySQL server,目前是隻有有pmm server 訪問pmm庫,MySQL server就crash,並經過守護進程mysqld_safe 自動重啓,crash 集嘗試重啓的一部分信息以下html

11:24:49 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. Attempting to collect some information that could help diagnose the problem. As this is a crash and something is definitely wrong, the information collection process might fail. key_buffer_size=8388608 read_buffer_size=131072 max_used_connections=2 max_threads=1000 thread_count=2 connection_count=2 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 405496 K bytes of memory Hope that's ok; if not, decrease some variables in the equation.
 Thread pointer: 0x7f7ac8000b30 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 = 7f7b20769e28 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0xf32bd5] /usr/local/mysql/bin/mysqld(handle_fatal_signal+0x4a4)[0x77b844] /lib64/libpthread.so.0[0x3db380f710] /usr/local/mysql/bin/mysqld(_ZN10Field_blob15copy_blob_valueEP11st_mem_root+0x30)[0x7ab940] /usr/local/mysql/bin/mysqld(_Z25mysql_prepare_blob_valuesP3THDR4ListI4ItemEP11st_mem_root+0x35e)[0xe8309e] /usr/local/mysql/bin/mysqld(_Z12write_recordP3THDP5TABLEP9COPY_INFOS4_+0x251)[0xe835d1] /usr/local/mysql/bin/mysqld(_ZN14Sql_cmd_insert12mysql_insertEP3THDP10TABLE_LIST+0x8d2)[0xe84882] /usr/local/mysql/bin/mysqld(_ZN14Sql_cmd_insert7executeEP3THD+0xce)[0xe8500e] /usr/local/mysql/bin/mysqld(_Z21mysql_execute_commandP3THDb+0xd92)[0xd10fe2] /usr/local/mysql/bin/mysqld(_ZN18Prepared_statement7executeEP6Stringb+0x320)[0xd3ddd0] /usr/local/mysql/bin/mysqld(_ZN18Prepared_statement12execute_loopEP6StringbPhS2_+0xdb)[0xd3e04b] /usr/local/mysql/bin/mysqld(_Z19mysqld_stmt_executeP3THDmmPhm+0x11f)[0xd3e4cf] /usr/local/mysql/bin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0x74c)[0xd15c3c] /usr/local/mysql/bin/mysqld(_Z10do_commandP3THD+0x194)[0xd17114] /usr/local/mysql/bin/mysqld(handle_connection+0x294)[0xde1c34] /usr/local/mysql/bin/mysqld(pfs_spawn_thread+0x174)[0x11f96f4] /lib64/libpthread.so.0[0x3db38079d1] /lib64/libpthread.so.0[0x3db38079d1] /lib64/libc.so.6(clone+0x6d)[0x3db34e8b6d] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7f7ac80054f0): Query (7f7ac80054f0): is an invalid pointer Connection ID (thread ID): 3 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.180111 19:24:49 mysqld_safe Number of processes running now: 0180111 19:24:49 mysqld_safe mysqld restarted 2018-01-11T11:24:49.827511Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.

原 percona server 版本:5.7.18-16;目前MySQL server 版本:5.7.10mysql

嘗試將MySQL server 版本升級到5.7.20,沒法解決問題,後來變動爲percona server 5.7的一個分支版本解決問題sql

經過rmp 安裝percona server數據庫

官方文檔socket

# 安裝yum 源 yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
# 安裝percona server yum install Percona-Server-server-57

防止使用my.cnf啓動,指定配置文件啓動服務,使用現有的配置文件和數據文件ide

# 啓動服務
/usr/bin/mysqld_multi --defaults-file=/etc/mysql/3306.cnf --mysqladmin=/usr/bin/mysqladmin --mysqld=/usr/bin/mysqld_safe --no-log start 3306
# 關閉服務
/usr/bin/mysqld_multi --defaults-file=/etc/mysql/3306.cnf --mysqladmin=/usr/bin/mysqladmin --mysqld=/usr/bin/mysqld_safe --no-log stop 3306
# 登錄
/usr/bin/mysql -S /tmp/mysql_3306.sock

關於MySQL server的pid-file 和mysqld_multi 的啓動項

因爲啓動的選項是--defaults-extra-file 因此同時會讀取全局變量文件/etc/my.cnf,能夠設置爲oop

 

[mysqld]
...
[mysqld_safe]
...
[mysqld_multi] mysqld
=/usr/local/mysql/bin/mysqld_safe mysqladmin=/usr/local/mysql/bin/mysqladmin

 對於--mysqld 的值能夠是二進制文件mysqld的位置(會讀取[mysqld]下的配置),守護進程mysqld_safe不會啓動ui

也能夠是mysqld_safe啓動腳本的位置(會讀取[mysqld_safe]下的配置),mysqld和守護進程mysqld_safe都會啓動,以下能夠看到二者的運行信息this

ps -ef|grep 3309 root 27046     1  0 06:44 pts/3    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --server-id=1 --user=mysql --port=3309 --datadir=/data0/mysql/3309_test --socket=/tmp/mysql_3309.sock --innodb_data_home_dir=/data0/mysql/3309_test --innodb_log_group_home_dir=/data0/mysql/3309_test --transaction-isolation=READ-COMMITTED --explicit_defaults_for_timestamp=on --max_allowed_packet=100M --read_rnd_buffer_size=8M --tmp_table_size=128M --thread_cache_size=300 --max_connections=1000 --max_heap_table_size=128M --open-files-limit=10000 --max_connect_errors=999999999 --symbolic-links=0 --tmpdir=/data0/mysql/tmp --innodb_online_alter_log_max_size=1G --innodb_data_file_path=ibdata1:512M:autoextend --innodb_log_files_in_group=3 --innodb_buffer_pool_size=256M --innodb_log_file_size=100M --innodb_flush_log_at_trx_commit=1 --innodb_open_files=5000 --innodb_lock_wait_timeout=60 --log-error=log-error --slow_query_log_file=slow_query.log --slow_launch_time=2 --slow_query_log=1 --log-bin=mysql-bin --binlog_format=ROW --max_binlog_size=1G --expire_logs_days=15 --master-info-repository=TABLE --relay-log-info-repository=TABLE --gtid-mode=on --enforce-gtid-consistency=on --log-slave-updates=1 --relay-log=relay-log --sync-master-info=1 --skip-slave-start --slave_pending_jobs_size_max=104857600 --log_bin_trust_function_creators=1 --report-port=3309 --report-host=10.211.253.192 --slave-sql-verify-checksum=1 --master-verify-checksum=1 --slave_parallel_type=LOGICAL_CLOCK --slave-parallel-workers=4 --binlog_group_commit_sync_delay=100000 --skip-name-resolve --lower_case_table_names=1 --character-set-server=utf8 --sql_mode=NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --slave_preserve_commit_order=1 --default_password_lifetime=0 --binlog_rows_query_log_events=1 mysql 30032 27046  1 08:54 pts/3    00:03:32 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data0/mysql/3309_test --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --server-id=1 --innodb-data-home-dir=/data0/mysql/3309_test --innodb-log-group-home-dir=/data0/mysql/3309_test --transaction-isolation=READ-COMMITTED --explicit-defaults-for-timestamp=on --max-allowed-packet=100M --read-rnd-buffer-size=8M --tmp-table-size=128M --thread-cache-size=300 --max-connections=1000 --max-heap-table-size=128M --max-connect-errors=999999999 --symbolic-links=0 --tmpdir=/data0/mysql/tmp --innodb-online-alter-log-max-size=1G --innodb-data-file-path=ibdata1:512M:autoextend --innodb-log-files-in-group=3 --innodb-buffer-pool-size=256M --innodb-log-file-size=100M --innodb-flush-log-at-trx-commit=1 --innodb-open-files=5000 --innodb-lock-wait-timeout=60 --slow-query-log-file=slow_query.log --slow-launch-time=2 --slow-query-log=1 --log-bin=mysql-bin --binlog-format=ROW --max-binlog-size=1G --expire-logs-days=15 --master-info-repository=TABLE --relay-log-info-repository=TABLE --gtid-mode=on --enforce-gtid-consistency=on --log-slave-updates=1 --relay-log=relay-log --sync-master-info=1 --skip-slave-start --slave-pending-jobs-size-max=104857600 --log-bin-trust-function-creators=1 --report-port=3309 --report-host=10.211.253.192 --slave-sql-verify-checksum=1 --master-verify-checksum=1 --slave-parallel-type=LOGICAL_CLOCK --slave-parallel-workers=4 --binlog-group-commit-sync-delay=100000 --skip-name-resolve --lower-case-table-names=1 --character-set-server=utf8 --sql-mode=NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --slave-preserve-commit-order=1 --default-password-lifetime=0 --binlog-rows-query-log-events=1 --log-error=/data0/mysql/3309_test/log-error.err --open-files-limit=10000 --pid-file=/data0/mysql/3309_test/mysql-bcc03.dev.yz.pid --socket=/tmp/mysql_3309.sock --port=3309

 

若是pid-file在配置文件中沒有指定,則默認爲$datadir/`hostname`.pidurl

相關文章
相關標籤/搜索