# Elasticsearch 7.1.1 cluster not forming using discovery-ec2

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-1-1-cluster-not-forming-using-discovery-ec2/186427>\
**Category:** Elasticsearch\
**Created:** [June 19, 2019, 10:06am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-1-cluster-not-forming-using-discovery-ec2/186427 "2019-06-19T10:06:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![haktoggle](https://avatars.discourse-cdn.com/v4/letter/h/9fc29f/32.png) [@haktoggle](https://discuss.elastic.co/u/haktoggle)\
**Post date:** [June 19, 2019, 10:06am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-1-cluster-not-forming-using-discovery-ec2/186427/1 "2019-06-19T10:06:46Z")

</div>

I have setup 3 nodes in AWS using discovery-ec2 plugin but they are not forming cluster. They just formed as its own cluster.

**elasticsearch.yml config on all three nodes**

- bootstrap.memory\_lock: true
- discovery.seed\_providers: ec2
- path.data: /mnt/elasticsearch/data
- path.logs: /mnt/elasticsearch/log
- cluster.name: clusterName
- node.name: ${HOSTNAME}
- network.host: \_ _ec2_ \_
- cluster.initial\_master\_nodes: ${HOSTNAME}
- cloud.node.auto\_attributes: true
- cluster.routing.allocation.awareness.attributes: aws\_availability\_zone
- discovery.ec2.tag.role: master
- discovery.ec2.tag.environment: Prod
- discovery.ec2.groups: SecurityGroupID
- discovery.ec2.any\_group: false
- discovery.ec2.host\_type: private\_ip
- discovery.zen.minimum\_master\_nodes: 2

What could be wrong with the elasticsearch.yml config? I tried adding **discovery.seed\_hosts:** pointing to 3 nodes IP but still not working.

I tried changing one of the nodes into data mode only and added all 3 nodes IP into **discovery.seed\_hosts:** on 3 nodes.

**Below is the logs on 2 master nodes**  
failed to validate incoming join request from node [{ip-10-24-3-70}{xBqemGsdTGiwAhWdcpyhXw}{7EHb9uUxTVGiG4-1FdtD1g}{10.24.3.70}{10.24.3.70:9300}{aws\_availability\_zone=eu-west-1a, ml.machine\_memory=8264749056, ml.max\_open\_jobs=20, xpack.installed=true}]  
org.elasticsearch.transport.RemoteTransportException: [ip-10-24-3-70][10.24.3.70:9300][internal:cluster/coordination/join/validate]  
Caused by: org.elasticsearch.cluster.coordination.CoordinationStateRejectedException: join validation on cluster state with a different cluster uuid \_bTw3xAiSriOwjZ7r\_HiPg than local cluster uuid awBETiqHS-2XTaiccHb50Q, rejecting  
at org.elasticsearch.cluster.coordination.JoinHelper.lambda$new$4(JoinHelper.java:147) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$1.doRun(SecurityServerTransportInterceptor.java:251) ~[?:?]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:309) ~[?:?]  
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:63) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.transport.TcpTransport$RequestHandler.doRun(TcpTransport.java:1077) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:751) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-7.1.1.jar:7.1.1]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]  
at java.lang.Thread.run(Thread.java:835) [?:?]

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 19, 2019, 10:26am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-1-cluster-not-forming-using-discovery-ec2/186427/2 "2019-06-19T10:26:09Z")

</div>

> [@haktoggle](#):
>
> - cluster.initial\_master\_nodes: ${HOSTNAME}

This looks wrong. From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html):

> You must set `cluster.initial_master_nodes` to the same list of nodes on each node on which it is set in order to be sure that only a single cluster forms during bootstrapping and therefore to avoid the risk of data loss.

Since you have not set `cluster.initial_master_nodes` to the same list on each node, it sounds like you have formed multiple clusters.

---

<div class="post-metadata">

**Author:** ![haktoggle](https://avatars.discourse-cdn.com/v4/letter/h/9fc29f/32.png) [@haktoggle](https://discuss.elastic.co/u/haktoggle)\
**Post date:** [June 19, 2019, 10:40am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-1-cluster-not-forming-using-discovery-ec2/186427/3 "2019-06-19T10:40:06Z")

</div>

Hi David,

Thanks for prompt reply.

Is there way to auto discover all cluster.initial\_master\_nodes?

All those nodes on AWS are launched with autoscaling and not possible to manually change all the time.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 19, 2019, 11:14am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-1-cluster-not-forming-using-discovery-ec2/186427/4 "2019-06-19T11:14:32Z")

</div>

Not that we're aware of. The APIs that are available in EC2 don't give consistent enough answers to let us correctly do the kind of auto-discovery you are looking for. Note that you only need to set this setting for the initial cluster startup; once the cluster has formed, the setting is ignored and can be removed.

---

<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:** [July 17, 2019, 11:14am UTC](https://discuss.elastic.co/t/elasticsearch-7-1-1-cluster-not-forming-using-discovery-ec2/186427/5 "2019-07-17T11:14:34Z")

</div>

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