MariaDB 10.0 / Docker / Vagrant - 子进程 /usr/bin/dpkg 返回错误代码

MariaDB 10.0 / Docker / Vagrant - 子进程 /usr/bin/dpkg 返回错误代码

使用 Vagrant、Docker 和其他虚拟化服务时,MariaDB 10.0 无法正确安装。

$ DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-galera-server
Setting up mariadb-galera-server-10.0 (10.0.14+maria-1~trusty) ...
invoke-rc.d: policy-rc.d denied execution of stop.
dpkg: error processing package mariadb-galera-server-10.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-galera-server:
 mariadb-galera-server depends on mariadb-galera-server-10.0 (= 10.0.14+maria-1~trusty); however:
  Package mariadb-galera-server-10.0 is not configured yet.

dpkg: error processing package mariadb-galera-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 mariadb-galera-server-10.0
 mariadb-galera-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

tldr;与 Docker 和其他工具结合使用时,MariaDB 10.0 安装所需的最低 RAM 为 1GB。

经过几个小时的调试,问题是由于 RAM 不足造成的。

这是通过在“/var/lib/dpkg/info/mariadb-galera-server-10.0.postinst”顶部添加“set -x”找到的,然后重新运行 apt-get install -f。然后我找到了“set -x”输出中最后显示的命令,并从行尾删除了“2>&1 | $ERR_LOGGER”。产生的调试输出是;

141104 22:48:23 [Note] InnoDB: Initializing buffer pool, size = 256.0M
InnoDB: mmap(274726912 bytes) failed; errno 12
141104 22:48:23 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
141104 22:48:23 [ERROR] Aborting

相关内容