Ubuntu 16.04 上的 Percona mysql 服务器

Ubuntu 16.04 上的 Percona mysql 服务器

问题:无法安装 Percona mysql 服务器。

平台:Ubuntu 16.04 x64 Server 是一个 Openvz 容器。

内存:1.5GB

安装方法

apt-get install percona-xtradb-cluster-server-5.6

来源:

cat /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner

安装后显示错误。

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package percona-xtradb-cluster-server-5.6 (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for systemd (229-4ubuntu7) ...
Errors were encountered while processing:
percona-xtradb-cluster-server-5.6

从mysql日志中发现的错误

2016-08-05 19:12:42 9926 [Note] InnoDB: Memory barrier is not used
2016-08-05 19:12:42 9926 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-08-05 19:12:42 9926 [Note] InnoDB: Using Linux native AIO
2016-08-05 19:12:42 9926 [Note] InnoDB: Not using CPU crc32 instructions
2016-08-05 19:12:42 9926 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-05 19:12:42 7fa6fc84f740  InnoDB: Assertion failure in thread 140355177871168 in file ut0mem.cc line 10
InnoDB: Failing assertion: ret || !assert_on_error
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
13:42:42 UTC - mysqld got signal 6 ;

答案1

您的内存似乎不足,请启用交换文件或者调整 my.cnf 的值以适合你的内存大小。将每个内存值减半,或者使用类似下面的方法:

key_buffer = 16K
max_allowed_packet = 1M
sort_buffer_size = 32K
read_buffer_size = 128K
read_rnd_buffer_size = 128K
net_buffer_length = 2K
thread_stack = 64K
tmp-table-size  = 8M
max-heap-table-size = 8M
innodb-buffer-pool-size = 16M
key_buffer = 8M
sort_buffer_size = 8M

答案2

正如 Anubioz 所言,这是一个内存问题。我将突发内存增加到 2GB,然后重新安装了 percona-mysql。如前所述,这是一个 openvz 容器。以下是我对容器所做的更改。

vzctl set ctid --vmguarpages 1500M --save
vzctl set ctid --oomguarpages 1500M --save
vzctl set ctid --privvmpages 1500M:2048M --save

相关内容