MariaDB 10.2 mysql_install_db挂起

时间:2018-02-20 08:44:25

标签: mariadb

我在基于Alpine(https://github.com/wodby/mariadb)的docker容器中运行MariaDB(10.2.13),并且在运行/usr/bin/mysql_install_db时,初始启动会不时挂起。我第一次使用mysqld_install_cmd_line运行mysqld时发现它在函数--bootstrap中挂起。

任何想法可能是什么? MariaDB 10.2.11没有发生

+ mysql_install_db --datadir=/var/lib/mysql/ --rpm
+ basedir=
+ builddir=
+ ldata=/var/lib/mysql
+ langdir=
+ srcdir=
+ args=
+ defaults=
+ defaults_group_suffix=
+ mysqld_opt=
+ user=
+ silent_startup=--silent-startup
+ force=0
+ in_rpm=0
+ ip_only=0
+ cross_bootstrap=0
+ install_params=
+ auth_root_authentication_method=normal
+ auth_root_socket_user=root
+ parse_arguments --datadir=/var/lib/mysql/ --rpm
+ pick_args=
+ test --datadir=/var/lib/mysql/ = PICK-ARGS-FROM-ARGV
+ parse_arg --datadir=/var/lib/mysql/
+ echo --datadir=/var/lib/mysql/
+ sed -e s/^[^=]*=//
+ ldata=/var/lib/mysql/
+ in_rpm=1
+ test -n
+ test -n
+ test -n
+ print_defaults=/usr/bin/my_print_defaults
+ test ! -x /usr/bin/my_print_defaults
+ /usr/bin/my_print_defaults --mysqld mysql_install_db
+ parse_arguments --user=mysql --bind-address=0.0.0.0 --basedir=/usr --datadir=/var/lib/mysql --socket=/var/run/mysqld/mysqld.sock --log-warnings --collation-server=utf8_unicode_ci --init_connect=SET NAMES utf8 --character_set_server=utf8 --character_set_filesystem=utf8 --symbolic-links=0 --default_storage_engine=InnoDB --skip-character-set-client-handshake --skip-name-resolve --back_log=100 --join_buffer_size=8M --max_heap_table_size=16M --query_cache_limit=1M --query_cache_min_res_unit=4K --query_cache_size=128M --query_cache_type=ON --sort_buffer_size=2M --table_definition_cache=400 --table_open_cache=4096 --thread_cache_size=75 --tmp_table_size=16M --max_allowed_packet=256M --max_connect_errors=100000 --max_connections=100 --innodb_buffer_pool_instances=4 --innodb_buffer_pool_size=1G --innodb_data_file_path=ibdata1:10M:autoextend:max:10G --innodb_file_per_table=1 --innodb_flush_method=O_DIRECT --innodb_flush_log_at_trx_commit=2 --innodb_io_capacity=200 --innodb_lock_wait_timeout=50 --innodb_log_buffer_size=8M --innodb_log_file_size=128M --innodb_log_files_in_group=2 --innodb_old_blocks_time=1000 --innodb_open_files=1024 --innodb_read_io_threads=4 --innodb_stats_on_metadata=OFF --innodb_strict_mode=OFF --innodb_write_io_threads=4 --innodb_force_load_corrupted=0 --innodb_fast_shutdown=1 --performance_schema=OFF --long_query_time=2 --slow_query_log=OFF --general_log=0 --net_write_timeout=90 --net_read_timeout=90 --wait_timeout=420 --interactive_timeout=420 --relay_log_recovery=0
+ pick_args=
+ test --user=mysql = PICK-ARGS-FROM-ARGV
+ parse_arg --user=mysql
+ echo --user=mysql
+ sed -e s/^[^=]*=//
+ user=mysql
+ test -n
+ parse_arg --basedir=/usr
+ echo --basedir=/usr
+ sed -e s/^[^=]*=//
+ basedir=/usr
+ parse_arg --datadir=/var/lib/mysql
+ echo --datadir=/var/lib/mysql
+ sed -e s/^[^=]*=//
+ ldata=/var/lib/mysql
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ ip_only=1
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ test -n
+ parse_arguments PICK-ARGS-FROM-ARGV --datadir=/var/lib/mysql/ --rpm
+ pick_args=
+ test PICK-ARGS-FROM-ARGV = PICK-ARGS-FROM-ARGV
+ pick_args=1
+ shift
+ parse_arg --datadir=/var/lib/mysql/
+ echo --datadir=/var/lib/mysql/
+ sed -e s/^[^=]*=//
+ ldata=/var/lib/mysql/
+ in_rpm=1
+ test -n
+ test -n /usr
+ bindir=/usr/bin
+ find_in_dirs resolveip /usr/bin /usr/bin
+ file=resolveip
+ shift
+ test -f /usr/bin/resolveip
+ test -n
+ echo /usr/bin/resolveip
+ break
+ resolveip=/usr/bin/resolveip
+ test -z /usr/bin/resolveip
+ find_in_dirs mysqld /usr/bin /usr/libexec /usr/sbin /usr/bin
+ file=mysqld
+ shift
+ test -f /usr/bin/mysqld
+ test -n
+ echo /usr/bin/mysqld
+ break
+ mysqld=/usr/bin/mysqld
+ test -z /usr/bin/mysqld
+ find_in_dirs --dir errmsg.sys /usr/share/mysql/english /usr/share/english /usr/share/mysql/english
+ return_dir=1
+ shift
+ file=errmsg.sys
+ shift
+ test -f /usr/share/mysql/english/errmsg.sys
+ test -n 1
+ echo /usr/share/mysql/english
+ break
+ langdir=/usr/share/mysql/english
+ test -z /usr/share/mysql/english
+ find_in_dirs --dir fill_help_tables.sql /usr/share/mysql /usr/share /usr/share/mysql
+ return_dir=1
+ shift
+ file=fill_help_tables.sql
+ shift
+ test -f /usr/share/mysql/fill_help_tables.sql
+ test -n 1
+ echo /usr/share/mysql
+ break
+ srcpkgdatadir=/usr/share/mysql
+ buildpkgdatadir=/usr/share/mysql
+ test -z /usr/share/mysql
+ fill_help_tables=/usr/share/mysql/fill_help_tables.sql
+ create_system_tables=/usr/share/mysql/mysql_system_tables.sql
+ create_system_tables2=/usr/share/mysql/mysql_performance_tables.sql
+ fill_system_tables=/usr/share/mysql/mysql_system_tables_data.sql
+ maria_add_gis_sp=/usr/share/mysql/maria_add_gis_sp_bootstrap.sql
+ test ! -f /usr/share/mysql/fill_help_tables.sql
+ test ! -f /usr/share/mysql/mysql_system_tables.sql
+ test ! -f /usr/share/mysql/mysql_performance_tables.sql
+ test ! -f /usr/share/mysql/mysql_system_tables_data.sql
+ test ! -f /usr/share/mysql/maria_add_gis_sp_bootstrap.sql
+ test ! -x /usr/bin/mysqld
+ test -n /usr/share/mysql/english
+ test ! -f /usr/share/mysql/english/errmsg.sys
+ mysqld_opt=--lc-messages-dir=/usr/share/mysql/english/..
+ hostname
+ hostname=mariadb-4070839347-8qx3q
+ test 0 -eq 0 -a 1 -eq 0 -a 0 -eq 0
+ test 1 -eq 1
+ echo
+ awk / /{print $6}
+ hostname=
+ test ! -d /var/lib/mysql/
+ test -n mysql
+ chown mysql /var/lib/mysql/
+ test 0 -ne 0
+ test ! -d /var/lib/mysql//mysql
+ mkdir -p /var/lib/mysql//mysql
+
+ chmod 700 /var/lib/mysql//mysql
+ test -n mysql
+ chown mysql /var/lib/mysql//mysql
+ test 0 -ne 0
+ test ! -d /var/lib/mysql//test
+ mkdir -p /var/lib/mysql//test
+
+ chmod 700 /var/lib/mysql//test
+ test -n mysql
+ chown mysql /var/lib/mysql//test
+ test 0 -ne 0
+ test -n mysql
+ args= --user=mysql
+ test 0 -eq 1
+ filter_cmd_line=cat
+ mysqld_bootstrap=/usr/bin/mysqld
+ s_echo Installing MariaDB/MySQL system tables in '/var/lib/mysql/' ...
+ test 1 -eq 0 -a 0 -eq 0
+ install_params=
SET @skip_auth_root_nopasswd=NULL;
SET @auth_root_socket=NULL;
+ echo use mysql;
SET @skip_auth_root_nopasswd=NULL;
SET @auth_root_socket=NULL;
+ cat /usr/share/mysql/mysql_system_tables.sql /usr/share/mysql/mysql_performance_tables.sql /usr/share/mysql/mysql_system_tables_data.sql /usr/share/mysql/fill_help_tables.sql /usr/share/mysql/maria_add_gis_sp_bootstrap.sql
+ mysqld_install_cmd_line
+ /usr/bin/mysqld --lc-messages-dir=/usr/share/mysql/english/.. --bootstrap --basedir=/usr --datadir=/var/lib/mysql/ --enforce-storage-engine= --user=mysql --max_allowed_packet=8M --net_buffer_length=16K
+ eval cat
+ cat
2018-02-20  8:25:22 140043505183624 [Note] /usr/bin/mysqld (mysqld 10.2.13-MariaDB) starting as process 59 ...
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Uses event mutexes
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Compressed tables use zlib 1.2.11
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Using Linux native AIO
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Number of pools: 1
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Using SSE2 crc32 instructions
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 4, chunk size = 128M
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Completed initialization of buffer pool
2018-02-20  8:25:22 140042030324456 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Setting file './ibdata1' size to 10 MB. Physically writing the file full; Please wait ...
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: File './ibdata1' size is now 10 MB.
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Setting log file ./ib_logfile101 size to 134217728 bytes
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Setting log file ./ib_logfile1 size to 134217728 bytes
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: New log files created, LSN=45790
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Doublewrite buffer not found: creating new
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Doublewrite buffer created
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: 128 out of 128 rollback segments are active.
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Creating foreign key constraint system tables.
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Creating tablespace and datafile system tables.
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Creating sys_virtual system tables.
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: Waiting for purge to start
2018-02-20  8:25:22 140043505183624 [Note] InnoDB: 5.7.21 started; log sequence number 0
2018-02-20  8:25:22 140043505183624 [Note] Plugin 'FEEDBACK' is disabled.

更新:

我使用CMAKE_BUILD_TYPE=Debug模式编译MariaDB但无法重现此错误,尝试{@ 1}}正如@elenst所建议的那样,这就是我得到的:

RelWithDebInfo

所有其他流程的strace显示# ps aux PID USER TIME COMMAND 1 mysql 0:00 bash /docker-entrypoint.sh mysqld 13 mysql 0:00 {init_mariadb} /bin/bash /usr/local/bin/init_mariadb mysqld 25 mysql 0:00 {mysql_install_d} /bin/sh /usr/bin/mysql_install_db --datadir=/var/lib/mysql/ --rpm 59 mysql 0:00 {mysql_install_d} /bin/sh /usr/bin/mysql_install_db --datadir=/var/lib/mysql/ --rpm 61 mysql 0:00 /usr/bin/mysqld --lc-messages-dir=/usr/share/mysql/english/.. --bootstrap --basedir=/usr --datadir=/var/lib/mysql/ --debug --enforce-storage-engine= --user 159 root 0:00 sh 167 root 0:00 ps aux # strace -p 61 strace: Process 61 attached restart_syscall(<... resuming interrupted nanosleep ...>) = 0 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0 ...

更新2:

wait4(-1,

0 个答案:

没有答案