# Elasticsearch Cluster formation on AWS - Elasticsearch 5.2

**URL:** <https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560>\
**Category:** Elasticsearch\
**Created:** [February 27, 2017, 12:31am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560 "2017-02-27T00:31:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo\_Li](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Leo\_Li](https://discuss.elastic.co/u/Leo_Li)\
**Post date:** [February 27, 2017, 12:31am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560/1 "2017-02-27T00:31:43Z")

</div>

Hi,

I recently upgraded Elasticsearch from 1.6 to 5.2, and my ES instances stopped forming a cluster on aws environment.

I had set below parameters in configuration file:  
[cluster.name](http://cluster.name): elasticsearch\_ids  
discovery.zen.hosts\_provider: ec2  
cloud.aws.region: ap-southeast-2  
discovery.zen.ping\_timeout: 30s

When the instances were stared, they output logs as below:  
[2017-02-27T00:02:44,437][INFO][o.e.n.Node] initialized  
[2017-02-27T00:02:44,438][INFO][o.e.n.Node] [Eq-9SWO] starting ...  
[2017-02-27T00:02:44,751][WARN][i.n.u.i.MacAddressUtil] Failed to find a usable hardware address from the network interfaces; using random bytes: a0:4d:7f:b6:2d:0d:db:70  
[2017-02-27T00:02:44,832][INFO][o.e.t.TransportService] [Eq-9SWO] publish\_address {127.0.0.1:9300}, bound\_addresses {127.0.0.1:9300}  
[2017-02-27T00:02:44,845][WARN][o.e.b.BootstrapChecks] [Eq-9SWO] max virtual memory areas vm.max\_map\_count [65530] is too low, increase to at least [262144]  
[2017-02-27T00:02:54,501][INFO][o.e.x.m.e.Exporters] [Eq-9SWO] skipping exporter [default\_local] as it is not ready yet  
[2017-02-27T00:03:04,504][INFO][o.e.x.m.e.Exporters] [Eq-9SWO] skipping exporter [default\_local] as it is not ready yet  
[2017-02-27T00:03:14,508][INFO][o.e.x.m.e.Exporters] [Eq-9SWO] skipping exporter [default\_local] as it is not ready yet  
[2017-02-27T00:03:14,878][WARN][o.e.n.Node] [Eq-9SWO] timed out while waiting for initial discovery state - timeout: 30s  
[2017-02-27T00:03:14,886][INFO][o.e.h.HttpServer] [Eq-9SWO] publish\_address {172.31.14.153:9200}, bound\_addresses {[::]:9200}  
[2017-02-27T00:03:14,886][INFO][o.e.n.Node] [Eq-9SWO] started  
[2017-02-27T00:03:15,530][INFO][o.e.c.s.ClusterService] [Eq-9SWO] new\_master {Eq-9SWO}{Eq-9SWOaTW6O7qj81S6V4w}{Nw1I\_hvMS4SfSWwfS2H-ew}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)  
[2017-02-27T00:03:15,618][INFO][o.e.g.GatewayService] [Eq-9SWO] recovered [0] indices into cluster\_state

The security group and IAM role shouldn't be a problem here because it was all working for Elasticsearch 1.6. Can anyone please help?

Thank you.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 27, 2017, 12:41am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560/2 "2017-02-27T00:41:58Z")

</div>

5.X only listens to loopback by default, see [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/bootstrap-checks.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/bootstrap-checks.html)

---

<div class="post-metadata">

**Author:** ![Leo\_Li](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Leo\_Li](https://discuss.elastic.co/u/Leo_Li)\
**Post date:** [February 27, 2017, 1:35am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560/3 "2017-02-27T01:35:31Z")

</div>

Thanks warkolm, indeed I set http.host to 0.0.0.0 and transport.host to 127.0.0.1. Could you please also advise what value I should use for these two parameters? Do I have to set to their own private IP address?  
Thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 27, 2017, 1:40am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560/4 "2017-02-27T01:40:36Z")

</div>

> [@Leo\_Li](#):
>
> transport.host to 127.0.0.1

You cluster will never form with that.

---

<div class="post-metadata">

**Author:** ![Leo\_Li](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Leo\_Li](https://discuss.elastic.co/u/Leo_Li)\
**Post date:** [February 27, 2017, 2:31am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560/5 "2017-02-27T02:31:53Z")

</div>

Okay I see, so how should I set the value for transport.host? I tried remove it from setting but I got some strange errors like below:

[2017-02-27T02:27:29,445][WARN][o.e.t.n.Netty4Transport] [ZoX1MdS] exception caught on transport layer [[id: 0x9547699c, L:/172.31.13.25:43242 - R:/172.31.13.77:9300]], closing connection  
java.io.EOFException: tried to read: 100 bytes but only 76 remaining  
at org.elasticsearch.transport.netty4.ByteBufStreamInput.ensureCanReadBytes(ByteBufStreamInput.java:75) ~[?:?]  
at org.elasticsearch.common.io.stream.FilterStreamInput.ensureCanReadBytes(FilterStreamInput.java:80) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.common.io.stream.StreamInput.readArraySize(StreamInput.java:925) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:342) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.common.io.stream.StreamInput.readList(StreamInput.java:885) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.common.io.stream.StreamInput.readMapOfLists(StreamInput.java:479) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.(ThreadContext.java:335) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.(ThreadContext.java:322) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext.readHeaders(ThreadContext.java:184) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1327) ~[elasticsearch-5.2.1.jar:5.2.1]  
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:74) ~[transport-netty4-5.2.1.jar:5.2.1]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:280) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:396) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:280) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:396) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248) [netty-codec-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:527) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:481) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441) [netty-transport-4.1.7.Final.jar:4.1.7.Final]  
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-common-4.1.7.Final.jar:4.1.7.Final]  
at java.lang.Thread.run(Thread.java:745) [?:1.8.0\_92-internal]

---

<div class="post-metadata">

**Author:** ![xeraa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xeraa/32/48181_2.png) [@xeraa](https://discuss.elastic.co/u/xeraa)\
**Post date:** [March 2, 2017, 12:01am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560/6 "2017-03-02T00:01:21Z")

</div>

If you are running on AWS, you probably want to use the EC2 discovery plugin — see the docs: [https://www.elastic.co/guide/en/elasticsearch/plugins/current/discovery-ec2.html](https://www.elastic.co/guide/en/elasticsearch/plugins/current/discovery-ec2.html)  
I'd say that this is the preferred method.

Alternatively you can bind the transport.host (that's the one used for the cluster communication) to the publicly available interface and provide a seed list of the other hosts. But make sure to properly protect your cluster via security groups.

---

<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:** [March 30, 2017, 12:01am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-formation-on-aws-elasticsearch-5-2/76560/7 "2017-03-30T00:01:29Z")

</div>

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