elasticsearch啟動警告
Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out. Increase RLIMIT_MEMLOCK (ulimit).
內(nèi)存鎖定值的限制(max locked memory)
這個值只對普通用戶起作用,對超級用戶不起作用,這個問題是由于CAP_IPC_LOCK造成的.linux對內(nèi)存是分頁管理的,這意味著有不需要時,在物理內(nèi)存的數(shù)據(jù)會被換到交換區(qū)或磁盤上.有需要時會被交換到物理內(nèi)存,而將數(shù)據(jù)鎖定到物理內(nèi)存可以避免數(shù)據(jù)的換入/換出.采用鎖定內(nèi)存有兩個理由:1)由于程序設(shè)計上需要,比如oracle等軟件,就需要將數(shù)據(jù)鎖定到物理內(nèi)存.2)主要是安全上的需要,比如用戶名和密碼等等,被交換到swap或磁盤,有泄密的可能,所以一直將其鎖定到物理內(nèi)存.
查看項目進(jìn)程限制,17497為pid
cat /proc/17497/limits
查看系統(tǒng)限制ulimit -a
core file size (blocks, -c) unlimiteddata seg size (kbytes, -d) unlimitedscheduling priority (-e) 0file size (blocks, -f) unlimitedpending signals (-i) 1032980max locked memory (kbytes, -l) 64max memory size (kbytes, -m) unlimitedopen files (-n) 600000pipe size (512 bytes, -p) 8POSIX message queues (bytes, -q) 819200real-time priority (-r) 0stack size (kbytes, -s) unlimitedcpu time (seconds, -t) unlimitedmax user processes (-u) 600000virtual memory (kbytes, -v) unlimitedfile locks (-x) unlimited
vim /etc/security/limits.conf增加2行,設(shè)為更大的值或者unlimited
其他可以使用ulimit添加自定義的限制(很多選項系統(tǒng)默認(rèn)未開啟),可以對一些不同用戶進(jìn)行限制
## - core - limits the core file size (KB)# - data - max data size (KB)# - fsize - maximum filesize (KB)# - memlock - max locked-in-memory address space (KB)# - nofile - max number of open files# - rss - max resident set size (KB)# - stack - max stack size (KB)# - cpu - max CPU time (MIN)# - nproc - max number of processes# - as - address space limit (KB)# - maxlogins - max number of logins for this user# - maxsyslogins - max number of logins on the system# - priority - the priority to run user process with# - locks - max number of file locks the user can hold# - sigpending - max number of pending signals# - msgqueue - max memory used by POSIX message queues (bytes)# - nice - max nice priority allowed to raise to values: [-20, 19]# - rtprio - max realtime priority
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,謝謝大家對VeVb武林網(wǎng)的支持。
新聞熱點
疑難解答
圖片精選