1

By following this answer, I set up my /etc/elasticsearch/elasticsearch.yml as follows (almost equivalent to the linked answer):

Node 1 (192.168.136.6):

cluster.name: mycluster
node.name: "node1"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.136.6"]

Node 2 (192.168.152.244):

cluster.name: mycluster
node.name: "node2"
node.master: false
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.136.6"]

and everything else is set to default, i.e. they're commented out.

By curl http://localhost:9200/_cluster/health?pretty=true on Node 1, I get:

...
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
...

so apparently Node 1&2 are not clustered. What am I missing?

Note: I'm using ES 2.3.4 on CentOS 6.5. At least ping from Node 2 to 1 and 1 to 2 works. I turned off iptables temporarily (because I want to make sure the firewall setting isn't causing the problem). I tried two VPS services and it still doesn't work (and so I removed "on Linode" from the title).

Community
  • 1
  • 1
akai
  • 2,498
  • 4
  • 24
  • 46
  • 1
    Possible duplicate of [Elasticserch Master not discoverd exception - Version 2.3.0](http://stackoverflow.com/questions/38130943/elasticserch-master-not-discoverd-exception-version-2-3-0) – pickypg Jul 12 '16 at 16:09
  • 1
    You've asked it in a different way, but the answer is the result of the same issue. ES 2.0+ only binds sockets to localhost by default. So, being on separate IPs, the two nodes cannot see each other. – pickypg Jul 12 '16 at 16:09
  • Though I posted the answer by myself, your comment helped me finding the solution. Thanks. – akai Jul 12 '16 at 18:22

1 Answers1

0

All right, I could solve the issue but it was actually a bit complicated. My servers (on Linode) only have the interface eth0, which is bound to the outer internet, and the alias eth0:0 is bound to the private network. Thus, I had to set network.host to _eth0:0_, which, however, does not work (maybe a bug). Therefore, I set network.host to _site_ instead, which seems to be practically converted to _eth0:0_ in this case. Now I have a properly clustered ES.

_global_ might also work but I hesitate to use it because I'm not sure if it's safe.

akai
  • 2,498
  • 4
  • 24
  • 46