Set up elasticsearch cluster for 2 machines

I am trying to cluster two system as an elastic cluster

I have two system running on ubuntu where elasticsearch is set .The following are the config files with the lines that i have modified or uncommented from the default

Config file(system 1):

cluster.name: elastic-cluster-attempt
node.name: "es-node-1"
node.master: false
node.data: true

network.host: 111.111.11.111
transport.host: 127.0.0.1
http.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300

discovery.zen.ping.unicast.hosts: ["111.111.11.111:9300","222.222.22.22:9300"]

Config file (system 2):

cluster.name: elastic-cluster-attempt
node.name: "es-node-2"
node.master: true
node.data: true

network.host: 222.222.22.222
transport.host: 127.0.0.1
http.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300

discovery.zen.ping.unicast.hosts: ["111.111.11.111:9300","222.222.22.22:9300"]

When i run elastic search with these configurations
sytem 1elasticsearch does not start and throws error : "not enough master nodes discovered during pinging (found [[]], but needed [-1]), pinging again
"
System 2 starts but does not ping the other system

I want to combine these two systems as a cluster please let me know the mistakes and the right way to do it

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 I think that transport.host: 127.0.0.1 is wrong and should be transport.host: 0.0.0.0.
Also it does not make sense to have only one master eligible node.
So actually write:

cluster.name: elastic-cluster-attempt
node.name: "es-node-1"
network.host: 111.111.11.111
discovery.zen.ping.unicast.hosts: ["111.111.11.111","222.222.22.22"]

And

cluster.name: elastic-cluster-attempt
node.name: "es-node-2"
network.host: 222.222.22.22
discovery.zen.ping.unicast.hosts: ["111.111.11.111","222.222.22.22"]

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