Skip to content

Instantly share code, notes, and snippets.

@tomasol
Created March 2, 2012 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomasol/1959192 to your computer and use it in GitHub Desktop.
Save tomasol/1959192 to your computer and use it in GitHub Desktop.
Elastic Search on ec2
Elastic Search on ec2
ami: Ubuntu 11.10 Oneiric EBS boot Canonical ubuntu@ ami-a0ba68c9
apt-get install:
openjdk-7-jdk
xfsprogs
htop
create new ebs (20gb), mount as sdf
mkfs.xfs /dev/xvdf
mkdir -m 000 /storage
echo '/dev/xvdf /storage xfs noatime,nodiratime,noexec 0 0' | tee -a /etc/fstab
mount /storage
elasticsearch:
http://www.elasticsearch.org/guide/reference/setup/installation.html a https://gist.github.com/1190526
directory /usr/local/share/elasticsearch
useradd -s /bin/bash -d /storage/elasticsearch elasticsearch
create dir /storage/elasticsearch/piddir
vim /usr/local/share/elasticsearch/config/elasticsearch.yml :
path.data: /storage/elasticsearch/data
path.work: /storage/elasticsearch/work
path.logs: /storage/elasticsearch/logs
bootstrap.mlockall: true
vim /usr/local/share/elasticsearch/bin/service/elasticsearch.conf
set.default.ES_HOME=/usr/local/share/elasticsearch
set.default.ES_MIN_MEM=256
set.default.ES_MAX_MEM=256
wrapper.logfile=/storage/elasticsearch/work/logs/service.log
wrapper.java.additional.0=-server
vim /usr/local/share/elasticsearch/bin/service/elasticsearch
PIDDIR="/storage/elasticsearch/piddir"
RUN_AS_USER=elasticsearch
set limits according to https://gist.github.com/910301
sudo vim /etc/security/limits.conf
elasticsearch - nofile 32000
elasticsearch - memlock unlimited
sudo vim /etc/pam.d/su
session required pam_limits.so
service elasticsearch console alebo start
curl localhost:9200
swap:
sudo dd if=/dev/zero of=/var/swapfile bs=1M count=2048 &&
sudo chmod 600 /var/swapfile &&
sudo mkswap /var/swapfile &&
echo /var/swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab &&
sudo swapon -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment