2
votes

I set these lines in elasticsearch.yml, so Elasticsearch is visible from public network.

network.host: 0.0.0.0 discovery.seed_hosts: ["host1_ip","host2_ip" , ...]

However, when I look at the log file, I see these lines:

[INFO ][o.e.t.TransportService   ] [node-dtk6] publish_address {172.16.3.2:9300}, bound_addresses {[::]:9300}
[INFO ][o.e.b.BootstrapChecks    ] [node-dtk6] bound or publishing to a non-loopback address, enforcing bootstrap checks

Also, Kibana shows 172.16.3.2:9300 instead of the public IP. However, my node is visible from public network!

How can I force elasticsearch to publish on public IP instead of private IP?

1
what is your public IP? - hamid bayat
your question is very unclear. only I know "network.host: 0.0.0.0" is wrong and it should be an IP (like your private IP). - hamid bayat
Why is it ('0.0.0.0') wrong? - Hossein
Do you run elasticsearch on docker? - apt-get_install_skill
I found the problem is because of the firewall which is put outside the OS! I found the problem using the ip addr command which showed the private IP instead of public IP. - Hossein

1 Answers

0
votes

My problem raised because of a secondary firewall which is placed on my network's way.

I found the problem using the ip addr command which is showed me the private IP instead of public IP. However, Elasticsearch response the query since the firewall redirect the public IP into the elasticsearch.

When I disabled the firewall, Kibana showd the public IP and the published_ip in Elasticsearch log was changed to public IP.