How to configure two application server nodes to connect to the same elasticsearch cluster?

advertisements

I have one code base to connect elastic search (localhost:9200) for the full-text-search feature. We deployed this code on two different machines (m1 & m2) under load balancing server. In this case, how to configure ES in 2 different machines to connect ES and index should reflect both sides.

I am using Elasticsearch v 5.1.2

Machine 1

cluster.name: production
node.name: database

Machine 2

cluster.name: production
node.name: app

Above setting worked on ES v 1.7.1

**Question?

What configuration should I do to make it work on ES v5.1.2?

Please help me to solve this issue.

Thanks in advance


I'm assuming these nodes aren't a part of same cluster.

Try http://MACHINE_1_IP:9200/_cat/nodes?v and check if all nodes are listed as part of cluster.

If they are not - just a quick guess, have you looked at network.host setting ? It binds to local loop by default ( That maybe something introduced in 2 + )