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

Hi Team,

Trying to configure elastic search via helm chart.
Please find the below are steps.

helm create ele

cat values.yaml

imageELE:
repository: X.X.X.X:8085/elasticsearch
pullPolicy: IfNotPresent

Overrides the image tag whose default is the chart appVersion.

tag: "7.8.0"

serviceELE:
type: NodePort
port: 9200
serviceELE1:
type: NodePort
port: 9300

cat deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: ele
labels:
app: ele
spec:
selector:
matchLabels:
app: ele
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: ele
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "ele.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:

  • name: {{ .Chart.Name }}
    securityContext:
    {{- toYaml .Values.securityContext | nindent 12 }}
    image: "{{ .Values.imageELE.repository }}:{{ .Values.imageELE.tag | default .Chart.AppVersion }}"
    imagePullPolicy: {{ .Values.imageELE.pullPolicy }}
    ports:
    - name: http
    containerPort: 9200
    containerPort: 9300
    protocol: TCP

service.yaml

apiVersion: v1
kind: Service
metadata:
name: ele
labels:
app: ele
spec:
#type: NodePort
type: {{ .Values.serviceELE.type }}
ports:
- port: {{ .Values.serviceELE.port }}
targetPort: 9200
nodePort: 32440
protocol: TCP
name: ele
- port: {{ .Values.serviceELE1.port }}
targetPort: 9300
nodePort: 32441
protocol: TCP
name: ele1
selector:
app: ele

helm install ele .

NAME: ele
LAST DEPLOYED: Tue Nov 3 12:04:20 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:

  1. Get the application URL by running these commands:
    export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=ele,app.kubernetes.io/instance=ele" -o jsonpath="{.items[0].metadata.name}")
    echo "Visit http://127.0.0.1:8080 to use your application"
    kubectl --namespace default port-forward $POD_NAME 8080:80

kubectl logs pod/ele-7c5dc88b4d-mbngq

{"type": "server", "timestamp": "2020-11-03T12:05:20,172Z", "level": "INFO", "component": "o.e.t.TransportService", "cluster.name": "docker-cluster", "node.name": "ele-7c5dc88b4d-mbngq", "message": "publish_address {10.100.40.80:9300}, bound_addresses {0.0.0.0:9300}" }
{"type": "server", "timestamp": "2020-11-03T12:05:20,462Z", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "docker-cluster", "node.name": "ele-7c5dc88b4d-mbngq", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log
{"type": "server", "timestamp": "2020-11-03T12:05:20,473Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ele-7c5dc88b4d-mbngq", "message": "stopping ..." }
{"type": "server", "timestamp": "2020-11-03T12:05:20,485Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ele-7c5dc88b4d-mbngq", "message": "stopped" }
{"type": "server", "timestamp": "2020-11-03T12:05:20,486Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ele-7c5dc88b4d-mbngq", "message": "closing ..." }
{"type": "server", "timestamp": "2020-11-03T12:05:20,498Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ele-7c5dc88b4d-mbngq", "message": "closed" }
{"type": "server", "timestamp": "2020-11-03T12:05:20,500Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "ele-7c5dc88b4d-mbngq", "message": "Native controller process has stopped - no new native processes can be started" }

I have increased the vm.max_map_count
sysctl -w vm.max_map_count=262144

Still getting same error "Elasticsearch: Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]"

I was able to configure elastic search on docker and kubernet.....
Using same image and ending up with error.

Please do the needful.

Thanks
Sanjeev Kumar N

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.