Elasticsearch uses a mmapfs directory by default to store its indices. The TKGi cluster nodes OS limits on mmap counts is lower than the expected, which may result in out of memory exceptions.
The same can happen with external 3rd party applications, for example a Java application that can complain with the following error:
max virtual memory areas vm.max_map_count [xxxxx] is too low, increase to at least [xxxxx]
TKGi v1.1x
The following steps can be followed to update the kernel parameters in TKGi Cluster nodes.
1. Download os-conf release version 22.1.3
https://bosh.io/releases/github.com/cloudfoundry/os-conf-release?all=1
2. Upload the release via bosh command.
bosh upload-release os-conf-release-22.1.3.tgz
3. Create a file called runtime.yml and add the following details.
releases:
- name: "os-conf"
version: "22.1.3"
addons:
- name: os-configuration
jobs:
- name: sysctl
release: os-conf
properties:
sysctl:
- vm.max_map_count=262144
include:
deployments: [service-instance_XXXXXXXXXX] # you can define which deployments would be applied this runtime config.
exclude:
deployments: [service-instance_XXXXXXXXXX] # you can define which deployments would not be applied this runtime config.
4. Update runtime config
bosh update-runtime-config runtime.yml
5. Upgrade related clusters via
tkgi upgrade-cluster <CLUSTER_NAME>