0
votes

I am new to both elasticsearch and VMs (i'm a data analyst, but I gotta set elasticsearch up on out azure cloud so as to do analysis later); so pardon me if my question is stupid. I installed the Docker container for elasticsearch available from Azure marketplace. Elastcsearch is up and running and pinging the assigned IP is returning expected rsults like this:

~$ curl 172.xx.x.x:9200
{
  "status" : 200,
  "name" : "Black Crow",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.7.1",
    "build_hash" : "b88f43fc40b0bcd7f173a1f9ee2e97816de80b19",
    "build_timestamp" : "2015-07-29T09:54:16Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

I have also downloaded the "head" plugin for testing development on the VM. However I am not able to run it on localhost:9200 .

~$ curl localhost:9200 gives: curl: (7) Failed to connect to localhost port 9200: Connection refused EDIT: Working now after adding -p flag to bind localhost's 9200 to vm's 9200. But still running localhost:9200 on browser doesnt connect. Supossedly the ip is undiscoverable. How to make it discoverable?

I tried something like docker run -d -p 9200:9200 -p 9300:9300 -v $HOME/data:/data elasticsearch /elasticsearch/bin/elasticsearch (modified from http://www.codedependant.net/2015/01/17/install-elastic-search-plugins-through-docker/) but it doesn't work.

My $Home directory looks like this:

ls $HOME/*
/home/company/wget-log

/home/company/config:

/home/company/data:
elasticsearch.yml  plugins

/home/company/es:
plugins

(this folder above contains the plugins, not the other "plugins" folder in /data)

/home/company/esdata:
elasticsearch

Any help will be appreciated. Thanks a lot

1
So, lots of things could be wrong. First... what os is your machine on, and do you have docker installed locally or on a VM?Paul Becotte
@PaulBecotte : its on Azure cloud, its a linux VM as mentioned in the question. My local machine is windows 10UD1989

1 Answers

0
votes

So, you mention a browser. Usually you run a browser from your local machine. In that case, on a Windows 10 machine, 'localhost' will never resolve to a Docker container. Your docker container cannot run directly on windows, so must be running somewhere else.

If you are running your docker commands on your azure vm, you should be going to http:<azure vm ip>:9200. If you are running them on your machine, targeting a docker engine installed on your laptop using Docker machine or boot2docker, it should be http:<local vm ip>:9200.

If running locally, you can get the ip of that machine using boot2docker ip or docker-machine ls