【发布时间】:2015-05-28 22:08:32
【问题描述】:
我在 digitalocean (1G RAM) 上有 VPS (Ubuntu 14.04),并且我安装了 VestaCP。每次我重新启动服务器时,mysql 都会因为内存不足(它缓冲超过 1G)而崩溃,尽管我为我的 RAM(我的 /etc/mysql/my.cnf)配置了:
[client]
port=3306
socket=/var/run/mysqld/mysqld.sock
[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock
[mysqld]
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
tmpdir=/tmp
lc-messages-dir=/usr/share/mysql
log_error=/var/log/mysql/error.log
max_user_connections=30
wait_timeout=30
interactive_timeout=50
long_query_time=5
innodb_file_per_table
#fibhost 1G RAM
key_buffer_size = 8M
query_cache_size = 0M
tmp_table_size = 64M
innodb_buffer_pool_size = 128M
innodb_additional_mem_pool_size = 8M
innodb_log_buffer_size = 8M
max_connections = 150
sort_buffer_size = 4M
read_buffer_size = 128k
read_rnd_buffer_size = 256k
join_buffer_size = 128M
thread_stack = 256k
binlog_cache_size = 32k
!includedir /etc/mysql/conf.d/
当我 sudo service mysql 重新启动时,它会正常工作并缓冲 550M 直到下次重新启动 shutdown -r +5 或 reboot
/var/log/mysql/error.log:
150529 0:36:43 InnoDB: Could not open or create data files.
150529 0:36:43 InnoDB: If you tried to add new data files, and it failed here,
150529 0:36:43 InnoDB: you should now edit innodb_data_file_path in my.cnf back
150529 0:36:43 InnoDB: to what it was, and remove the new ibdata files InnoDB created
150529 0:36:43 InnoDB: in this failed attempt. InnoDB only wrote those files full of
150529 0:36:43 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
150529 0:36:43 InnoDB: remove old data files which contain your precious data!
150529 0:36:43 [ERROR] Plugin 'InnoDB' init function returned error.
150529 0:36:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150529 0:36:43 [ERROR] Unknown/unsupported storage engine: InnoDB
150529 0:36:43 [ERROR] Aborting
150529 0:36:43 [Note] /usr/sbin/mysqld: Shutdown complete
150529 00:36:43 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
【问题讨论】:
-
仅供参考,您想要的词是“crash”,而不是“crush”。
-
重启机器后如何配置mysql运行?是root吗?
-
以及如何配置从root启动mysql?
-
我的vestacp面板也有这个问题,可能来自vesta,我有其他服务器不包含vestacp,mysql很棒