Connection refused on new RHEL7 installation

Hi, I'm new to ELK and just installed elasticsearch on RHEL7 with default configs. I can run curl successfully to http://127.0.0.1:9200 or http://localhost:9200, but not with http://host1:9200:
$ curl http://host1 --verbose

  • About to connect() to host1 port 9200 (#0)
  • Trying nn.nn.nn.nn...
  • Connection refused
  • Failed connect to host1:9200; Connection refused
  • Closing connection 0
    curl: (7) Failed connect to host1:9200; Connection refused

Here's how the log looks like:
[2018-02-19T15:29:08,589][INFO ][o.e.n.Node ] [] initializing ...
[2018-02-19T15:29:08,682][INFO ][o.e.e.NodeEnvironment ] [lGXEuBD] using [1] data paths, mounts [[/app (/dev/mapper/vg_root-lv_app)]], net usable_space [44.7gb], net total_space [49gb], spins? [possibly], types [ext4]
[2018-02-19T15:29:08,682][INFO ][o.e.e.NodeEnvironment ] [lGXEuBD] heap size [1.9gb], compressed ordinary object pointers [true]
[2018-02-19T15:29:08,683][INFO ][o.e.n.Node ] node name [lGXEuBD] derived from node ID [lGXEuBDvStyhHnM2dumb9A]; set [node.name] to override
[2018-02-19T15:29:08,684][INFO ][o.e.n.Node ] version[5.6.7], pid[42651], build[4669214/2018-01-25T21:14:50.776Z], OS[Linux/3.10.0-693.17.1.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_144/25.144-b01]
[2018-02-19T15:29:08,684][INFO ][o.e.n.Node ] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/app/elk-stack/elasticsearch/elasticsearch-5.6.7]
[2018-02-19T15:29:09,603][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [aggs-matrix-stats]
[2018-02-19T15:29:09,603][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [ingest-common]
[2018-02-19T15:29:09,603][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [lang-expression]
[2018-02-19T15:29:09,603][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [lang-groovy]
[2018-02-19T15:29:09,603][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [lang-mustache]
[2018-02-19T15:29:09,603][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [lang-painless]
[2018-02-19T15:29:09,603][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [parent-join]
[2018-02-19T15:29:09,604][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [percolator]
[2018-02-19T15:29:09,604][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [reindex]
[2018-02-19T15:29:09,604][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [transport-netty3]
[2018-02-19T15:29:09,604][INFO ][o.e.p.PluginsService ] [lGXEuBD] loaded module [transport-netty4]
[2018-02-19T15:29:09,605][INFO ][o.e.p.PluginsService ] [lGXEuBD] no plugins loaded
[2018-02-19T15:29:11,058][INFO ][o.e.d.DiscoveryModule ] [lGXEuBD] using discovery type [zen]
[2018-02-19T15:29:11,615][INFO ][o.e.n.Node ] initialized
[2018-02-19T15:29:11,615][INFO ][o.e.n.Node ] [lGXEuBD] starting ...
[2018-02-19T15:29:11,846][INFO ][o.e.t.TransportService ] [lGXEuBD] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2018-02-19T15:29:11,859][WARN ][o.e.b.BootstrapChecks ] [lGXEuBD] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-02-19T15:29:14,934][INFO ][o.e.c.s.ClusterService ] [lGXEuBD] new_master {lGXEuBD}{lGXEuBDvStyhHnM2dumb9A}{qj8ixIPzTvW-EHmcyALW0A}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2018-02-19T15:29:14,986][INFO ][o.e.g.GatewayService ] [lGXEuBD] recovered [0] indices into cluster_state
[2018-02-19T15:29:14,988][INFO ][o.e.h.n.Netty4HttpServerTransport] [lGXEuBD] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2018-02-19T15:29:14,988][INFO ][o.e.n.Node ] [lGXEuBD] started

There is no firewall on the server.

Any suggestions on what else to look at?

Thanks!

Look at the network.host config variable.

Thanks for the quick response...
I did try adding network.host and still got the error bootstrap checks failed:
[2018-02-19T16:00:47,659][INFO ][o.e.n.Node ] [lGXEuBD] starting ...
[2018-02-19T16:00:47,874][INFO ][o.e.t.TransportService ] [lGXEuBD] publish_address {192.168.41.6:9300}, bound_addresses {192.168.41.6:9300}
[2018-02-19T16:00:47,889][INFO ][o.e.b.BootstrapChecks ] [lGXEuBD] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-02-19T16:00:47,896][INFO ][o.e.n.Node ] [lGXEuBD] stopping ...
[2018-02-19T16:00:47,936][INFO ][o.e.n.Node ] [lGXEuBD] stopped
[2018-02-19T16:00:47,936][INFO ][o.e.n.Node ] [lGXEuBD] closing ...
[2018-02-19T16:00:47,948][INFO ][o.e.n.Node ] [lGXEuBD] closed

Thanks!

Yep. You should also read https://www.elastic.co/guide/en/elasticsearch/reference/6.2/setup.html

Thank you!

We are now able to connect to elasticsearch after explicitly setting the following params:
transport.host
transport.tcp.port
network.host

You only need to set network.host the rest will inherit that.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.