RecycleRobot
RecycleRobot

Reputation: 810

elasticsearch listen to multiple ips

Is it possible to listen to multiple host adresses so that I can listen to localhost requests AND private IP requests?

something like:

network.host: "127.0.0.1", "192.168.1.4"

Upvotes: 27

Views: 38505

Answers (3)

Maoz Zadok
Maoz Zadok

Reputation: 5930

network.host: [  _site_ , _local_ , _global_ ]
  • _local_ : Any loopback addresses
  • _site_ : Any local (internal) addresses
  • _global_: Any external IP

you can instead specify network interface name like [ _eth0_ , _lo_ ]

Upvotes: 7

mvreijn
mvreijn

Reputation: 2942

I tested the given solution and it did not work. I concluded that Elastic cannot listen on specific interfaces using network.bind_host in the configuration.

However you can tell elastic to listen on all interfaces by specifying:

network.bind_host: 0.0.0.0
network.publish_host: <your external address>

This will make sure one address is published (to the cluster) but all addresses are accessible. Tested and verified with Elastic 2.1.1.

Upvotes: 16

Fred
Fred

Reputation: 442

In fact yes it is. Use the JSON notation.

This is what I used in my configuration: network.bind_host: ["yourhost", "localhost"] and network.publish_host: yourhost as you don't want to send multicast packets on the loopback interface.

Upvotes: 26

Related Questions