Installation and running Elasticsearch sometimes can be problematic.

Especially when:

You didn’t use it before and want to have it fast i.e. for testing or experimenting You have a growing web application which relies on Elasticsearch and you are not experienced about configuring and scaling servers

I’ve prepared 5 ways how to run Elasticsearch. I hope this can be useful for beginners and even also for more experienced developers.

1. DigitalOcean + Docker

Choosing docker image on DigitalOcean

Pros

Extremely easy way to run Elasticsearch. It just requires a few very simple steps to make it working.

Resizing (CPU and RAM) and creating snapshots is very convenient

Relatively easy to migrate your docker to another host

Creating many Elasticsearch instances on one host with docker is effortless

Cons

I don’t see many cons. You need to have knowledge about servers and take care about maintaining and making backups on your own.

Installation

ssh [email protected]

docker run -p 9200:9200 elasticsearch:1.7.6

open http://your-new-ip-address:9200 to test it out

2. AWS Elasticsearch

Choosing domain and version for Elasticsearch in AWS

Configuring Elasticsearch cluster in Amazon Web Services

Pros

Scalable. You can choose how many instances you want and their size

Secure. You can control access to API by AWS Identity or Access Management (IAM) policies

Easy to run

Cons

Only 1.5 and 2.3 versions available of Elasticsearch

It is quite expensive. The smallest instance of 1 GB ram and 1 vCPU costs $0.018 per Hour so it is 13$ per Month

3. Elasticsearch with Ansible

Pros

It’s very very flexible, configurable and fully automated.

Ansible has very low learning curve in comparison to Chef or Puppet in terms of provisioninig

Cons

Requires knowledge about Ansible and managing linux system

Requires making maintenance and backups on your own

Installation

Make sure Ansible is installed in your localhost

ansible-playbook your-own-playbook.yml

More information there: https://github.com/elastic/ansible-elasticsearch

4. QBox Hosted Elasticsearch

Pros

It is very scalable and huge. You can have up to 512 GB Ram and 46 vCPU’s

4 regions available (USA, Europe, Australia and Asia)

24h/7 support and help for every customer

automatic backups

Cons

It is expensive. The instance of 1 GB ram and 1 vCPU costs $0.05/hr ($40.00/mo). This is 2.5x more expensive than AWS (on the smallest instance)

5. Manual installation on Ubuntu 14.04

Installation Elasticsearch 1.7.2 on Ubuntu

Pros

Having docker I don’t see any benefits here

Cons

Different installation commands on each linux distros.

Testing installation

Usually it is enough to open it in the browser i.e. http://localhost:9200 or make a request in CLI `curl -XGET http://localhost:9200`

Typical response:

Edit: 16 october 2017

The article was originally published here but it’s moving directly into https://www.itemsapi.com/blog/2016/11/29/how-to-install-elasticsearch/