Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

elasticsearch multiple nic bind network interfaces

introduction

when configuring elasticsearch I ran into a problem with binding the listening interfaces. somehow the documentation does not provide how to setup multiple network interfaces (network def and bind def)

problem description

my intention is to setup the network.bind_host as _eth1:ipv4_ and _local_

even when trying to setup the bind_host as _local_ only, the elastic search port 9200 is still only reachable by eth1 (of course i have restarted the server)

solutions tried

i have tested the firewall configuration by setting up a netcat server and this one works perfectly for that port

so this results in 2 Questions:

  1. how to configure multiple nics? (whats the notation?)
  2. would i require to change the network.publish_host ?!

.

  • any other pointers?

current configuration:

network.bind_host:    _eth1:ipv4_
network.publish_host: _eth1:ipv4_
network.host:         _eth1:ipv4_

also tested configuration:

network.bind_host:    _local_
network.publish_host: _eth1:ipv4_
network.host:         _local_

PS: afaik the publish_host is the nic for the inter-server communication

like image 567
Summer-Sky Avatar asked Apr 27 '15 10:04

Summer-Sky


1 Answers

  1. Using a YAML list for the desired property:

    network.bind_host:
      - _local_
      - _en0:ipv4_
    
  2. If I understand this answer correctly, publish_host should be _eth1:ipv4_. Your publish_host has to be a one of the interfaces to which elasticsearch binds via the bind_host property.


The above linked answer is actually great, so I have to cite it here:

"bind_host" is the host that an Elasticsearch node uses in the socket bind call when starting the network. Due to socket programming model, you can "bind" to an address. By referencing an "address", the socket allows access to one or all underlying network devices. There are several addresses with predefined semantics, e.g. 0.0.0.0 is reserved for "bind to all network devices". So the "bind_host" address does not necessarily reflect a single unique address.

"publish_host" must be a single unique network address. It is used for connect calls by other nodes, not for socket bind call by the node itself. By using "publish_host" all nodes and clients can be sure they can connect to this node. Declaring this single unique address to the outside can be interpreted as "publishing", so it is called "publish_host".

You can not set "bind_host" and "publish_host" to arbitrary values, the values must adhere to the underlying socket model.

like image 178
yair Avatar answered Oct 15 '22 02:10

yair