<< All Posts
Basic setup of an ElasticSearch Docker


I’ve been playing with Docker in the last weeks. Today I’m gonna show you how to setup a basic ElasticSearch Docker. I’m gonna show you more advanced configurations in future posts. (Maybe clustering and custom configs).

We’re going to pull an specific version of ElasticSearch (1.7). You can get the latest one just ommiting the “:1.7” from the following commands you see here.

Also, in it’s default configuration, it binds the port 9200 to 0.0.0.0 so we’re going to change something in order to bind only to Docker host (your Operational System).

Enough bla bla bla.. Let’s do it! :)

1) Pulling docker image using specific version 1.7:

sudo docker pull elasticsearch:1.7

2) Checking if the image was indeed pulled:

sudo docker images

3) Running docker and exposing the 9200 port only to the docker’s host:

sudo docker run --name elasticsearch -p 127.0.0.1:9200:9200 -d elasticsearch:1.7


4) Testing:

curl -XGET "http://localhost:9200/"

curl -XGET "http://localhost:9200/"
{
  "status" : 200,
  "name" : "Richard Parker",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.7.6",
    "build_hash" : "c730b59357f8ebc555286794dcd90b3411f517c9",
    "build_timestamp" : "2016-11-18T15:21:16Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

See you next post!

Rodolfo



<< All Posts