The issue is, there is no Elasticsearch keystore created to store the password that i am setting explicitly. Instead it is ignoring the password that I am providing and creating a randomized password similar to what it creates when we run with just xpack.security.enabled=true.
But when i am running with the official ES images it does create the Elasticsearch keystore as expected like this:-
Created elasticsearch keystore in /usr/share/elasticsearch/config/elasticsearch.keystore
I am doing nothing but just running the ES entrypoint from within a shell script and that's it.
All other env variables are working fine but the elasticsearch keystore is not working.
Could someone please help me here to understand the problem or What I am doing wrong?
thanks for the response @dadoonet .
Actually I want to set vm.max_map_count=262144 and max file descriptors during the startup.
Because I have some unavoidable limitation where I cannot set this value from the host VM itself.
therefore I am trying to run a script like this in as an ENTRYPOINT in Dockerfile:-
For your reference here is the script.
new_value=262144 #Check if running as root
if [[ $(id -u) -ne 0 ]]; then
echo "This script must be run as root or with sudo."
echo "vm.max_map_count = $new_value" >> /etc/sysctl.conf
echo "elasticsearch - nofile 65535" >> /etc/security/limits.conf
su -c "bin/elasticsearch" elasticsearch #running with elasticsearch user
thanks for the reply @DavidTurner !
As suggested by @dadoonet , I am using the docker-entrypoint.sh script.
As below where, I running 2 script from a 3rd script passed in entrypoint. like below:-
#!/bin/bash #Run the script to set the kernel parameters with root priviledge
./set_kernel_parameters.sh #Run the docker-entrypoint.sh with elasticsearch user
su -c "./docker-entrypoint.sh" elasticsearch
But here I am getting the following error:-
vm.max_map_count = 262144
./entrypoint.sh: line 44: elasticsearch-keystore: command not found
From above output it says, the kernel parameters are set successfully from ./set_kernel_parameters.sh but docker-entrypoint.sh is having some issue.
I think we are very close to get this solved.
Any help is appreciated!