GithubHelp home page GithubHelp logo

ansible-elasticsearch-ec2-example's Introduction

ansible-elasticsearch-ec2-example

Ansible playbook to spin up an Elasticsearch cluster on Amazon's EC2 platform


##Setup

1. Create a new EC2 Security Group

  • Amazon has a great walkthrough
  • Port 9300 should only be open to rest of the security group (Elasticsearch Transport Layer)
  • Port 9200 and/or Port 80 should be carefully restricted (Elasticsearch Command Layer)
  • Port 22 should be open (SSH Access)

2. Create and download an EC2 keypair

  • You can only download this once, and instances are locked to a key, be careful!

3. Install Ansible on your local machine

Configure

1. Edit the Ansible playbook

deploy_elasticsearch.yml

  • Insert your keypair name, instance type, security group, AMI image, and instance count

    keypair: EC2KEYPAIRNAME
    instance_type: t1.micro
    security_group: EC2SECURITYGROUPNAME
    image: AMINAME
    instance_count: 2

  • I used ami-c30360aa (Ubuntu 13.04 64-bit), but other Ubuntu images should work.

2. Edit the Elasticsearch configuration file

elasticsearch/elasticsearch.yml

  • Insert your AWS access key and secret key, and add any additional settings

##Run

1. Export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as variables to your shell

  • Calling source on a shell script is great for this

     >\#!/bin/bash    
     >export AWS_ACCESS_KEY_ID='AKIA123456781234567'  
     >export AWS_SECRET_ACCESS_KEY='123abcdefghijklmnopqrstuv'    
    

2. Run Ansible

  • Execute the following:

    ansible-playbook deploy_elasticsearch.yml -vv --private-key=/path/to/ec2/key

  • Make sure the key has permissions for only the current user!

3. Relax


####Quick fixes

  • If Ansible complains about the local host group not existing, you may need to add 127.0.0.1 under the [local] heading in your ansible hosts file.

ansible-elasticsearch-ec2-example's People

Contributors

pointshader avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.