Giter VIP home page Giter VIP logo

elasticsearch-deployment's Introduction

Elasticsearch deployment with ansible

Playbook for elasticsearch cluster deployment using ansible with ssl transport enabled.

Tested on ansible 2.8.1, python version = 3.6.8

Deployment steps:

  1. Install required roles:

     $ ansible-galaxy install -r requirements.yml
    
  2. Copy and change inventory.sample.yml file:

     $ cp inventory.sample.yml inventory.yml
    
  3. Deploy elasticsearch master servers:

     $ ansible-playbook -i inventory.yml pb.es-master.yml
    
  4. Deploy elasticsearch data servers:

     $ ansible-playbook -i inventory.yml pb.es-data.yml
    
  5. Credentials are created in new directory called ./credentials while deploying.

  6. Generate ssl certificates.

    Now elasticsearch should start successful but after first restart it will fail because x-pack security feature is enabled but ssl transport is not configured which is required starting from basic license.

    Note: at the moment the used elasticsearch role does not provide any way to generate and use ssl certificates automatically, that's why we should do in manually.

    See the "Transport TLS/SSL encryption" part in Elasticsearch Security: Configure TLS/SSL & PKI Authentication for details.

  7. Next, you should create local ./certs directory and copy newly created elastic-certificates.p12 and elastic-stack-ca.p12 files into it.

  8. After that, stop all your elasticsearch nodes by running:

    Note: check that all_nodes variable is configured properly in inventory.yml file.

     $ ansible-playbook -i inventory.yml pb.es-stop.yml
    
  9. Copy certificates from local directory to all elasticsearch nodes:

     $ ansible-playbook -i inventory.yml pb.es-cp-certs.yml
    
  10. Enable ssl transport:

     $ ansible-playbook -i inventory.yml pb.es-enable-ssl.yml
    
  11. Now when the configuration is done, start your elasticsearch nodes.

    Note: Here could be some transport issues. I've solved them by starting master nodes one by one, and after that I've started all data nodes by manipulating inventory file and running:

     $ ansible-playbook -i inventory.yml pb.es-start.yml
    

elasticsearch-deployment's People

Contributors

icamys avatar

Watchers

 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.