背景:
Elasticsearch啟動報錯:
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
解決方案:
一、臨時修改:
vim /etc/profile
添加 ulimit -SHn 1048576
然后用普通用戶執(zhí)行 source /etc/profile
二、永久修改:
vim /etc/sysctl.conf
添加:fs.file-max = 1048576
執(zhí)行 sysctl -p
vim /etc/security/limits.conf
添加:
* hard nofile 1048576
* soft nofile 1048576
root hard nofile 1048576
root soft nofile 1048576
再執(zhí)行:
sed -i '/DefaultLimitNOFILE/c DefaultLimitNOFILE=1048576' /etc/systemd/*.conf
systemctl daemon-reexec
然后注銷退出重新登錄(注銷如果不生效就重啟一下)
驗證:ulimit -Hn
浙公網(wǎng)安備 33010602011771號