docker-elk icon indicating copy to clipboard operation
docker-elk copied to clipboard

Add note to README regarding elasticsearch-reset-password

Open jorgegomzar opened this issue 1 year ago • 4 comments

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

jorgegomzar avatar Jan 22 '24 18:01 jorgegomzar

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.

antoineco avatar Jan 22 '24 21:01 antoineco

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

jorgegomzar avatar Jan 22 '24 23:01 jorgegomzar

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.

antoineco avatar Jan 23 '24 07:01 antoineco

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

jorgegomzar avatar Jan 28 '24 23:01 jorgegomzar

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!

antoineco avatar Jun 11 '24 11:06 antoineco