deviantony / docker-elk

The Elastic stack (ELK) powered by Docker and Compose.
MIT License
17.08k stars 6.74k forks source link

Add note to README regarding elasticsearch-reset-password #956

Closed jorgegomzar closed 3 months ago

jorgegomzar commented 7 months ago

I couldn't reset the password for the logstash user, apparently it is not using the right URL for elastic.

Running this works:

docker-compose exec elasticsearch bin/elasticsearch-reset-password --batch --user elastic --url http://localhost:9200
antoineco commented 7 months ago

What was the error? Maybe you tried the command before Elasticsearch was ready to service requests?

localhost:9200 is the default already. We run this command in automated tests to initialize passwords, they would start failing if it wasn't the case.

jorgegomzar commented 7 months ago

Hi! I was getting this same error as the screenshot attached (now I am setting up filebeat) imagen

Checking logstash container logs I saw "elasticsearch" was not accessible, but kibana was already set up (was able to set up password and log in).

Tried several times with no luck, but adding --url http://localhost:9200 actually made the script run against elastic's API

antoineco commented 7 months ago

Did you perform any change to the elasticsearch.yml file? The URL is determined based on the content of this file.

If you pass the -v flag to your previous command you should be able to see what URL the tool is using.

jorgegomzar commented 7 months ago

Hi, no, I did not change anything. Elasticsearch had been up for 10 minutes when I tried to change the passwd.

antoineco commented 3 months ago

I wasn't able to reproduce and there is no output of failing communication with the -v flag in this thread, so I'm going to go ahead and close the issue.

If the problem ever occurs again, feel free to reopen!