Set cluster

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"]

I'd check your name resolution.

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

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

From host1, can you do:

ping host2

?

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

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

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.

No. Ideally leave the ports to the default values.

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

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.

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.

Please format your code, logs or configuration files using </> icon as explained in this guide 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:

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.

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