# Installation of ElasticSearch Cluster on AWS EC2 with 3 nodes

**URL:** <https://discuss.elastic.co/t/installation-of-elasticsearch-cluster-on-aws-ec2-with-3-nodes/144659>\
**Category:** Elasticsearch\
**Created:** [August 16, 2018, 8:40am UTC](https://discuss.elastic.co/t/installation-of-elasticsearch-cluster-on-aws-ec2-with-3-nodes/144659 "2018-08-16T08:40:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hussain7](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@hussain7](https://discuss.elastic.co/u/hussain7)\
**Post date:** [August 16, 2018, 8:40am UTC](https://discuss.elastic.co/t/installation-of-elasticsearch-cluster-on-aws-ec2-with-3-nodes/144659/1 "2018-08-16T08:40:45Z")

</div>

Hello All,

I am a newbie to ElasticSearch Cluster Setup and need help regarding installation. Below is my config for all the 3 nodes. Using ElasticSearch-6.3.2 on Amazon Linux.

Master Config  
`cluster.name: prod`  
`node.name: master101`  
`node.master: true`  
`path.data: /var/lib/elasticsearch`  
`path.logs: /var/log/elasticsearch`  
`bootstrap.memory_lock: true`  
`discovery.zen.hosts_provider: ec2`  
`discovery.ec2.tag.Segment: elastic`  
`network.host: 0.0.0.0`  
`transport.host: localhost`  
`transport.tcp.port: 9300`  
`xpack.security.enabled: false`  
`action.destructive_requires_name: true`

Slave-1 Config  
`cluster.name: prod`  
`node.name: slv1`  
`node.master: true`  
`path.data: /var/lib/elasticsearch`  
`path.logs: /var/log/elasticsearch`  
`bootstrap.memory_lock: true`  
`discovery.zen.hosts_provider: ec2`  
`discovery.ec2.tag.Segment: elastic`  
`network.host: 0.0.0.0`  
`transport.host: localhost`  
`transport.tcp.port: 9300`  
`xpack.security.enabled: false`  
`action.destructive_requires_name: true`

Slave-2 Config  
`cluster.name: prod`  
`node.master: true`  
`node.name: slv2`  
`path.data: /var/lib/elasticsearch`  
`path.logs: /var/log/elasticsearch`  
`bootstrap.memory_lock: true`  
`discovery.zen.hosts_provider: ec2`  
`discovery.ec2.tag.Segment: elastic`  
`network.host: 0.0.0.0`  
`transport.host: localhost`  
`transport.tcp.port: 9300`  
`xpack.security.enabled: false`  
`action.destructive_requires_name: true`

`All of my 3 instances are on a private subnet and Security groups are configured properly and I'm able to ping 3 of my instances vice versa`

Getting below error while starting the ElasticSearch service:  
**Error on Master Node:**

```auto
[WARN][o.e.d.z.ZenDiscovery] [master101] not enough master nodes discovered during pinging (found [[Candidate{node={master101}{ssssssssssssss}{ccccccccccccc}{localhost}{127.0.0.1:9300}{ml.machine_memory=16337809408, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, clusterStateVersion=-1}]], but needed [2]), pinging again   

```

**Error on slv node:**

```auto
[2018-08-16T08:35:24,619][WARN][o.e.d.z.ZenDiscovery] [slv1] not enough master nodes discovered during pinging (found [[Candidate{node={slv1}{issssssss76DQ}{ccccccccccccwg}{localhost}{127.0.0.1:9300}{ml.machine_memory=16337809408, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, clusterStateVersion=-1}]], but needed [2]), pinging again 

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 17, 2018, 9:27am UTC](https://discuss.elastic.co/t/installation-of-elasticsearch-cluster-on-aws-ec2-with-3-nodes/144659/2 "2018-08-17T09:27:41Z")

</div>

it seems as if the nodes cannot connect to each other. It also seems you have omitted some configuration options, as it looks that you have the minimum master nodes configured to 2.

can you share more than a single log line.

Also have you followed all the steps in [https://www.elastic.co/guide/en/elasticsearch/plugins/6.3/\_settings.html](https://www.elastic.co/guide/en/elasticsearch/plugins/6.3/_settings.html) and also set up the IAM policy?

---

<div class="post-metadata">

**Author:** ![hussain7](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@hussain7](https://discuss.elastic.co/u/hussain7)\
**Post date:** [August 17, 2018, 11:22am UTC](https://discuss.elastic.co/t/installation-of-elasticsearch-cluster-on-aws-ec2-with-3-nodes/144659/3 "2018-08-17T11:22:28Z")

</div>

Hi @spinscale  
I have already added my access and secret key with proper IAM policy to all of my 3 nodes using the below command:  
`elasticsearch-keystore add discovery.ec2.access_key`  
`elasticsearch-keystore add discovery.ec2.secret_key`  
also installed the `discovery-ec2 plugin` properly.

Also `discovery.zen.minimum_master_nodes: 3` is set to `3` on all the three nodes.

Logs from Slave-1 machine:

```auto
2018-08-17T11:18:53,687][WARN][o.e.d.z.ZenDiscovery] [slv1] not enough master nodes discovered during pinging (found [[Candidate{node={slv1}{sddsd}{sassaasCr8_f8-FQ}{localhost}{127.0.0.1:9300}{ml.machine_memory=16337809408, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, clusterStateVersion=-1}]], but needed [3]), pinging again
[2018-08-17T11:18:56,688][WARN][o.e.d.z.ZenDiscovery] [slv1] not enough master nodes discovered during pinging (found [[Candidate{node={slv1}{asassbfUK76DQ}{sasasasRfG5KCr8_f8-FQ}{localhost}{127.0.0.1:9300}{ml.machine_memory=16337809408, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, clusterStateVersion=-1}]], but needed [3]), pinging again

```

Logs from Slave-2 machine:

```auto
[2018-08-17T11:20:38,493][WARN][o.e.d.z.ZenDiscovery] [slv2] not enough master nodes discovered during pinging (found [[Candidate{node={slv2}{ssssssss_Qn-0yYubPx-Hng}{sssss1wSu6PgJt0MDmCMQ}{localhost}{127.0.0.1:9300}{ml.machine_memory=16337809408, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, clusterStateVersion=-1}]], but needed [3]), pinging again
[2018-08-17T11:20:41,494][WARN][o.e.d.z.ZenDiscovery] [slv2] not enough master nodes discovered during pinging (found [[Candidate{node={slv2}{sssssss0yYubPx-Hng}{ssssssu6PgJt0MDmCMQ}{localhost}{127.0.0.1:9300}{ml.machine_memory=16337809408, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, clusterStateVersion=-1}]], but needed [3]), pinging again

```

Please let me know if you need any other info from me.

---

<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:** [September 14, 2018, 11:22am UTC](https://discuss.elastic.co/t/installation-of-elasticsearch-cluster-on-aws-ec2-with-3-nodes/144659/4 "2018-09-14T11:22:34Z")

</div>

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