溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

elasticsearch啟動(dòng)時(shí)警告無法鎖定JVM內(nèi)存如何解決

發(fā)布時(shí)間:2021-06-11 15:30:40 來源:億速云 閱讀:211 作者:Leah 欄目:編程語言

今天就跟大家聊聊有關(guān)elasticsearch啟動(dòng)時(shí)警告無法鎖定JVM內(nèi)存如何解決,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

elasticsearch啟動(dòng)警告

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)

這個(gè)值只對(duì)普通用戶起作用,對(duì)超級(jí)用戶不起作用,這個(gè)問題是由于CAP_IPC_LOCK造成的.linux對(duì)內(nèi)存是分頁管理的,這意味著有不需要時(shí),在物理內(nèi)存的數(shù)據(jù)會(huì)被換到交換區(qū)或磁盤上.有需要時(shí)會(huì)被交換到物理內(nèi)存,而將數(shù)據(jù)鎖定到物理內(nèi)存可以避免數(shù)據(jù)的換入/換出.采用鎖定內(nèi)存有兩個(gè)理由:1)由于程序設(shè)計(jì)上需要,比如oracle等軟件,就需要將數(shù)據(jù)鎖定到物理內(nèi)存.2)主要是安全上的需要,比如用戶名和密碼等等,被交換到swap或磁盤,有泄密的可能,所以一直將其鎖定到物理內(nèi)存.

查看項(xiàng)目進(jìn)程限制,17497為pid

cat /proc/17497/limits

查看系統(tǒng)限制ulimit -a

core file size     (blocks, -c) unlimited
data seg size      (kbytes, -d) unlimited
scheduling priority       (-e) 0
file size        (blocks, -f) unlimited
pending signals         (-i) 1032980
max locked memory    (kbytes, -l) 64
max memory size     (kbytes, -m) unlimited
open files           (-n) 600000
pipe size      (512 bytes, -p) 8
POSIX message queues   (bytes, -q) 819200
real-time priority       (-r) 0
stack size       (kbytes, -s) unlimited
cpu time        (seconds, -t) unlimited
max user processes       (-u) 600000
virtual memory     (kbytes, -v) unlimited
file locks           (-x) unlimited

vim /etc/security/limits.conf增加2行,設(shè)為更大的值或者unlimited

  •       soft   memlock      unlimited

  •       hard   memlock      unlimited

其他可以使用ulimit添加自定義的限制(很多選項(xiàng)系統(tǒng)默認(rèn)未開啟),可以對(duì)一些不同用戶進(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

看完上述內(nèi)容,你們對(duì)elasticsearch啟動(dòng)時(shí)警告無法鎖定JVM內(nèi)存如何解決有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注億速云行業(yè)資訊頻道,感謝大家的支持。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI