Master_not_discovered_exception error while setting up passwords for user

While setting up the pasword for the built-in ES accounts by logging into the newly setup 3 node cluster docker exec -it es01 sh then running bin/elasticsearch-setup-passwords interactive --url https://localhost:9200

Gets error:
sh-5.0# bin/elasticsearch-setup-passwords interactive --url https://localhost:9200

Failed to determine the health of the cluster running at https://localhost:9200
Unexpected response code [503] from calling GET https://localhost:9200/_cluster/health?pretty
Cause: master_not_discovered_exception
It is recommended that you resolve the issues with your cluster before running elasticsearch-setup-passwords.
It is very likely that the password changes will fail when run against an unhealthy cluster.

.P12 Certificates for respective nodes have been transferred. Below elasticsearch.yml

cluster.name: "docker-cluster"
network.host: 0.0.0.0

Have setup a 3-node Elasticsearch cluster using docker-compose. Followed below steps:

  1. Initialize a docker swarm. On ES11 run docker swarm init. Follow the instructions to join 12 and 13 to the swarm.
  2. Create an overlay network docker network create -d overlay --attachable elastic
  3. If necessary, bring down the current cluster and remove all the associated volumes by running docker-compose down -v
  4. Create SSL certificates for ES with docker-compose -f create-certs.yml run --rm create_certs
  5. Copy the certs for es02 and 03 to the respective servers
  6. Use this busybox to create the overlay network on 02 and 03 sudo docker run -itd --name containerX --net [network name] busybox
  7. Configure certs on 02 and 03 with docker-compose -f config-certs.yml run --rm config_certs
  8. Start the cluster with docker-compose up -d on each server
  9. Set the passwords for the built-in ES accounts by logging into the cluster docker exec -it es11 sh then running bin/elasticsearch-setup-passwords interactive --url localhost:9200

gets error at steps 9. What am I missing?

Also curl throws below error:

sudo curl -X GET 'https://localhost:9200'
curl: (7) Failed connect to localhost:9200; Connection refused

sudo curl -X GET 'https://localhost:9216'
curl: (35) Encountered end of file

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.