1. 程式人生 > 其它 >[Warning] Could not increase number of max_open_files to more than 1024(request:5035)

[Warning] Could not increase number of max_open_files to more than 1024(request:5035)

技術標籤:錯誤集mariadb

報錯現象

[Warning] Could not increase number of max_open_files to more than 1024 (request: 5035)
[Warning] Changed limits: max_open_files: 1024 max_connections: 594 (was 4096) table_cache: 200 (was 2000)

注:出現警告資訊:提示最大開啟檔案數不能超過1024,但依然能夠啟動mariaDB。

解決方法

vim /etc/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 '//根據前面的warning資訊,數值只需要大於上面提示的5035即可,還可以改為infinity '

驗證

注:修改完之後,重新載入配置

systemctl daemon-reload
systemctl   restart  mariadb
systemctl   status   mariadb