10/25/2013 - 1:41 PM

Commands for ElasticSearch installation on CentOS 6.4

Commands for ElasticSearch installation on CentOS 6.4

# install missing libraries (if any)
cd ~
sudo yum update
yum install java-1.7.0-openjdk.x86_64
yum install unzip
yum install mc
yum install wget
yum install curl

# get and unpack elasticsearch zip file
cd /etc
mv elasticsearch-0.90.5 elasticsearch

# install elasticsearch plugins
cd elasticsearch/bin
./plugin -install mobz/elasticsearch-head
./plugin -install karmi/elasticsearch-paramedic
./plugin -url -install river-jdbc
cd /etc/elasticsearch/lib

# make elasticsearch runnable as a service
cd ~
curl -L | tar -xz
mv *servicewrapper*/service /etc/elasticsearch/bin/
rm -Rf *servicewrapper*
sudo /etc/elasticsearch/bin/service/elasticsearch install

# set elasticsearch to run on boot
sudo /sbin/chkconfig elasticsearch on
sudo /sbin/chkconfig --list

# open port 9200 (for http) and 9300 (for tcp)
sudo iptables -L -n
iptables -A INPUT -p tcp -m tcp --dport 9200 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 9300 -j ACCEPT
service iptables save

# set min max memory variables
export ES_MIN_MEM=5G
export ES_MAX_MEM=5G

# restart server
service elasticsearch restart
tail -f /etc/elasticsearch/logs/elasticsearch.log