Elasticsearch max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

2025. 2. 15. 00:22k8s/EFK

 

  • This setting controls the number of memory-mapped areas for a process.
  • Elasticsearch requires at least 262144 for performance.
  • If it is too low, Elasticsearch cannot allocate enough memory pages, causing crashes.

조치

initContainers:
- name: fix-permissions
	image: busybox
	command: ["sh", "-c", "sysctl -w vm.max_map_count=262144"]
	securityContext:
 		privileged: true
        
# 확인
kubectl logs -f {pod} -n {namespace} -c fix-permissions

kubectl exec -it {pod} -n {namespace} -- sysctl vm.max_map_count

pod에서 설정하는 경우, host server에 영향을 미침