Giter Club home page Giter Club logo

docker-elasticsearch's Introduction

ElasticSearch on Docker

This Dockerfile creates a Docker image that can be used as the base for running ElasticSearch within a Docker container. It uses the ElasticSearch ZooKeeper discovery plugin instead of the standard Zen multicast discovery to allow for proper operation in PaaS/IaaS/cloud environments that are multicast-hostile. The run script is responsible for creating the ElasticSearch configuration based on the container's environment and starting the ElasticSearch service.

The version of ElasticSearch used is defined in the Dockerfile and generally points to the latest stable release of ElasticSearch.

Environment variables

The following environment variables are understood by the startup script to seed the service's configuration:

  • SERVICE_NAME should contain the logical name of the service this container is an instance of;

  • CONTAINER_NAME should contain the logical name of the container, which will be used for looking up links and ports informations from the other environment variables. For this, the name is uppercased and non-alphanumeric characters are replaced by underscores. The container name will also be used as the ElasticSearch node name;

  • CONTAINER_HOST_ADDRESS should contain the address of the Docker container's host. It's used by the ElasticSearch ZooKeeper-based discovery plugin as the advertised address for node discovery and is required for the container to start;

  • CLUSTER_NAME, the ElasticSearch cluster name, driving the cluster.name configuration setting. Defaults to local-elasticsearch;

  • ZOOKEEPER_BASE, the ZooKeeper base zNode path to be used by the discovery plugin. Defaults to /local/elasticsearch;

  • <SERVICE_NAME>_<CONTAINER_NAME>_PEER_PORT, the TCP port used by node-to-node communications, driving the transport.tcp.port setting. Defaults to 9300;

  • <SERVICE_NAME>_<CONTAINER_NAME>_HTTP_PORT, the HTTP port for the ElasticSearch REST API, driving the http.port setting. Defaults to 9200;

ElasticSearch depends on ZooKeeper for discovery. It thus expects the following environment variables for each ZooKeeper node to construct the node list: ZOOKEEPER_<ZK_NODE_NAME>_HOST and ZOOKEEPER_<ZK_NODE_NAME>_CLIENT_PORT.

Volumes

The ElasticSearch image uses the following volumes you may want to bind from the container's host:

  • /var/lib/elasticsearch, for the ElasticSearch indices storage.

Usage

To build a new image, simply run from this directory:

$ docker build -t `whoami`/elasticsearch:0.90.5 .

The Docker image will be built and now available for Docker to start a new container from:

$ docker images | grep elasticsearch
mpetazzoni/elasticsearch   0.90.5              aa4827a39a60        23 minutes ago      12.29 kB (virtual 890.2 MB)

docker-elasticsearch's People

Contributors

iantruslove avatar kpruden avatar mpetazzoni avatar nikicat avatar

Watchers

 avatar  avatar

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.