Network.host or http.host - documentation problem?

The default works fine, however it's only binding to localhost. I want to be able to bind elasticsearch to a non-loopback IP. Docs say this is possible, but setting 0.0.0.0 or the actual adapater IP results in the following:

[2016-10-27T14:16:13,023][INFO ][o.e.b.BootstrapCheck ] [ssosearch01] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2016-10-27T14:16:13,024][ERROR][o.e.b.Bootstrap ] [ssosearch01] node validation exception
bootstrap checks failed

The only other thing I've set it to that works is ::1, but that doesn't help either. I need a remote apache server to be able to proxy to it.

What I just did that worked was to change network.host to http.host. The docs says the setting is network.host and that's how it's set up for the other 2 nodes I installed.

The rest of the trace is super important. What is it?

This is the full block from the log. It didn't generate any java errors. This is using network.host = "0.0.0.0" in the elasticsearch.yml file. Note that I blanked out my local IP address, but it did pick it up correctly.

[2016-10-27T15:56:14,581][INFO ][o.e.n.Node ] [ssosearch03] initializing ...
[2016-10-27T15:56:14,653][INFO ][o.e.e.NodeEnvironment ] [ssosearch03] using [1] data paths, mounts [[/sso (/dev/mapper/vg_sas-lv_sso)]], net usable_space [79.9gb], net total_space [79.9gb], spins? [possibly], types [xfs]
[2016-10-27T15:56:14,653][INFO ][o.e.e.NodeEnvironment ] [ssosearch03] heap size [15.9gb], compressed ordinary object pointers [true]
[2016-10-27T15:56:14,656][INFO ][o.e.n.Node ] [ssosearch03] version[5.0.0], pid[610], build[253032b/2016-10-26T04:37:51.531Z], OS[Linux/3.10.0-327.4.4.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_65/25.65-b01]
[2016-10-27T15:56:15,359][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [aggs-matrix-stats]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [ingest-common]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [lang-expression]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [lang-groovy]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [lang-mustache]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [lang-painless]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [percolator]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [reindex]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [transport-netty3]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] loaded module [transport-netty4]
[2016-10-27T15:56:15,360][INFO ][o.e.p.PluginsService ] [ssosearch03] no plugins loaded
[2016-10-27T15:56:17,010][INFO ][o.e.n.Node ] [ssosearch03] initialized
[2016-10-27T15:56:17,010][INFO ][o.e.n.Node ] [ssosearch03] starting ...
[2016-10-27T15:56:17,137][INFO ][o.e.t.TransportService ] [ssosearch03] publish_address {[my local IP address]:9300}, bound_addresses {[::]:9300}
[2016-10-27T15:56:17,142][INFO ][o.e.b.BootstrapCheck ] [ssosearch03] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2016-10-27T15:56:17,143][ERROR][o.e.b.Bootstrap ] [ssosearch03] node validation exception
bootstrap checks failed
initial heap size [4294967296] not equal to maximum heap size [17179869184]; this can cause resize pauses and prevents mlockall from locking the entire heap
[2016-10-27T15:56:17,145][INFO ][o.e.n.Node ] [ssosearch03] stopping ...
[2016-10-27T15:56:17,156][INFO ][o.e.n.Node ] [ssosearch03] stopped
[2016-10-27T15:56:17,156][INFO ][o.e.n.Node ] [ssosearch03] closing ...
[2016-10-27T15:56:17,166][INFO ][o.e.n.Node ] [ssosearch03] closed

Fix the heap size then.

1 Like

Okay, that did work although I could have sworn I had this issue before I made any jvm changes.

Still, this isn't a "best practices" issue if the service fails to start, it's a requirement that they match. The jvm.options file says "you should" set to the same value.

Also kinda interesting that I can change network.host to http.host and it ignores this requirement.

Please feel free to raise an issue so we can get that updated.

Hi Tim,

I personally do not use the "network.host =" option. However I use:

network.bind_host: 0.0.0.0
network.publish_host: xxx.xxx.xxx.xxx

ES can listen on the loopback, and ES can work with LVS.

Alex.

Hi,

I tried your solution but didn't work, the problem remains

[root@uh0088 ~]# tail -f /var/log/elasticsearch/elasticsearch.log
[2016-11-04T12:13:24,957][INFO ][o.e.n.Node ] [ELK#1] starting ...
[2016-11-04T12:13:25,164][INFO ][o.e.t.TransportService ] [ELK#1] publish_address {10.50.131.44:9300}, bound_addresses {[::]:9300}
[2016-11-04T12:13:25,170][INFO ][o.e.b.BootstrapCheck ] [ELK#1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2016-11-04T12:13:25,172][ERROR][o.e.b.Bootstrap ] [ELK#1] node validation exception
bootstrap checks failed
max number of threads [1024] for user [elasticsearch] likely too low, increase to at least [2048]
[2016-11-04T12:13:25,341][INFO ][o.e.n.Node ] [ELK#1] stopping ...
[2016-11-04T12:13:25,414][INFO ][o.e.n.Node ] [ELK#1] stopped
[2016-11-04T12:13:25,415][INFO ][o.e.n.Node ] [ELK#1] closing ...
[2016-11-04T12:13:25,431][INFO ][o.e.n.Node ] [ELK#1] closed

#network.host:

network.bind_host: 0.0.0.0

network.publish_host: 10.50.131.44

Hello,

do you use debian ? You can disable IPV6

echo "net.ipv6.conf.all.disable_ipv6=1" > /etc/sysctl.d/disableipv6.conf 
reboot

Can you tell me if it works ?

Hello,

I am using CentOS release 6.8 (Final).

Why did you refer IPv6 in this issue?

In your error message

[2016-11-04T12:13:25,164][INFO ][o.e.t.TransportService ] [ELK#1] publish_address {10.50.131.44:9300}, bound_addresses {[::]:9300}

I think ::1/128 is the IP loop back in ipv6

This ^

1 Like

I have the same problem like you refer above. How to fix it ?

I was able to fix the error using below properties but i am still facing issue clustering 2 nodes.
on node 1:
http.bind_host: my-elasticnode-01
http.publish_host: my-elasticnode-01

on node 2:
http.bind_host: my-elasticnode-02
http.publish_host: my-elasticnode-02

@tarun_kayasth I have the same issue.. Still got no clue at all. Tried several different settings. Did you get any luck on making it work ?
If you can share the correct settings, that would be of great help..

Yep, actually in my original case, it was due to the bootstrap check failure. Even though the config has separate entries for initial and max heap size, it actually requires you to set those to be exactly the same, otherwise the check fails and the service doesn't start.

I think I got it to skip past the error by using a different config directive, but this heap sizing mismatch was actually the problem.

@tsmori Are you still able to run ES in a cluster ?
In my jvm.options file. they are set to same value

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms2g
-Xmx2g

Hi
Solution: elasticsearch.yml in file
cluster.name: my-application
node.name: ${hostname}
node.master: true
node.data: true
transport.host: localhost
transport.tcp.port: 9300
network.host: 0.0.0.0
http.port: 9200
discovery.zen.minimum_master_nodes: 3

3 Likes

Isn't setting transport.host to localhost disables clustering support as other nodes would not be able to talk to each other?

Thank you. I solved my problem.