ElasticSearch 7.2 not able to connect from localhost

Hello,

I have recently installed elasticsearch 7.2 on my Ubuntu 18.04. Initially elasticsearch service was not starting due to some Java issue, Once I installed java and set JAVA_HOME, service started working fine and is showing Active running. However, when I run curl localhost:9200, it gives me error connection refused. I have checked elasticsearch.yml file and made entry in network.host: [host,site]. Still no good. Please assist.

Please share your logs, formatted according to the forum rules, thanks.

Hi,

Now its seems elasticsearch is working, when i changed host setting to 127.0.0.1, I am able to see curl results. But still when i change it to [local,site_]. it stops working. I have already check firewall etc.

Please share your logs, formatted according to the forum rules, thanks.

[2019-07-15T10:38:35,456][INFO ][o.e.p.PluginsService ] [node-1] loaded module [analysis-common]
[2019-07-15T10:38:35,456][INFO ][o.e.p.PluginsService ] [node-1] loaded module [data-frame]
[2019-07-15T10:38:35,456][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-common]
[2019-07-15T10:38:35,457][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-geoip]
[2019-07-15T10:38:35,457][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-user-agent]
[2019-07-15T10:38:35,457][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-expression]
[2019-07-15T10:38:35,458][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-mustache]
[2019-07-15T10:38:35,458][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-painless]
[2019-07-15T10:38:35,459][INFO ][o.e.p.PluginsService ] [node-1] loaded module [mapper-extras]
[2019-07-15T10:38:35,461][INFO ][o.e.p.PluginsService ] [node-1] loaded module [parent-join]
[2019-07-15T10:38:35,462][INFO ][o.e.p.PluginsService ] [node-1] loaded module [percolator]
[2019-07-15T10:38:35,462][INFO ][o.e.p.PluginsService ] [node-1] loaded module [rank-eval]
[2019-07-15T10:38:35,463][INFO ][o.e.p.PluginsService ] [node-1] loaded module [reindex]
[2019-07-15T10:38:35,463][INFO ][o.e.p.PluginsService ] [node-1] loaded module [repository-url]
[2019-07-15T10:38:35,465][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty4]
[2019-07-15T10:38:35,465][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ccr]
[2019-07-15T10:38:35,465][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-core]
[2019-07-15T10:38:35,466][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-deprecation]
[2019-07-15T10:38:35,466][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-graph]
[2019-07-15T10:38:35,466][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ilm]
[2019-07-15T10:38:35,467][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-logstash]
[2019-07-15T10:38:35,469][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-ml]
[2019-07-15T10:38:35,469][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-monitoring]
[2019-07-15T10:38:35,471][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-rollup]
[2019-07-15T10:38:35,471][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-security]
[2019-07-15T10:38:35,472][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-sql]
[2019-07-15T10:38:35,472][INFO ][o.e.p.PluginsService ] [node-1] loaded module [x-pack-watcher]
[2019-07-15T10:38:35,477][INFO ][o.e.p.PluginsService ] [node-1] no plugins loaded
[2019-07-15T10:38:44,089][INFO ][o.e.x.s.a.s.FileRolesStore] [node-1] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
[2019-07-15T10:38:45,257][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-1] [controller/13802] [Main.cc@110] controller (64 bit): Version 7.2.0 (Build 65aefcbfce449b) Copyright (c) 2019 Elasticsearch BV
[2019-07-15T10:38:46,095][DEBUG][o.e.a.ActionModule ] [node-1] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-07-15T10:38:46,720][INFO ][o.e.d.DiscoveryModule ] [node-1] using discovery type [zen] and seed hosts providers [settings]
[2019-07-15T10:38:48,305][INFO ][o.e.n.Node ] [node-1] initialized
[2019-07-15T10:38:48,305][INFO ][o.e.n.Node ] [node-1] starting ...
[2019-07-15T10:38:48,565][INFO ][o.e.t.TransportService ] [node-1] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2019-07-15T10:38:48,720][WARN ][o.e.b.BootstrapChecks ] [node-1] the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2019-07-15T10:38:48,730][INFO ][o.e.c.c.Coordinator ] [node-1] cluster UUID [eO0dQ5G0Td-B8AQct9AJWg]
[2019-07-15T10:38:48,748][INFO ][o.e.c.c.ClusterBootstrapService] [node-1] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2019-07-15T10:38:49,042][INFO ][o.e.c.s.MasterService ] [node-1] elected-as-master ([1] nodes joined)[{node-1}{HvkF3-INRoaauJbnlAEYiA}{ubyC_8A5TWKCZXSlXUUkSw}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=8364986368, xpack.installed=true, ml.max_open_jobs=20} elect leader, BECOME_MASTER_TASK, FINISH_ELECTION], term: 7, version: 31, reason: master node changed {previous , current [{node-1}{HvkF3-INRoaauJbnlAEYiA}{ubyC_8A5TWKCZXSlXUUkSw}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=8364986368, xpack.installed=true, ml.max_open_jobs=20}]}
[2019-07-15T10:38:49,220][INFO ][o.e.c.s.ClusterApplierService] [node-1] master node changed {previous , current [{node-1}{HvkF3-INRoaauJbnlAEYiA}{ubyC_8A5TWKCZXSlXUUkSw}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=8364986368, xpack.installed=true, ml.max_open_jobs=20}]}, term: 7, version: 31, reason: Publication{term=7, version=31}
[2019-07-15T10:38:49,298][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2019-07-15T10:38:49,310][INFO ][o.e.n.Node ] [node-1] started
[2019-07-15T10:38:49,795][INFO ][o.e.l.LicenseService ] [node-1] license [0f286432-2dde-42e7-ab6d-50094da27b45] mode [basic] - valid
[2019-07-15T10:38:49,819][INFO ][o.e.g.GatewayService ] [node-1] recovered [0] indices into cluster_state

These are the logs after I commented out network.host option in elasticsearch.yml. Now i can access it locally not remotely.

We need the logs when it fails.

Please read this about how to format.

[2019-07-15T13:13:57,783][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [1.9gb], compressed ordinary object pointers [true]
[2019-07-15T13:13:57,791][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [HvkF3-INRoaauJbnlAEYiA], cluster name [My-Elastic]
[2019-07-15T13:13:57,791][INFO ][o.e.n.Node               ] [node-1] version[7.2.0], pid[2434], build[default/deb/508c38a/2019-06-20T15:54:18.811730Z], OS[Linux/4.18.0-25-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/12.0.1/12.0.1+12]
[2019-07-15T13:13:57,797][INFO ][o.e.n.Node               ] [node-1] JVM home [/usr/share/elasticsearch/jdk]
[2019-07-15T13:13:57,797][INFO ][o.e.n.Node               ] [node-1] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-11749557243626456332, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -Dio.netty.allocator.type=pooled, -XX:MaxDirectMemorySize=1073741824, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=deb, -Des.bundled_jdk=true]
[2019-07-15T13:14:01,529][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [aggs-matrix-stats]
[2019-07-15T13:14:01,530][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [analysis-common]
[2019-07-15T13:14:01,530][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [data-frame]
[2019-07-15T13:14:01,531][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-common]
[2019-07-15T13:14:01,531][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-geoip]
[2019-07-15T13:14:01,532][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-user-agent]
[2019-07-15T13:14:01,532][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-expression]
[2019-07-15T13:14:01,533][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-mustache]
[2019-07-15T13:14:01,533][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-painless]
[2019-07-15T13:14:01,534][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [mapper-extras]
[2019-07-15T13:14:01,534][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [parent-join]
[2019-07-15T13:14:01,535][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [percolator]
[2019-07-15T13:14:01,535][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [rank-eval]
[2019-07-15T13:14:01,536][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [reindex]
[2019-07-15T13:14:01,536][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [repository-url]
[2019-07-15T13:14:01,536][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [transport-netty4]
[2019-07-15T13:14:01,540][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ccr]
[2019-07-15T13:14:01,541][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-core]
[2019-07-15T13:14:01,541][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-deprecation]
[2019-07-15T13:14:01,541][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-graph]
[2019-07-15T13:14:01,542][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ilm]
[2019-07-15T13:14:01,542][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-logstash]
[2019-07-15T13:14:01,542][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ml]
[2019-07-15T13:14:01,543][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-monitoring]
[2019-07-15T13:14:01,544][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-rollup]
[2019-07-15T13:14:01,544][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-security]
[2019-07-15T13:14:01,545][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-sql]
[2019-07-15T13:14:01,545][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-watcher]
[2019-07-15T13:14:01,545][INFO ][o.e.p.PluginsService     ] [node-1] no plugins loaded
[2019-07-15T13:14:10,116][INFO ][o.e.x.s.a.s.FileRolesStore] [node-1] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
[2019-07-15T13:14:11,743][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-1] [controller/2530] [Main.cc@110] controller (64 bit): Version 7.2.0 (Build 65aefcbfce449b) Copyright (c) 2019 Elasticsearch BV
[2019-07-15T13:14:12,665][DEBUG][o.e.a.ActionModule       ] [node-1] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-07-15T13:14:13,407][INFO ][o.e.d.DiscoveryModule    ] [node-1] using discovery type [zen] and seed hosts providers [settings]
[2019-07-15T13:14:15,064][INFO ][o.e.n.Node               ] [node-1] initialized
[2019-07-15T13:14:15,065][INFO ][o.e.n.Node               ] [node-1] starting ...
[2019-07-15T13:14:15,349][INFO ][o.e.t.TransportService   ] [node-1] publish_address {172.18.64.29:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}, {172.18.64.29:9300}
[2019-07-15T13:14:15,362][INFO ][o.e.b.BootstrapChecks    ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-07-15T13:14:15,483][ERROR][o.e.b.Bootstrap          ] [node-1] node validation exception
[1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2019-07-15T13:14:15,490][INFO ][o.e.n.Node               ] [node-1] stopping ...
[2019-07-15T13:14:15,520][INFO ][o.e.n.Node               ] [node-1] stopped
[2019-07-15T13:14:15,520][INFO ][o.e.n.Node               ] [node-1] closing ...
[2019-07-15T13:14:15,543][INFO ][o.e.n.Node               ] [node-1] closed
[2019-07-15T13:14:15,549][INFO ][o.e.x.m.p.NativeController] [node-1] Native controller process has stopped - no new native processes can be started

These are the logs. current setting is 34

Please read https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html