# Set cluster

**URL:** <https://discuss.elastic.co/t/set-cluster/142059>\
**Category:** Elasticsearch\
**Created:** [July 29, 2018, 8:19am UTC](https://discuss.elastic.co/t/set-cluster/142059 "2018-07-29T08:19:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sksky93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sksky93/32/32256_2.png) [@sksky93](https://discuss.elastic.co/u/sksky93)\
**Post date:** [July 29, 2018, 8:19am UTC](https://discuss.elastic.co/t/set-cluster/142059/1 "2018-07-29T08:19:04Z")

</div>

I had some problem in setting cluster.

I need some help.

this is my log  
`[2018-07-29T17:02:10,672][INFO][o.e.n.Node] [node-1] initializing ... [2018-07-29T17:02:10,755][INFO][o.e.e.NodeEnvironment] [node-1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [45.8gb], net total_space [47.9gb], types [rootfs] [2018-07-29T17:02:10,755][INFO][o.e.e.NodeEnvironment] [node-1] heap size [1007.3mb], compressed ordinary object pointers [true] [2018-07-29T17:02:10,756][INFO][o.e.n.Node] [node-1] node name [node-1], node ID [EEtGnAh9SL-dtsL3DMu4cg] [2018-07-29T17:02:10,757][INFO][o.e.n.Node] [node-1] version[6.0.0], pid[11915], build[8f0685b/2017-11-10T18:41:22.859Z], OS[Linux/3.10.0-514.2.2.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_181/25.181-b13] [2018-07-29T17:02:10,757][INFO][o.e.n.Node] [node-1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch] [2018-07-29T17:02:11,720][INFO][o.e.p.PluginsService] [node-1] loaded module [aggs-matrix-stats] [2018-07-29T17:02:11,720][INFO][o.e.p.PluginsService] [node-1] loaded module [analysis-common] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [ingest-common] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [lang-expression] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [lang-mustache] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [lang-painless] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [parent-join] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [percolator] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [reindex] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [repository-url] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [transport-netty4] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] loaded module [tribe] [2018-07-29T17:02:11,721][INFO][o.e.p.PluginsService] [node-1] no plugins loaded [2018-07-29T17:02:13,644][INFO][o.e.d.DiscoveryModule] [node-1] using discovery type [zen] [2018-07-29T17:02:14,343][INFO][o.e.n.Node] [node-1] initialized [2018-07-29T17:02:14,343][INFO][o.e.n.Node] [node-1] starting ... [2018-07-29T17:02:14,494][INFO][o.e.t.TransportService] [node-1] publish_address {10.41.3.244:9300}, bound_addresses {0.0.0.0:9300} [2018-07-29T17:02:14,526][INFO][o.e.b.BootstrapChecks] [node-1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks [2018-07-29T17:02:14,561][WARN][o.e.d.z.UnicastZenPing] [node-1] failed to resolve host [test002:9301] java.net.UnknownHostException: test002: Name or service not known at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[?:1.8.0_181] at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[?:1.8.0_181] at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[?:1.8.0_181] at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[?:1.8.0_181] at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[?:1.8.0_181] at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[?:1.8.0_181] at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:882) ~[elasticsearch-6.0.0.jar:6.0.0] at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:837) ~[elasticsearch-6.0.0.jar:6.0.0] at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:706) ~[elasticsearch-6.0.0.jar:6.0.0] at org.elasticsearch.discovery.zen.UnicastZenPing.lambda$null$0(UnicastZenPing.java:213) ~[elasticsearch-6.0.0.jar:6.0.0] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_181] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-6.0.0.jar:6.0.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181] [2018-07-29T17:02:17,590][INFO][o.e.c.s.MasterService] [node-1] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {node-1}{EEtGnAh9SL-dtsL3DMu4cg}{H2QpeTcfRdisOMuOP5_ahw}{10.41.3.244}{10.41.3.244:9300} [2018-07-29T17:02:17,595][INFO][o.e.c.s.ClusterApplierService] [node-1] new_master {node-1}{EEtGnAh9SL-dtsL3DMu4cg}{H2QpeTcfRdisOMuOP5_ahw}{10.41.3.244}{10.41.3.244:9300}, reason: apply cluster state (from master [master {node-1}{EEtGnAh9SL-dtsL3DMu4cg}{H2QpeTcfRdisOMuOP5_ahw}{10.41.3.244}{10.41.3.244:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]]) [2018-07-29T17:02:17,642][INFO][o.e.h.n.Netty4HttpServerTransport] [node-1] publish_address {10.41.3.244:9200}, bound_addresses {0.0.0.0:9200} [2018-07-29T17:02:17,642][INFO][o.e.n.Node] [node-1] started [2018-07-29T17:02:17,974][INFO][o.e.g.GatewayService] [node-1] recovered [0] indices into cluster_state`  
and this is my configfile

CONFIG1  
cluster.name: mycluster  
node.name: node-1  
network.host: 0.0.0.0  
http.post: 9200  
discovery.zen.ping.unicast.hosts: ["test001:9300", "test002:9301"]

CONFIG2  
cluster.name: mycluster  
node.name: node-2  
network.host: 0.0.0.0  
http.post: 9201  
discovery.zen.ping.unicast.hosts: ["test001:9300", "test002:9301"]

---

<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:** [July 29, 2018, 8:47am UTC](https://discuss.elastic.co/t/set-cluster/142059/2 "2018-07-29T08:47:11Z")

</div>

> [@sksky93](#):
>
> failed to resolve host [test002:9301] java.net.UnknownHostException: test002: Name or service not known

I'd check your name resolution.

---

<div class="post-metadata">

**Author:** ![sksky93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sksky93/32/32256_2.png) [@sksky93](https://discuss.elastic.co/u/sksky93)\
**Post date:** [July 29, 2018, 8:50am UTC](https://discuss.elastic.co/t/set-cluster/142059/4 "2018-07-29T08:50:58Z")

</div>

I checked using hostname command so it gave that name.  
but in doesn't work. any solutions?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 29, 2018, 9:43am UTC](https://discuss.elastic.co/t/set-cluster/142059/5 "2018-07-29T09:43:48Z")

</div>

If the nodes are deployed on different hosts, I would expect them to both listen to the default port `9300`, not `9301`.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 29, 2018, 10:10am UTC](https://discuss.elastic.co/t/set-cluster/142059/6 "2018-07-29T10:10:41Z")

</div>

From host1, can you do:

```
ping host2

```

?

---

<div class="post-metadata">

**Author:** ![sksky93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sksky93/32/32256_2.png) [@sksky93](https://discuss.elastic.co/u/sksky93)\
**Post date:** [July 30, 2018, 12:44am UTC](https://discuss.elastic.co/t/set-cluster/142059/8 "2018-07-30T00:44:48Z")

</div>

So, I will change `http.port: 9200`, `http.port: 9201` to `http.port: 9300` right?

---

<div class="post-metadata">

**Author:** ![sksky93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sksky93/32/32256_2.png) [@sksky93](https://discuss.elastic.co/u/sksky93)\
**Post date:** [July 30, 2018, 12:47am UTC](https://discuss.elastic.co/t/set-cluster/142059/9 "2018-07-30T00:47:16Z")

</div>

I did `ping (private ip)`  
and result was fine.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 30, 2018, 3:39am UTC](https://discuss.elastic.co/t/set-cluster/142059/10 "2018-07-30T03:39:48Z")

</div>

That's not what I said.  
I asked to ping host2 not its private IP.

Otherwise use the private IP instead host1 and host2 in elasticsearch configuration.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 30, 2018, 5:38am UTC](https://discuss.elastic.co/t/set-cluster/142059/11 "2018-07-30T05:38:09Z")

</div>

> [@sksky93](#):
>
> So, I will change `http.port: 9200` , `http.port: 9201` to `http.port: 9300` right?

No. Ideally leave the ports to the default values.

> [@sksky93](#):
>
> discovery.zen.ping.unicast.hosts: ["test001:9300", "test002:9301"]

If the nodes are running on different hosts, this should be: `discovery.zen.ping.unicast.hosts: ["test001", "test002"]`

---

<div class="post-metadata">

**Author:** ![sksky93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sksky93/32/32256_2.png) [@sksky93](https://discuss.elastic.co/u/sksky93)\
**Post date:** [July 30, 2018, 2:22pm UTC](https://discuss.elastic.co/t/set-cluster/142059/12 "2018-07-30T14:22:39Z")

</div>

ping host2 is not working.  
so i changed host1 and host2 to private IP.  
but it has different errors.

```
[2018-07-30T23:12:50,901][ERROR][o.e.b.Bootstrap] [node-1] Exception
org.elasticsearch.http.BindHttpException: Failed to bind to [9300]
Caused by: java.net.BindException: Address already in use
Caused by: org.elasticsearch.http.BindHttpException: Failed to bind to [9300]
Caused by: java.net.BindException: Address already in use
[2018-0`Preformatted text`7-30T23:12:50,952][WARN][o.e.c.NodeConnectionsService] 
[node-1] failed to connect to node {node-2}{ol2uRDR6SUWzroPlwMnAaw}
{W0aR1bR0SBikxDHgnVCeJw}{10.41.0.147}{10.41.0.147:9300} (tried [1] times)
 org.elasticsearch.transport.ConnectTransportException: [node-2][10.41.0.147:9300] connect_timeout[30s]
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: 10.41.0.147/10.41.0.147:9300
Caused by: java.net.ConnectException: Connection refused

```

Thanks your advice.

---

<div class="post-metadata">

**Author:** ![sksky93](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sksky93/32/32256_2.png) [@sksky93](https://discuss.elastic.co/u/sksky93)\
**Post date:** [July 30, 2018, 2:25pm UTC](https://discuss.elastic.co/t/set-cluster/142059/13 "2018-07-30T14:25:52Z")

</div>

So, I changed `discovery.zen.ping.unicast.hosts: ["test001", "test002"]`  
but it doesn't work. I changed private ip instead.  
but it has `Failed to bind to [9300]`error.  
and ports number is default.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 30, 2018, 2:37pm UTC](https://discuss.elastic.co/t/set-cluster/142059/14 "2018-07-30T14:37:58Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

Here it sounds like you already have an elasticsearch running on port 9300.

My advice: start from scratch again. Just change settings which are absolutely needed like `network.host` and `discovery.zen.ping.unicast.hosts`.

---

<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:** [August 27, 2018, 2:38pm UTC](https://discuss.elastic.co/t/set-cluster/142059/15 "2018-08-27T14:38:05Z")

</div>

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