无法在centos7上的mariadb 10中增加打开文件限制 [英] cannot increase open-files-limit in mariadb 10 on centos7
问题描述
我搜索了有关主题主题和经过测试的选项,但是我仍然无法提高用作cpanel/whm服务器的远程数据库服务器的mariadb服务器上的open-files-limit.这是很好的参考 http://duntuk.com/how-raise-ulimit-open-files-and-mysql-openfileslimit
I searched about the topic subject and tested options, but I still cant increase the open-files-limit on my mariadb server that is used as remote database server for cpanel/whm server. here is s good reference http://duntuk.com/how-raise-ulimit-open-files-and-mysql-openfileslimit
我在
/etc/my.cnf
open-files-limit=65550
这是一些结果
#ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63471
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
最大用户进程(-u)65535虚拟内存(千字节,-v)无限文件锁(-x)无限
max user processes (-u) 65535 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
#ulimit -Hn -Sn
open files (-n) 65535
open files (-n) 65535
cat /etc/systemd/system/mariadb.service.d/limits.conf
[Service]
LimitNOFILE=65500
cat /usr/lib/systemd/system/mariadb.service
[Unit]
Description=MariaDB database server
After=syslog.target
After=network.target
[Service]
Type=simple
User=mysql
Group=mysql
LimitNOFILE=infinity
LimitMEMLOCK=infinity
仍然在mysql中我得到
and still in mysql I get
显示诸如"open%"之类的全局变量;
show global variables like 'open%';
+ ------------------ + ------- +
+------------------+-------+
|变量名|值|
+ ------------------ + ------- +
+------------------+-------+
|open_files_limit |1024 |
| open_files_limit | 1024 |
+ ------------------ + ------- +
+------------------+-------+
组1行(0.00秒)
重启后即时通讯反复出现错误
and im getting following error over and over after restart
60108 16:30:02 [ERROR] mysqld: Can't open file: './username_wp/wp_users.frm' (errno: 24)
160108 16:30:02 [ERROR] Error in accept: Too many open files
160108 16:30:04 [ERROR] Error in accept: Too many open files
160108 16:30:06 [ERROR] Error in accept: Too many open files
160108 16:30:11 [ERROR] mysqld: Can't open file: './username_db/strikes.frm' (errno: 24)
这是mariadb的启动日志
and here is the startup log of mariadb
[Warning] Could not increase number of max_open_files to more than 1024 (request: 132107)
推荐答案
最后,我找到了解决方法,但没有任何合理的原因!我正在运行MariaDB 5.5,并且所有设置都可以,但软限制未超过1024!我以为我的mariadb是10.0,因为我刚安装了它
finally i find solution but without any reasonable cause ! i was running MariaDB 5.5 and all settings where fine but the soft limit did not goes more than 1024 ! i was thinking my mariadb is 10.0 as i freshly installed it
在我发现它是5.5之后,我试图将其升级到v10.0!然后是BOOM!解决了问题,无需任何额外的操作或设置(内核设置允许最大文件限制,如参考链接所述)
after i find out that its 5.5 i tried to upgrade it to v10.0 ! and then BOOM ! problem solved without any extra action or setting ( kernel setting allows maximum files limit as described in reference link )
我希望它可以帮助其他人遇到同样的问题(但请尝试所有其他必需的设置之后)
i hope it help other peoples have same problem ( but after try all other required settings )
这篇关于无法在centos7上的mariadb 10中增加打开文件限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!