MariaDB [Warning] Could not increase number of max_open_files to more than 1024
啟動mariadb,查看mariadb狀態信息時:
systemctl start mariadb
systemctl -l status mariadb
1
2
報錯
在這里插入圖片描述
[Warning] Could not increase number of max_open_files to more than 1024 (request: 8131)
[Warning] Changed limits: max_open_files: 1024 max_connections: 594 (was 4096) table_cache: 200 (was 2000)
出現警告信息:提示最大打開文件數不能超過1024,但依然能夠啟動mariaDB。
解決方法
cat /usr/lib/systemd/system/mariadb.service 查看信息
14 # For example, if you want to increase mysql’s open-files-limit to 10000,
15 # you need to increase systemd’s LimitNOFILE setting, so create a file named
16 # “/etc/systemd/system/mariadb.service.d/limits.conf” containing:
17 # [Service]
18 # LimitNOFILE=10000
1
2
3
4
5
根據前面的信息
mkdir /etc/systemd/system/mariadb.service.d
vim /etc/systemd/system/mariadb.service.d/limits.conf ’ //添加 ’
[Service]
LimitNOFILE=10000 ’ //根據前面的warning信息,數值只需要大于8131即可,還可以改為infinity ’
1
2
3
4
修改完之后,重新加載配置
systemctl --system-daemon-reload
1
已解決
如圖:
在這里插入圖片描述
拓展
ulimit -n 查看當前進程的max_open_files
cat /proc/sys/fs/file-max 查看系統最大文件數
/etc/security/limits.conf是一個很重要的文件
總結
以上是生活随笔為你收集整理的MariaDB [Warning] Could not increase number of max_open_files to more than 1024的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: copy_{to, from}_user
- 下一篇: aproxy配合Nginx搭建Web集群