Cannot connect to remote ElasticSearch server

I am aware that a similar question was posted back in 2015, but the answers there unfortunately do not help me.

On my remote Windows 10 server (on which Elasticsearch 6.6.2 is installed), I have added an inbound security rule named Port9200:


I have also added the following lines to my elastisearch.yml file:

transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0

Last but not least, I have ensured that there are no outbound security rules blocking any TCP connection from my local machine to my remote server via Port 9200.

Unfortunately, I am still unable to connect to my remote Elasticsearch server:

What other approaches should I try out, in order to ensure that I can access my remote Elasticsearch server from my local machine?

UPDATE: Here are the results after running netstat -ano | find ":9200":

You should change localhost to the machine's IP address and restart elasticsearch

Thanks for your reply. I followed your suggestion, but now I cannot start the ElasticSearch server at all:

if you don't mind, please share the output of ipconfig command here or make sure you are using the right IP address in elasticsearch.yml file.

Oh, I also noticed that you set network.host too, please use one only (either transport.host or network.host)

Here is the reference link that you can learn more about it
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-transport.html

Thanks for your reply. I just tried again, and now I am able to start my remote Elasticsearch server.

This is my IP address, as displayed after running ipconfig:
image

Here are the updated contents of my elasticsearch.yml file:

transport.host: 10.0.1.4
transport.tcp.port: 9300
http.port: 9200

(I have removed network.host.)

I have restarted my Elasticsearch server remotely, but I am still unable to access it from my local machine.

when you are at the remote ES server, can you run this command from the console?
curl -XGET http://10.0.1.4:9200
^ what do you get?

from your local machine, can you run the same command? or use the browser with the URL above?
^ what do you get?

Thanks for your reply. Unfortunately I just left the office and won't return until Monday. I will answer your questions once I get back to work.

Have a great weekend!

No problem.

Hello thn,

I have run the curl command on my remote ES server. Here is the displayed result:

PS C:\Users\M> C:\Users\M\Downloads\curl-7.64.0_3-win64-mingw\curl-7.64.0-win64-mingw\bin\curl.exe -XGET http://10
.0.1.4:9200
{
  "name" : "8F-Edn5",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "x7V8Sr8KTRu8_pNixpjOkQ",
  "version" : {
    "number" : "6.6.2",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "3bd3e59",
    "build_date" : "2019-03-06T15:16:26.864148Z",
    "build_snapshot" : false,
    "lucene_version" : "7.6.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

Running the same command on my local machine, this is what I see:

curl: (7) Failed to connect to 10.0.1.4 port 9200: Timed out

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with </> icon. Check the preview window.

Thanks @dadoonet, I have edited my post.

Thanks. Could you share elasticsearch logs?

Are you referring to elasticsearch.log?

Yes.

I will split it into multiple posts due to the character limit.

[2019-03-25T08:44:30,783][INFO ][o.e.n.Node               ] [8F-Edn5] stopping ...
[2019-03-25T08:44:30,843][INFO ][o.e.x.w.WatcherService   ] [8F-Edn5] stopping watch service, reason [shutdown initiated]
[2019-03-25T08:44:31,342][INFO ][o.e.n.Node               ] [8F-Edn5] stopped
[2019-03-25T08:44:31,347][INFO ][o.e.n.Node               ] [8F-Edn5] closing ...
[2019-03-25T08:44:31,350][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [8F-Edn5] [controller/7720] [Main.cc@148] Ml controller exiting
[2019-03-25T08:44:31,388][INFO ][o.e.x.m.p.NativeController] [8F-Edn5] Native controller process has stopped - no new native processes can be started
[2019-03-25T08:44:31,403][INFO ][o.e.n.Node               ] [8F-Edn5] closed
[2019-03-25T10:29:37,439][INFO ][o.e.e.NodeEnvironment    ] [8F-Edn5] using [1] data paths, mounts [[Windows (C:)]], net usable_space [112gb], net total_space [126.5gb], types [NTFS]
[2019-03-25T10:29:37,450][INFO ][o.e.e.NodeEnvironment    ] [8F-Edn5] heap size [1007.3mb], compressed ordinary object pointers [true]
[2019-03-25T10:29:37,453][INFO ][o.e.n.Node               ] [8F-Edn5] node name derived from node ID [8F-Edn5jQ9mNO7UNtOtMwQ]; set [node.name] to override
[2019-03-25T10:29:37,453][INFO ][o.e.n.Node               ] [8F-Edn5] version[6.6.2], pid[3920], build[default/zip/3bd3e59/2019-03-06T15:16:26.864148Z], OS[Windows Server 2016/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_201/25.201-b09]
[2019-03-25T10:29:37,453][INFO ][o.e.n.Node               ] [8F-Edn5] JVM arguments [-Xms1g, -Xmx1g, -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=C:\Users\Miao\AppData\Local\Temp\1\elasticsearch, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Delasticsearch, -Des.path.home=C:\Users\Miao\Downloads\elasticsearch-6.6.2, -Des.path.conf=C:\Users\Miao\Downloads\elasticsearch-6.6.2\config, -Des.distribution.flavor=default, -Des.distribution.type=zip]
[2019-03-25T11:21:06,607][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [aggs-matrix-stats]
[2019-03-25T11:21:06,609][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [analysis-common]
[2019-03-25T11:21:06,610][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [ingest-common]
[2019-03-25T11:21:06,611][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [lang-expression]
[2019-03-25T11:21:06,611][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [lang-mustache]
[2019-03-25T11:21:06,612][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [lang-painless]
[2019-03-25T11:21:06,613][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [mapper-extras]
[2019-03-25T11:21:06,613][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [parent-join]
[2019-03-25T11:21:06,614][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [percolator]
[2019-03-25T11:21:06,614][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [rank-eval]
[2019-03-25T11:21:06,615][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [reindex]
[2019-03-25T11:21:06,616][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [repository-url]
[2019-03-25T11:21:06,616][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [transport-netty4]
[2019-03-25T11:21:06,617][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [tribe]
[2019-03-25T11:21:06,617][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-ccr]
[2019-03-25T11:21:06,620][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-core]
[2019-03-25T11:21:06,620][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-deprecation]
[2019-03-25T11:21:06,621][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-graph]
[2019-03-25T11:21:06,621][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-ilm]
[2019-03-25T11:21:06,622][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-logstash]
[2019-03-25T11:21:06,623][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-ml]
[2019-03-25T11:21:06,670][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-monitoring]
[2019-03-25T11:21:06,672][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-rollup]
[2019-03-25T11:21:06,672][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-security]
[2019-03-25T11:21:06,672][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-sql]
[2019-03-25T11:21:06,672][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-upgrade]
[2019-03-25T11:21:06,672][INFO ][o.e.p.PluginsService     ] [8F-Edn5] loaded module [x-pack-watcher]
[2019-03-25T11:21:06,672][INFO ][o.e.p.PluginsService     ] [8F-Edn5] no plugins loaded
[2019-03-25T11:21:11,947][INFO ][o.e.x.s.a.s.FileRolesStore] [8F-Edn5] parsed [0] roles from file [C:\Users\Miao\Downloads\elasticsearch-6.6.2\config\roles.yml]
[2019-03-25T11:21:13,695][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [8F-Edn5] [controller/4896] [Main.cc@109] controller (64 bit): Version 6.6.2 (Build 62531230b275d3) Copyright (c) 2019 Elasticsearch BV
[2019-03-25T11:21:14,289][DEBUG][o.e.a.ActionModule       ] [8F-Edn5] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-03-25T11:21:14,664][INFO ][o.e.d.DiscoveryModule    ] [8F-Edn5] using discovery type [zen] and host providers [settings]
[2019-03-25T11:21:15,774][INFO ][o.e.n.Node               ] [8F-Edn5] initialized
[2019-03-25T11:21:15,774][INFO ][o.e.n.Node               ] [8F-Edn5] starting ...
[2019-03-25T11:21:16,056][INFO ][o.e.t.TransportService   ] [8F-Edn5] publish_address {10.0.1.4:9300}, bound_addresses {10.0.1.4:9300}
[2019-03-25T11:21:16,103][INFO ][o.e.b.BootstrapChecks    ] [8F-Edn5] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-03-25T11:21:19,239][INFO ][o.e.c.s.MasterService    ] [8F-Edn5] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{Yjxxs4IuQt2X3q-bnydgMA}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-03-25T11:21:19,255][INFO ][o.e.c.s.ClusterApplierService] [8F-Edn5] new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{Yjxxs4IuQt2X3q-bnydgMA}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{Yjxxs4IuQt2X3q-bnydgMA}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-03-25T11:21:19,427][INFO ][o.e.h.n.Netty4HttpServerTransport] [8F-Edn5] publish_address {10.0.1.4:9200}, bound_addresses {[::]:9200}
[2019-03-25T11:21:19,458][INFO ][o.e.n.Node               ] [8F-Edn5] started
[2019-03-25T11:21:20,099][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [8F-Edn5] Failed to clear cache for realms [[]]
[2019-03-25T11:21:20,161][INFO ][o.e.l.LicenseService     ] [8F-Edn5] license [bb533fb2-a7da-41ab-a409-f8ce2779ca77] mode [basic] - valid
[2019-03-25T11:21:20,177][INFO ][o.e.g.GatewayService     ] [8F-Edn5] recovered [1] indices into cluster_state
[2019-03-25T11:21:20,857][INFO ][o.e.c.r.a.AllocationService] [8F-Edn5] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[logstash-2019.03.25][3]] ...]).

I have copied and pasted the entire elasticsearch.log file.

What is your complete elasticsearch.yml file?

Please don't use the citation icon but the formatting icon </>.