ElasticSearch on EC2 in Less Than 60 Seconds

Curious to see what all the ElasticSearch hubbub is about? Wanna see it in action without a lot of elbow grease? Then look no further, friend – in less than 60 seconds, I’ll show you how to install ElasticSearch on an AWS AMI.

You’ll first need an AWS account along with an SSH key pair. If you don’t already have those two steps done, go ahead and do that. The steps that follow suggest a particular AMI; however, you are free to select the instance type. Micro instance types are free to use; consequently, you can get up and running with ElasticSearch in less than a minute for free. Now that you’ve got an AWS account and an SSH key pair, go ahead and create a new security group (or edit an existing one).
 
 
It’s important that the following ports are open:

  • 22 (required for SSH)
  • 80 (ElasticSearch uses HTTP for standard API calls)
  • 9200 (required for ElasticSearch)
  • 9300 (required for ElasticSearch)

Next, fire up a Linux AMI. I, for example, prefer ami-c30360aa (this is Ubuntu Server version 13.04) and I configure the AMI to use the security group that I just covered.

Now, SSH to your newly instantiated AMI. Once on the AMI, you’ll need to install Java. Never fear though, I’ve got you covered. All you need to do is run a handy script via the Ubuntu-Equip project, that I use frequently just for this sorta thing:

wget --no-check-certificate https://github.com/aglover/ubuntu-equip/raw/master/equip_java.sh && bash equip_java.sh

You’ll need to accept the license from Oracle. Once that script completes, go ahead and type java -version and you should see Oracle’s JDK (i.e Java version “1.7.0_21”).

Next, download and install ElasticSearch via another nifty Ubuntu-Equip script:

wget --no-check-certificate https://github.com/aglover/ubuntu-equip/raw/master/equip_elasticsearch.sh && bash equip_elasticsearch.sh

This script doesn’t start ElasticSearch for you; thus, go ahead and change directories into the elasticsearch directory and fire it up like so:

~/elasticsearch$ bin/elasticsearch -f

Take a deep breath (but not too deep, as I need you to finish in less than 60 seconds) and find the Public DNS of the AMI you’ve been working on. Go ahead and copy it, then fire up a browser on your local machine and go to http://YOUR_AMI_DNS_NAME.com:9200/_plugin/inquisitor/ (be sure to note the port).

By the way, Inquisitor is a handy web application that lets you query your indexes. It was installed via the Ubuntu-Equip script – this tool is invaluable in figuring out how to properly query your indexes.

And that is it. In less than 60 seconds you’ve got ElasticSearch running in the cloud for you. Want to create a cluster? No problem, just follow these steps again to fire up another ElasticSearch instance and then configure the cluster accordingly.

I’ve not gone over configuring ElasticSearch nor have I showed you how to create ElasticSearch as a service on a Linux instance, but for one minute, what do you expect?
 

Reference: ElasticSearch on EC2 in Less Than 60 Seconds from our JCG partner Andrew Glover at the The Disco Blog blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

One Response to "ElasticSearch on EC2 in Less Than 60 Seconds"

  1. adrianvanlan says:

    Hi, I did this you mention. You know how to install it as a service?.

    I await your response.

    thanks

Leave a Reply


five + 3 =



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close