1

Ok so to start, all the things I've tried so far:

Set vm.max_map_count in:

  1. The host in etc/sysctl.conf
  2. The host in /etc/sysctl.d/99-sysctl.conf
  3. The LXD Container in /etc/sysctl.conf
  4. The LXD container in /etc/sysctl.d/99-sysctl.conf

According to the official LXD production settings, this setting is possible with LXD: source: https://linuxcontainers.org/lxd/docs/master/production-setup

According to multiple resources online, this is the approved fix to remediate the error, because the default setting is 65530.

I've checked the host, it says this: cmd: sysctl vm.max_map_count output: vm.max_map_count = 262144

I've checked the lxd container, it says this: cmd: sysctl vm.max_map_count output: vm.max_map_count = 65530

I also verified the configuration file again in LXD container in /etc/sysctl.conf, and it shows the setting as: vm.max_map_count=262144

I've rebooted the container, I've stop and restarted the container, I've even built a new test container. All of them keep saying 65530. What can I do here to close this out?

Fallenour
  • 62
  • 1
  • 10

2 Answers2

0

So I figured out two ways to solve this problem:

  1. Apply the solution above, and then go through an incredibly lengthy and painful process of disabling Apparmor just to change the one setting, then reenable AppArmor again.

  2. Build Elasticsearch on another box, and bypass the entire process.

Took a quick 3 minute assessment, figured it wasn't worth the time + frustration to deal with all the apparmor pains, build it elsewhere.

But to answer the question in case anyone is willing to eat the time & pain to do it in lxd, disable apparmor, apply the vm.max_map_count setting, and then turn apparmor back on.

Fallenour
  • 62
  • 1
  • 10
0

As of 5-19-2022 I had good luck simply adding vm.max_map_count = 262144 in /etc/sysctl.conf on the host and rebooting the host.

Host is Ubuntu 22.04 as is the LXD container. The Elasticsearch process came up without an issue.

No having to mess with apparmor thankfully!

copeland3300
  • 581
  • 7
  • 11