I need to automate create build in user for which I should use /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive or /usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto
In first scenario I has to specify all password manually which is not really easy to automate and in second scenario it is hard to somehow save these values somewhere.
Thanks for letting me know. This should be run after the password is randomly generated? : /usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto ??
Or I can just use the API change password? Because when I tried via your manual it always told me that I dont know the password for Elastic user so I cannot change password for kibana, logstash_system etc...
You take this approach (the change password API) instead of running setup-passwords.
The example I provided shows how you do that without having a password for the elastic user - you need to set the bootstrap.password to a value that you do know.
| /usr/share/elasticsearch/bin/elasticsearch-keystore add -x "bootstrap.password"
Exception in thread "main" java.lang.NullPointerException
at org.elasticsearch.common.settings.AddStringKeyStoreCommand.execute(AddStringKeyStoreCommand.java:87)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:77)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.common.settings.KeyStoreCli.main(KeyStoreCli.java:41)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.