Hi there,
I am building up Elasticsearch clusters automatically with Ansible and have a problem with the initial setting of the "elastic" user password.
As described in the documentation a initial and transient bootstrap password is used to set the password of built-in user "elastic":
When you install Elasticsearch, if the
elastic
user does not already have a password, it uses a default bootstrap password. The bootstrap password is a transient password that enables you to run the tools that set all the built-in user passwords.
I execute the following steps to set the password:
printf "secret"|/usr/share/elasticsearch/bin/elasticsearch-keystore add -x "bootstrap.password"
Restart of the Elasticsearch node to make the bootstrap password active.
curl -k -u elastic:secret -XPUT https://localhost:9200/_security/user/elastic/_password -d '{ "password":"elastic" }' -H 'Content-Type: application/json'
My problem is, that this procedure should run only on one node to prevent errors, when one node tries to set the password while another node set it already.
It would help if I could check if the password is already set or not.
Can someone help?
Best regards,
Martin