MariaDB 10.0 / Docker / Vagrant – subprocess/ 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) 

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

经过几个小时的debugging,问题是由于缺乏内存。

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

 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