I've been trying to install Elasticsearch in a brand new Ubuntu box (ubuntu/trusty64) using Vagrant.
This is what I get when I run curl localhost:9200 in my guest machine
{
"name" : "Base",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.3.4",
"build_hash" : "e455fd0c13dceca8dbbdbb1665d068ae55dabe3f",
"build_timestamp" : "2016-06-30T11:24:31Z",
"build_snapshot" : false,
"lucene_version" : "5.5.0"
},
"tagline" : "You Know, for Search"
}
It seems good. But when I run the same command on my host, this is what I get:
curl: (52) Empty reply from server
Here are my port forwarding data (vagrant port):
22 (guest) => 2222 (host)
80 (guest) => 8080 (host)
9200 (guest) => 9200 (host)
9300 (guest) => 9300 (host)
So, ports seems to be properly forwarded and Elasticsearch service in guest VM is running good.
Here's my firewall configuration in the guest VM (sudo ufw status)
To Action From
-- ------ ----
22 ALLOW Anywhere
9200/tcp ALLOW Anywhere
9300/tcp ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
9200/tcp (v6) ALLOW Anywhere (v6)
9300/tcp (v6) ALLOW Anywhere (v6)
I've also have an Apache server that runs with no problem when using localhost:8080 (forwarded to localhost:80)
Also, nothing weird in logs: cat /var/log/elasticsearch/elasticsearch.log:
[2016-07-12 18:49:37,838][INFO ][node ] [Raymond Sikorsky] version[2.3.4], pid[2138], build[e455fd0/2016-06-30T11:24:31Z]
[2016-07-12 18:49:37,839][INFO ][node ] [Raymond Sikorsky] initializing ...
[2016-07-12 18:49:38,439][INFO ][plugins ] [Raymond Sikorsky] modules [lang-groovy, reindex, lang-expression], plugins [], sites []
[2016-07-12 18:49:38,464][INFO ][env ] [Raymond Sikorsky] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [35.8gb], net total_space [39.3gb], spins? [possibly], types [ext4]
[2016-07-12 18:49:38,464][INFO ][env ] [Raymond Sikorsky] heap size [1007.3mb], compressed ordinary object pointers [true]
[2016-07-12 18:49:38,464][WARN ][env ] [Raymond Sikorsky] max file descriptors [65535] for elasticsearch process likely too low, consider increasing to at least [65536]
[2016-07-12 18:49:40,455][INFO ][node ] [Raymond Sikorsky] initialized
[2016-07-12 18:49:40,455][INFO ][node ] [Raymond Sikorsky] starting ...
[2016-07-12 18:49:40,521][INFO ][transport ] [Raymond Sikorsky] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2016-07-12 18:49:40,527][INFO ][discovery ] [Raymond Sikorsky] elasticsearch/HqATev5kScKOXLXdl44ZLA
[2016-07-12 18:49:43,585][INFO ][cluster.service ] [Raymond Sikorsky] new_master {Raymond Sikorsky}{HqATev5kScKOXLXdl44ZLA}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-07-12 18:49:43,622][INFO ][http ] [Raymond Sikorsky] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2016-07-12 18:49:43,622][INFO ][node ] [Raymond Sikorsky] started
[2016-07-12 18:49:43,625][INFO ][gateway ] [Raymond Sikorsky] recovered [0] indices into cluster_state
I know just the basics of servers. Am I missing something? Maybe the issue has nothing to do with ports?