Git Product home page Git Product logo

docker-elasticsearch's Introduction

docker-elasticsearch

Build Status Ansible Galaxy

Ansible role to manage and run the elasticsearch docker container.

Requirements

This role has only been tested on Ubuntu 14.04. Since this uses Ansible's docker module, you will need to ensure that a recent-ish version of docker-py and docker are installed.

Examples

Install this module from Ansible Galaxy into the './roles' directory:

ansible-galaxy install wangsha.docker-elasticsearch -p ./roles

Use it in a playbook as follows, assuming you already have docker setup:

- hosts: 'servers'
  roles:
    - role: angstwad.docker_ubuntu
      become: true
    - role: wangsha.docker-elasticsearch
      become: true

Have a look at the defaults/main.yml for role variables that can be overridden.

If you need a playbook to set Docker itself, have a look at angstwad.docker_ubuntu Galaxy role.

Performance Tuning

To enable mlockall on docker container, follow this post to configure docker deamon. Top section of the file /etc/init/docker.conf looks like:

description "Docker daemon"

start on (filesystem and net-device-up IFACE!=lo)
stop on runlevel [!2345]
limit nofile 524288 1048576
limit nproc 524288 1048576
limit memlock unlimited unlimited
respawn

...

Custom volume mappings

Docker allows mounting a host directory or a host file as data volume. This role mounts host directories to persist container data and host files to configure container behavior. docker_elasticsearch_directory_volumes and docker_elasticsearch_file_volumes are the two variables to control volume mappings. If you wish to customize the mapping, please follow <host directory>:<container directory>:<mapping mode> format to ensure host directories are correctly created before launching containers.

To customize host file mappings, update docker_elasticsearch_file_volumes. This role will automatically create file parent directories and copy the template to host machine. The naming convention for template is <host_file_name>.<host_file_extension>.j2. To copy template from your own ansible diretories, set docker_elasticsearch_template_path.

Example Config:

docker_elasticsearch_file_volumes:
  - '/opt/myapp/conf/settings.conf:/etc/myapp/conf/settings.conf:ro'
docker_elasticsearch_template_path: /path/to/ansible/project/templates/
# make sure file /path/to/ansible/project/templates//settings.conf.j2 exists. 

Additional References

License

MIT

Author Information

  • wangsha

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.