Installation settings
elasticsearch
1) Elasticsearch service can not be run as root:
“org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root”
Rather than having to install sudo and add “elasticsearch” username to sudoers and change some other permissions on config files to avoid permission related issues, it is best to comment/remove the user change on the Dockerfile “USER elasticsearch” and only run elasticsearch service with the “elasticsearch” user through docker-compose command parameter:
command: >
su elasticsearch -c “/usr/share/elasticsearch/bin/elasticsearch -Epath.conf=/usr/share/elasticsearch/config”
2) To avoid the following bootstrap error: max virtual memory areas vm.max_map_count 65530 likely too low, increase to at least 262144
The suggestion is to run “sysctl -w vm.max_map_count=262144” on the host running the image
3) To avoid the following bootstrap error: unable to install syscall filter: java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
The suggestion is to disable bootstrap.system_call_filter in the elasticsearch.yml config file as some kernels do not support seccomp:
bootstrap.system_call_filter: false
As described here: “This is operating as designed, and is documented. Your kernel does not support seccomp. Elasticsearch attempts to utilize seccomp by default (via the setting bootstrap.system_call_filter
). Starting in 5.2.0, if you’re in production mode, bootstrap.system_call_filter
is enabled, and initializing seccomp fails, then Elasticsearch will refuse to bootstrap. This to prevent scenarios when seccomp is silently not initialized yet configured to be so. You either have to migrate to a kernel that supports seccomp, or disable bootstrap.system_call_filter
.”
4) Elasticsearch no longer accepts multicast discovery:
discovery.zen.ping.multicast.enabled: false
Line needs to be removed altogether from the elasticsearch.yml config file.
Multicast was only available as a plugin from 2.0 onwards, and that plugin was removed in 5.0, so the setting no longer applies