Elasticsearch in a Box

Are you looking to get going with Elasticsearch as quickly as possible without having to worry about installing Java or Elasticsearch itself? Are you looking for a repeatable and automated mechanism for bringing up Elasticsearch instances for developmental and or testing purposes? While there’s certainly a number of Elasticsearch-as-a-platform service providers out there, there’s one other option: use Elasticsearch-in-a-box.

Elasticsearch-in-a-box is a freely available Vagrant base box. What that means is that you can quickly fire up and tear down an Elasticsearch environment with simple commands like vagrant up and vagrant destroy.

In order to use Elasticsearch-in-a-box, you first need to have Vagrant and VirtualBox installed. These two installations couldn’t be any easier. To install Vagrant, simply go to the downloads page and pick your target distribution. Vagrant provisions machines on top of virtual machine providers like VMWare, AWS, and VirtualBox. VirtualBox is free and easy to install – like Vagrant, simply go to the downloads section and pick your target platform.

Once you have both Vagrant and VirtualBox installed, you are two steps away from Elasticsearch-ing.

First, you need to add and initialize the Elasticsearch-in-a-box template. Go ahead and create a directory, like /projects/esinabox, change directories into it and execute this command:

This command will create a Vagrant definition named esinabox from the downloaded template

vagrant box add esinabox https://s3.amazonaws.com/coffers/esinabox.box

This command will download the Elasticsearch-in-a-box template. Once that completes (it’ll take a few moments depending on your connection), execute this command:

Vagrant init will create a VagrantFile

vagrant init 'esinabox'

This command will create a VagrantFile, which you can use to customize the Elasticsearch-in-a-box instance. By default, you shouldn’t need to do much, however, you can map network ports, install additional software via Bash, Chef, and Puppet at your discretion.

Next, fire up Elasticsearch-in-a-box like so:

Starting up Elasticsearch-in-a-box

vagrant up

Now that Elasticsearch-in-a-box is running locally on your machine, you can open up a new terminal and execute RESTful commands like normal because Elasticsearch is running on same ports: 9200 & 9300. So go ahead and execute some queries, like so:

Elasticsearch is up an running!

curl -XGET 'http://localhost:9200/_status?pretty=true'

And when you are done, go ahead and tear down the instance like so:

Destroying a VM instance

vagrant destroy -f

Wasn’t that easy? The Elasticsearch-in-a-box Vagrant template was built using Veewee. The base box is 64-bit Ubuntu 12.04 with Oracle’s Java 7 and Elasticsearch version 0.90.7.

If you’re looking for a quick and easy way to automatically provision Elasticsearch, then look no further and give Elasticsearch-in-a-box a try!
 

Reference: Elasticsearch in a Box 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.

Leave a Reply


seven × 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