Giter VIP home page Giter VIP logo

elasticsearch-beanstalk's Introduction

ElasticSearch AWS Cluster

This project is the special configuration for AWS Elastic Beanstalk service. It uses empty java-8 service and installs proper ElasticSearch version during deployment stage.

Prerequisites

Make sure you have installed

Deployment

Init the EB application

$ eb init

Please remember that our default application name is elasticsearch-cluster

Configuration

Few environment variables have to be specified before deployment

  • CLUSTER_NAME: This is a name of your new shiny ElasticSearch cluster, please avoid use of elasticsearch name
  • AWS_KEY_ID: AWS Key ID
  • AWS_KEY: AWS Secret Key
  • AWS_REGION: Region in which ES cluster will be created
  • EC2_TAG_NAME: This value should be equal to the AWS Name tag (same as environment name)
  • MASTER_NODES: Amount of master nodes. The rule is simple, this number should equal to total number of nodes (N) divided by 2 plus 1. N / 2 + 1.
  • PORT: Should always be set to 9200, unless you changed ES http port

Usage of .env. file

See example in .env.example file

Create new cluster

You'll need to ensure you have an IAM Service Role for this.

In order to create new cluster you need to execute following bash commands

$ ENV_VARS=$(cat .env | xargs | sed -e 's/ /,/g' -e "s/XXXXXXXX/${AWS_ACCESS_KEY_ID}/g" -e "s/YYYYYYYY/${AWS_SECRET_ACCESS_KEY}/g")
$ eb create -c 2pventures-elasticsearch-staging --envvars ${ENV_VARS} --platform=java-8 -i m3.large --scale 4 elasticsearch-staging --service-role aws-elasticbeanstalk-elasticsearch-service-role

Where 2pventures-elasticsearch-staging is a CNAME; elasticsearch-staging is the environment name; m3.large is a instance type and --scale 4 is how many nodes to create

Configure AWS Security Groups

After environment is created you need to change AWS Security Group rules. You have to allow all 9300-9400 TCP and ICMP traffic within SG group.

Deploy changes

$ eb deploy elasticsearch-staging

Where elasticsearch-staging is a environment name

Important Notes

  • Do not scale down the cluster during peak times, this will cause cluster move shards around also some pending requests may fail
  • When adding new nodes to cluster some requests may fail
  • When added new nodes to cluster remember to change MASTER_NODES var

elasticsearch-beanstalk's People

Contributors

vladmiller avatar ifosch avatar rikard-swahn avatar

Watchers

Miguel Bernabeu Diaz avatar James Cloos 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.