Deployment of Elasticsearch to Amazon

Deployment of Elasticsearch to Amazon
by Darren Jensen | Programming | September 2015


Install Oracle Java

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java7-installer

Install the deb package for Elasticsearch:


sudo dpkg -i elasticsearch-1.5.2.deb

Open the elasticsearch config file

sudo nano /etc/elasticsearch/elasticsearch.yml

add the following line:

script.disable_dynamic: true

install the attachment type plugin

cd /usr/share/elasticsearch

sudo bin/plugin install elasticsearch/elasticsearch-mapper-attachments/2.5.0

Follow this (change numbers based on available RAM):

sudo nano /etc/security/limits.conf and add:

elasticsearch hard memlock 100000

sudo nano /etc/init.d/elasticsearch

Change ES_HEAP_SIZE to 10-20% of your machine, I used 128m

Change MAX_LOCKED_MEMORY to 100000  (~100MB)

Change ES_JAVA_OPTS to "-server"

set the following in /etc/elasticsearch/elasticsearch.yml

bootstrap.mlockall: true

add the following to /etc/default/elasticsearch


add the following to ~/.bash_profile

export ES_MIN_MEM=256m

export ES_MAX_MEM=800m

restart elasticsearch

sudo service elasticsearch restart

Configure ElasticSearch on a single shared host by deactivating replication and limiting memory usage

about Rotati

Rotati is a full service Web and Mobile application consultancy. We use Ruby and JavaScript as our tools of choice.