Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dockeri.co License

elasticsearch

Dockerfiles for building Centos based elasticsearch images.

Supported tags and respective Dockerfile links

phenompeople/elasticsearch

Elasticsearch containers as a cluster without docker-compose

Since Elasticsearch runs inside a contianer we have to make following changes

  1. Docker networking hides the containers from the networking stack on the host machine. The problem is when you start elasticsearch, you have to host addresses. Either we have to publish all ports or update elasticsearch.yml with below settings, and define PUBLISH_IP as an environment variable.

    network.bind_host: 0.0.0.0
    network.publish_host: "${PUBLISH_IP}"
    
  2. Create/update sysctl configurations and Docker startup options to fix max_file_descriptions error during elasticsearch start up. /etc/sysconfig/docker with below values

    DAEMON_MAXFILES=1048576
    OPTIONS="--default-ulimit nofile=1024:65536"
    DAEMON_PIDFILE_TIMEOUT=10
    
  3. Create/update sysctl.d limits on host machine and update sysctl to reflect immediately

    vm.max_map_count=262144
    fs.file-max=100000
    
  4. Please define below variables during run time to replace default values, variables defined during run time will take the highest priority, each variable should be passed differently with option -e

Attribute name Default Value
ES_JAVA_OPTS -Xms2g -Xmx2g

Pre-Requisites

How to use this image

  1. This image can be used by simply running as a standalone elasticsearch host

$ docker run --name=elasticsearch -p 9200:9200 -v /etc/elasticsearch:/usr/local/elasticsearch/config -td phenompeople/elasticsearch

Above command runs elasticsearch container with port 9200 mapped to host and reading configuration files mapped under /etc/elasticsearch.

  1. In a multi node elasticsearch cluster, to make nodes to communicate each other publish 9300 also in-addition to above command

$ docker run --name=elasticsearch -p 9200:9200 -p 9300:9300 -v /etc/elasticsearch:/usr/local/elasticsearch/config -td phenompeople/elasticsearch

  1. To make image run even after reboot use extra option --restart=always

$ docker run --restart=always --name=elasticsearch --name=elasticsearch -p 9200:9200 -p 9300:9300 -v /etc/elasticsearch:/usr/local/elasticsearch/config -td phenompeople/elasticsearch

Maintainers

License and Authors

License: Apache License

Author : Phenompeople Pvt Ltd (admin.squad@phenompeople.com)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages