sysctl: error setting key 'vm.max_map_count': Read-only file system

See original GitHub issue

When I try to start elasticsearch-kibana only kibana pod is running and elasticsearch goes in Init Crash Loop Back-off.

I read the pod logs kubectl logs elasticsearch-7fc6f9b9bb-8ffgg --all-containers=true and this is the content sysctl: error setting key 'vm.max_map_count': Read-only file system Error from server (BadRequest): container "elasticsearch" in pod "elasticsearch-7fc6f9b9bb-8ffgg" is waiting to start: PodInitializing Any idea? thx

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
sp1d3rinocommented, Apr 7, 2020

I solved.

  1. from the host I ran sudo sysctl -w vm.max_map_count=262144

  2. from the elk yaml I removed this line decommand: ['sysctl', '-w', 'vm.max_map_count=262144'] and I put privileged: false

deleted the elasticsearch deployment and applied one more time.

2reactions
hzhao-githubcommented, Apr 6, 2020

Hi sp1d3rino,

Can you please try to add the block below to your elk yaml file?

   spec:
  initContainers:
  - name: set-vm-max-map-count
    image: busybox
    imagePullPolicy: IfNotPresent
    command: ['sysctl', '-w', 'vm.max_map_count=262144']
    securityContext:
      privileged: true
  containers:
  - name: "elasticsearch"
  .....
Read more comments on GitHub >

github_iconTop Results From Across the Web

setting key "vm.max_map_count": Read-only file system
I fixed that issue by doing the sysctl write on the host node where proxmox is running. The running lxc container received the...
Read more >
setting key “vm.max_map_count”: | by Amin Vakil | Medium
For anyone facing issue “Server:sysctl: setting key “vm.max_map_count”: Read-only file system” upon running elastic docker you should either ...
Read more >
sysctl: setting key "vm.max_map_count": read-only file system ...
You probably need to set vm.max_map_count in /etc/sysctl.conf on the host itself, so that Elasticsearch does not attempt to do that from inside...
Read more >
Docker - ELK - vm.max_map_count - Stack Overflow
Temporary set max_map_count: sudo sysctl -w vm.max_map_count=262144 but this will only last till you restart your system. Permament.
Read more >
Unable to change vm.max_map_count for elasticsearch
you are almost there, It does not matter if is a virtual machine or a physical machine, those settings are always changeable.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found