Home > OS >  Can't connect to Elasticsearch at <Publicip>:9200 - Logs don't show any errors
Can't connect to Elasticsearch at <Publicip>:9200 - Logs don't show any errors

Time:10-07

This worked, thanks. I am running into a different issue. Elasticsearch status says it's active, but I can't connect at http://<publicip>:9200. My elasticsearch logs doesn't show any issue.

This is the yaml file which was working for me on a different instance:

path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
node.data : true
network.host : 0.0.0.0
discovery.seed_hosts : []
cluster.initial_master_nodes : [10.50.11.77]

And this is the tailed logs:

tail -f /var/log/elasticsearch/elasticsearch.log

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]

at java.lang.Thread.run(Thread.java:833) [?:?]

[2022-10-05T23:50:13,021][INFO ][o.e.i.g.DatabaseNodeService] [ip-10-50-11-77] retrieve geoip database [GeoLite2-Country.mmdb] from [.geoip_databases] to [/tmp/geoip-databases/vr34RjMDQHGmLx60I5HrCw/GeoLite2-Country.mmdb.tmp.gz]

[2022-10-05T23:50:13,031][INFO ][o.e.i.g.DatabaseNodeService] [ip-10-50-11-77] retrieve geoip database [GeoLite2-ASN.mmdb] from [.geoip_databases] to [/tmp/geoip-databases/vr34RjMDQHGmLx60I5HrCw/GeoLite2-ASN.mmdb.tmp.gz]

[2022-10-05T23:50:13,038][INFO ][o.e.i.g.DatabaseNodeService] [ip-10-50-11-77] retrieve geoip database [GeoLite2-City.mmdb] from [.geoip_databases] to [/tmp/geoip-databases/vr34RjMDQHGmLx60I5HrCw/GeoLite2-City.mmdb.tmp.gz]

[2022-10-05T23:50:13,234][INFO ][o.e.c.r.a.AllocationService] [ip-10-50-11-77] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[.ds-.logs-deprecation.elasticsearch-default-2022.10.05-000001][0]]]).

[2022-10-05T23:50:13,771][INFO ][o.e.i.g.DatabaseNodeService] [ip-10-50-11-77] successfully reloaded changed geoip database file [/tmp/geoip-databases/vr34RjMDQHGmLx60I5HrCw/GeoLite2-Country.mmdb]

[2022-10-05T23:50:13,906][INFO ][o.e.i.g.DatabaseNodeService] [ip-10-50-11-77] successfully reloaded changed geoip database file [/tmp/geoip-databases/vr34RjMDQHGmLx60I5HrCw/GeoLite2-ASN.mmdb]

[2022-10-05T23:50:14,877][INFO ][o.e.i.g.DatabaseNodeService] [ip-10-50-11-77] successfully reloaded changed geoip database file [/tmp/geoip-databases/vr34RjMDQHGmLx60I5HrCw/GeoLite2-City.mmdb]

These are the logs from elasticsearch.log. I had to cut out some part, but there's no error or warning in the logs.

[2022-10-06T02:57:20,690][INFO ][o.e.n.Node               ] [ip-10-50-11-77] node name [ip-10-50-11-77], node ID [vr34RjMDQHGmLx60I5HrCw], cluster name [elasticsearch], roles [transform, data_frozen, master, remote_cluster_client, data, ml, data_content, data_hot, data>
[2022-10-06T02:57:31,042][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [ip-10-50-11-77] [controller/83608] [Main.cc@122] controller (64 bit): Version 7.17.6 (Build ea0305ae2a3b09) Copyright (c) 2022 Elasticsearch BV
[2022-10-06T02:57:33,221][INFO ][o.e.x.s.a.s.FileRolesStore] [ip-10-50-11-77] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
[2022-10-06T02:57:34,785][INFO ][o.e.i.g.ConfigDatabases  ] [ip-10-50-11-77] initialized default databases [[GeoLite2-Country.mmdb, GeoLite2-City.mmdb, GeoLite2-ASN.mmdb]], config databases [[]] and watching [/etc/elasticsearch/ingest-geoip] for changes
[2022-10-06T02:57:34,787][INFO ][o.e.i.g.DatabaseNodeService] [ip-10-50-11-77] initialized database registry, using geoip-databases directory [/tmp/geoip-databases/vr34RjMDQHGmLx60I5HrCw]
[2022-10-06T02:57:35,941][INFO ][o.e.t.NettyAllocator     ] [ip-10-50-11-77] creating NettyAllocator with the following configs: [name=elasticsearch_configured, chunk_size=1mb, suggested_max_allocation_size=1mb, factors={es.unsafe.use_netty_default_chunk_and_page_size=>
[2022-10-06T02:57:36,004][INFO ][o.e.i.r.RecoverySettings ] [ip-10-50-11-77] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
[2022-10-06T02:57:36,089][INFO ][o.e.d.DiscoveryModule    ] [ip-10-50-11-77] using discovery type [zen] and seed hosts providers [settings]
[2022-10-06T02:57:37,119][INFO ][o.e.g.DanglingIndicesState] [ip-10-50-11-77] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2022-10-06T02:57:38,593][INFO ][o.e.n.Node               ] [ip-10-50-11-77] initialized
[2022-10-06T02:57:38,593][INFO ][o.e.n.Node               ] [ip-10-50-11-77] starting ...
[2022-10-06T02:57:38,621][INFO ][o.e.x.s.c.f.PersistentCache] [ip-10-50-11-77] persistent cache index loaded
[2022-10-06T02:57:38,621][INFO ][o.e.x.d.l.DeprecationIndexingComponent] [ip-10-50-11-77] deprecation component started
[2022-10-06T02:57:38,828][INFO ][o.e.t.TransportService   ] [ip-10-50-11-77] publish_address {10.50.11.77:9300}, bound_addresses {0.0.0.0:9300}
[2022-10-06T02:57:39,727][INFO ][o.e.b.BootstrapChecks    ] [ip-10-50-11-77] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2022-10-06T02:57:39,783][INFO ][o.e.c.c.Coordinator      ] [ip-10-50-11-77] cluster UUID [S6SmAd6RS0SIElyFlQi0WA]
[2022-10-06T02:57:39,990][INFO ][o.e.c.s.MasterService    ] [ip-10-50-11-77] elected-as-master ([1] nodes joined)[{ip-10-50-11-77}{vr34RjMDQHGmLx60I5HrCw}{QEB_5uLmSHOn_og6WAgknw}{10.50.11.77}{10.50.11.77:9300}{cdfhilmrstw} elect leader, _BECOME_MASTER_TASK_, _FINISH_EL>
[2022-10-06T02:57:40,126][INFO ][o.e.c.s.ClusterApplierService] [ip-10-50-11-77] master node changed {previous [], current [{ip-10-50-11-77}{vr34RjMDQHGmLx60I5HrCw}{QEB_5uLmSHOn_og6WAgknw}{10.50.11.77}{10.50.11.77:9300}{cdfhilmrstw}]}, term: 26, version: 362, reason: P>
[2022-10-06T02:57:40,237][INFO ][o.e.h.AbstractHttpServerTransport] [ip-10-50-11-77] publish_address {10.50.11.77:9200}, bound_addresses {0.0.0.0:9200}
[2022-10-06T02:57:40,237][INFO ][o.e.n.Node               ] [ip-10-50-11-77] started
[2022-10-06T02:57:40,889][INFO ][o.e.l.LicenseService     ] [ip-10-50-11-77] license [08a72044-4aef-4bc8-98ff-e43192d4f9ab] mode [basic] - valid
[2022-10-06T02:57:40,891][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [ip-10-50-11-77] Active license is now [BASIC]; Security is disabled
[2022-10-06T02:57:40,891][WARN ][o.e.x.s.s.SecurityStatusChangeListener] [ip-10-50-11-77] Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/ref>
[2022-10-06T02:57:40,903][INFO ][o.e.g.GatewayService     ] [ip-10-50-11-77] recovered [8] indices into cluster_state
[2022-10-06T02:57:42,827][INFO ][o.e.c.r.a.AllocationService] [ip-10-50-11-77] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[.ds-.logs-deprecation.elasticsearch-default-2022.10.05-000001][0]]]).

CodePudding user response:

You can't connect to http://:9200 , you need to provide the ip of instance where Elasticsearch is running, by looking at your Elasticsearch yml, it looks like your IP is 10.50.11.77, so you should try http://0.50.11.77:9200 to access your Elasticsearch server.

CodePudding user response:

I temporarily solved this by changing the AWS security group source to 0.0.0.0/0 and permanently by correcting my security group config.

  • Related