Code Monkey home page Code Monkey logo

elasticsearch's Introduction

Elasticsearch Dockerfile

This repository contains Dockerfile of Elasticsearch for Docker's automated build published to the public Docker Hub Registry.

Base Docker Image

Installation

  1. Install Docker.

  2. Download automated build from public Docker Hub Registry: docker pull dockerfile/elasticsearch

    (alternatively, you can build an image from Dockerfile: docker build -t="dockerfile/elasticsearch" github.com/dockerfile/elasticsearch)

Usage

docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch

Attach persistent/shared directories

  1. Create a mountable data directory <data-dir> on the host.

  2. Create Elasticsearch config file at <data-dir>/elasticsearch.yml.

```yml
path:
  logs: /data/log
  data: /data/data
```
  1. Start a container by mounting data directory and specifying the custom configuration file:
```sh
docker run -d -p 9200:9200 -p 9300:9300 -v <data-dir>:/data dockerfile/elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.yml
```

After few seconds, open http://<host>:9200 to see the result.

elasticsearch's People

Contributors

3h4x avatar andrewrothstein avatar benjamin-smith avatar drags avatar gabegorelick avatar ipmb avatar iwag avatar jasonkuhrt avatar jlgeering avatar neil-rubens avatar pilwon avatar pires avatar reminyborg avatar shreyaskarnik avatar tracker1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elasticsearch's Issues

Interacting with container (attach) to add existing data to data folder

Hi. Thanks for setting this up.
I've been running your container using:
docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch

However, when I attach to the container, I have no prompt or ability to interact with the container, such as copying across an existing dataset to the data folder within the container. I experimented with removing the -d and using -i and -t settings thinking that might drop me into the filesystem when I attach, but that just causes errors such as:

docker run -name=elasticsearch -i -t -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch bin/bash
log4j:WARN No appenders could be found for logger (node).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Any suggestions on what the right form of the run command should include to give me this ability to interact with the ES container once running?

Thanks.

data and config mounts not working - container immediately terminates

Hi, I am on mac. The container immediately exits when I try to map to the data or config volumes as the instructions above suggest. I can map an arbitrary volume anywhere but these two locations. I tried copying the exact config files into my local config directory but it still fails. I also tried adding the -Des.config pointing to the location of the config file on the container but that fails too.

Fails

docker run --name es -d -p 9200:9200 -p 9300:9300 -v "$PWD"/config:/usr/share/elasticsearch/config elasticsearch

Fails

docker run --name es -d -p 9200:9200 -p 9300:9300 -v "$PWD"/data:/usr/share/elasticsearch/data elasticsearch

Runs but doesn't use correct config dir

docker run --name es -d -p 9200:9200 -p 9300:9300 -v "$PWD"/config:/config elasticsearch

I am not sure what the issue is.

cluster name

¿which is the best way to choose the cluster name?

root user

Is there any reason for running elasticsearch as root?

container not starting when attach persistent/shared directories

Hello,

When I follow the instructions as in https://github.com/dockerfile/elasticsearch/blob/master/README.md:
Attach persistent/shared directories

I am unable to start the container.

I use the following command:

docker run -p 9200:9200 -p 9300:9300 -v /Users/hilben/elastic_data/:/data elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.ym

My elasticsearch.yml:
path:
logs: /data/log
data: /data/data

I receive the following error:

/docker-entrypoint.sh: line 20: /elasticsearch/bin/elasticsearch: No such file or directory

This command was working for me previously (I assume that the recent change https://blog.docker.com/2015/03/updates-available-to-popular-repos-update-your-images/ changed something)

I am using:
Docker version 1.3.0, build c78088f
Boot2Docker-cli version: v1.3.0
Git commit: deafc19

Running on OS X 10.9.5

Can't set config mapping via JSON file

I'm having trouble setting up my config mapping as explained here. It works fine when I test it on my host machine, but when trying to apply it to my Elasticsearch container (running this base image), there is no effect. I think that I am placing the mapping file in the wrong directory in my container.

Here is what I have done:

  • In /usr/share/elasticsearch/config add directories /mappings/test
  • Create mapping JSON file for type "item" and place in /usr/share/elasticsearch/config/mappings/test
{
  "item" : {
    "properties" : {
      "title" : {
        "type" :    "string",
        "analyzer": "english"
      }
    }
  }
}
  • Make sure index doesn't exist already, then insert a document to instantiate index and type.

After doing this, inspecting the index "test" shows that it is still using the default mappings.

{
  "test" : {
    "mappings" : {
      "item" : {
        "properties" : {
          "title" : {
            "type" : "string"
          }
        }
      }
    }
  }
}

I'm pretty sure I'm putting my mapping file in the wrong directory. I've also tried creating the mappings directory in /etc/elasticsearch to no avail. How can I fix this?

Not able to PUT to ES

I installed Grafana and ES. Both in a Docker.

When I try to save a Grafana dashboard I get this error in Chrome:


XMLHttpRequest cannot load http://192.168.59.103:9200/grafana-dash/dashboard/grafana. Method PUT is not allowed by Access-Control-Allow-Methods.

I added these configs to my elasticsearch.yml

http.cors.allow-origin: "*"
http.cors.allow-methods: "OPTIONS, HEAD, GET, POST, PUT, DELETE"

Someone has any idea what I'm doing wrong? My apache where Grafana is running should also have correct headers.

Elasticsearch GUI plugin

It should be great if you add Elasticsearch GUI installation in the docker image.
Actually I have to instal successfully the gui in the running container entering in the container:

docker exec -it build_elasticsearch_1 bash
root@91cb5674cfb3:/# plugin --install jettro/elasticsearch-gui     
-> Installing jettro/elasticsearch-gui...
Trying https://github.com/jettro/elasticsearch-gui/archive/master.zip...
Downloading ...................................................................................................................................................................................................................................................................................................................DONE
Installed jettro/elasticsearch-gui into /usr/share/elasticsearch/plugins/gui
Identified as a _site plugin, moving to _site structure ...
root@91cb5674cfb3:/# exit

Thanks
Regards
Gianluca

old data in data dir not showing in elasticsearch indices

Migrating from the old /data location to /usr/share/elasticsearch/data so I changed my mount points (-v /data:/usr/share/elasticsearch/data) I can see one index (.kibana), and was able to create another (customer) like in the example ES docs

curl -XPUT 'localhost:9200/customer?pretty'

and customer and .kibana now show in my data dir, but how to get elastic search to once again recognize the logstash indices?

 root@fef0aed8a3c7:/usr/share/elasticsearch/data/elasticsearch/nodes/0/indices# ls -al
total 204
drwxr-xr-x 51 elasticsearch elasticsearch 4096 May 22 16:47 .
drwxr-xr-x  4 elasticsearch elasticsearch 4096 May 20 05:05 ..
drwxr-xr-x  4 elasticsearch elasticsearch 4096 Mar 29 05:56 .kibana
drwxr-xr-x  8 elasticsearch elasticsearch 4096 May 22 16:47 customer
drwxr-xr-x  5 elasticsearch elasticsearch 4096 Mar 29 06:10 logstash-2015.03.29
drwxr-xr-x  8 elasticsearch elasticsearch 4096 Mar 29 23:54 logstash-2015.03.30

truncated the rest of that ls -la

yet only the two indices show:

 curl 'localhost:9200/_cat/indices?v'
health status index    pri rep docs.count docs.deleted store.size pri.store.size 
yellow open   .kibana    1   1          1            0      2.5kb          2.5kb 
yellow open   customer   5   1          0            0       575b           575b

docker image elasticsearch/elasticsearch:5.4.2 not found

Straight from your docs:

The Docker image can be retrieved with the following command:
docker pull docker.elastic.co/elasticsearch/elasticsearch:5.4.2

Which gives:

➤  docker pull docker.elastic.co/elasticsearch/elasticsearch:5.4.2
Pulling repository docker.elastic.co/elasticsearch/elasticsearch
Error: image elasticsearch/elasticsearch:5.4.2 not found

5.4.1 works but not 5.4.2.

Am I going mad or does one of your 4 main ways of installing elastic search currently not work?

Image registry gone

Looks like they moved the java image.

You can pull openjdk:8

FROM openjdk:8

Access elasticsearch from a browser

After starting the docker file, docker ps shows

eff7c648dfe3 nickstenning/elasticsearch-icu "/docker-entrypoint.s" 7 seconds ago Up 6 seconds 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp

However, http://0.0.0.0:9200 and localhost:9200 refused to connect.

Tag releases with version (e.g. dockerfile/elasticsearch:1.3.1)

Would be very useful to have numbered version tags in line with elasticsearch versions. i.e.:

dockerfile/elasticsearch:1.3.1
dockerfile/elasticsearch:1.2.3

Right now I am using elasticsearch in a scala project and the client library hasn't updated itself. Which is fine, except I can't build anything except the latest version of elasticsearch, which now means I have to reference images by hashes now, not the ideal solution.

I don't know if this is possible by just adding tags on github, or by possibly tagging the hashes on dockerhub.

elasticsearch can't get data from mongodb

I had install mongodb river and head plugin in the docker.
When i execute the following code, it can't synchronize data from mongodb.
But it can work well not use docker.
Anybody get trouble ?

curl -XPUT 'http://127.0.0.1:9200/_river/mongodb_source/_meta' -d '{ "type": "mongodb", "mongodb": { "db": "andes", "collection": "source", "host": "192.168.90.46", "port": "27017" }, "index": { "name": "mongoindex_source", "type": "source" } }'

Can't found?

~$ docker pull dockerfile/elasticsearch
Pulling repository dockerfile/elasticsearch
FATA[0005] Error: image dockerfile/elasticsearch:latest not found

Issue with writing to /usr/share/elasticsearch/data/elasticsearch

Unable to launch elasticsearch container when trying to mount data to volume using Docker version 1.6.2, build 7c8fca2.

Simple example as shown in docs:

docker run -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch

returns error (in this case I was using boot2docker):

- ElasticsearchIllegalStateException[Failed to obtain node lock, is the following location writable?: [/usr/share/elasticsearch/data/elasticsearch]]
    IOException[failed to obtain lock on /usr/share/elasticsearch/data/elasticsearch/nodes/49]
        IOException[Cannot create directory: /usr/share/elasticsearch/data/elasticsearch/nodes/49]

I also had tried similar command on centos 7 and get similar error (always goes back to the inability to write).

I had been running similar container run command with Docker version 1.5.0-dev, build fc0329b/1.5.0 a week or so ago - and had no problems.

Anyone seen this in recent docker builds?

Have ES give back CORS headers.

I was running into a situation where I needed ES to give back a Access-Control-Allow-Origin header. All I had to do was add a config for ES, but I'm assuming this wouldn't ideal for most use cases to let it be so open to the world by default. Do you have any thoughts?

Update Elasticsearch to v 5.4

JUST change Dockerfile for Update to V5.4

# https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz
ENV ELASTICSEARCH_VERSION 5.4.0
ENV ELASTICSEARCH_TARBALL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz" \
	ELASTICSEARCH_TARBALL_ASC="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz.asc" \
	ELASTICSEARCH_TARBALL_SHA1="880b115be755a923f25aea810e3386ccb723cc55"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.