# Master\_not\_discovered\_exception error while setting up passwords for user

**URL:** <https://discuss.elastic.co/t/master-not-discovered-exception-error-while-setting-up-passwords-for-user/318079>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [November 3, 2022, 7:48am UTC](https://discuss.elastic.co/t/master-not-discovered-exception-error-while-setting-up-passwords-for-user/318079 "2022-11-03T07:48:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boodle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boodle/32/86046_2.png) [@Boodle](https://discuss.elastic.co/u/Boodle)\
**Post date:** [November 3, 2022, 7:48am UTC](https://discuss.elastic.co/t/master-not-discovered-exception-error-while-setting-up-passwords-for-user/318079/1 "2022-11-03T07:48:06Z")

</div>

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](https://localhost:9200)

```auto
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

```auto
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](https://localhost:9200/)

gets error at steps 9. What am I missing?

---

<div class="post-metadata">

**Author:** ![Boodle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boodle/32/86046_2.png) [@Boodle](https://discuss.elastic.co/u/Boodle)\
**Post date:** [November 4, 2022, 9:39am UTC](https://discuss.elastic.co/t/master-not-discovered-exception-error-while-setting-up-passwords-for-user/318079/2 "2022-11-04T09:39:19Z")

</div>

Also curl throws below error:

```auto
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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 2, 2022, 9:39am UTC](https://discuss.elastic.co/t/master-not-discovered-exception-error-while-setting-up-passwords-for-user/318079/3 "2022-12-02T09:39:27Z")

</div>

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