Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of warning that JVM memory cannot be locked when elasticsearch starts

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article Xiaobian for you to introduce in detail "elasticsearch startup warning can not lock JVM memory how to solve", detailed content, clear steps, details handled properly, I hope that this "elasticsearch startup warning can not lock JVM memory how to solve" article can help you solve doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.

Elasticsearch start warning

Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out. Increase RLIMIT_MEMLOCK (ulimit).

Limit of memory lock values (max locked memory)

This value works only for ordinary users, not for superusers. This problem is caused by CAP_IPC_LOCK. Linux manages memory by paging, which means that when not needed, the data in physical memory will be swapped to swap or disk. If necessary, it will be swapped to physical memory, and locking data to physical memory can avoid data swapping in / out. There are two reasons for using locking memory: 1) due to programming needs, such as oracle, data needs to be locked into physical memory. 2) mainly security needs, such as user names and passwords, etc., are exchanged to swap or disk, there is the possibility of leakage, so it has been locked to physical memory.

View project process restrictions. 17497 is pid.

Cat / proc/17497/limits

View system restrictions 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 (512bytes,-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

Add 2 lines to vim / etc/security/limits.conf, set to a higher value or unlimited

Soft memlock unlimited

Hard memlock unlimited

Others can use ulimit to add custom restrictions (many options are not enabled by default), and you can restrict some different users

#-core-limits the core filesize (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 reads here This "elasticsearch startup warning can not lock JVM memory how to solve" article has been introduced, want to master the knowledge of this article still need to practice and use to understand, if you want to know more about the article, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report