Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save denzuko/ec5421ec2d19268c92b4 to your computer and use it in GitHub Desktop.

Select an option

Save denzuko/ec5421ec2d19268c92b4 to your computer and use it in GitHub Desktop.
Commands for ElasticSearch installation on CentOS 6.4
VERSION={VERSION:0.90.5}
PLUGINS=(
mobz/elasticsearch-head
karmi/elasticsearch-paramedic
)
# install missing libraries (if any)
sudo yum update
sudo yum install java-1.7.0-openjdk.x86_64 unzip mc wget curl
# get and unpack elasticsearch zip file
cd /tmp
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${VERSION}.zip
trap "rm /tmp/elasticsearch-${VERSION}.zip" EXIT
unzip elasticsearch-${VERSION}.zip
sudo mv elasticsearch-0.90.5 /opt/elasticsearch
# install elasticsearch plugins
cd /opt/elasticsearch
echo ${PLUGINS[@]} | xargs -i ./bin/plugin -i {}
sudo ./bin/plugin -url http://bit.ly/GMYV9l -install river-jdbc
wget -O lib/mysql-connector-java-5.1.26-bin.jar http://qiiip.org/mysql-connector-java-5.1.26-bin.jar
# make elasticsearch runnable as a service
cd /tmp
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | sudo tar -xzf
mv *servicewrapper*/service /opt/elasticsearch/bin/
rm -Rf *servicewrapper*
sudo /opt/elasticsearch/bin/service/elasticsearch install
# set elasticsearch to run on boot
sudo /sbin/chkconfig elasticsearch on
# open port 9200 (for http) and 9300 (for tcp)
sudo iptables -L -n
sudo iptables -A INPUT -p tcp -m tcp --dport 9200 -j ACCEPT
sudo iptables -A INPUT -p tcp -m tcp --dport 9300 -j ACCEPT
sudo service iptables save
# set min max memory variables
eval $(ES_MIN_MEM="${ES_MIN_MEM:-5G}" | sudo tee -a /etc/environment)
eval $(ES_MAX_MEM="${ES_MIN_MEM:-5G}" | sudo tee -a /etc/environment)
# restart server
sudo service elasticsearch restart
tail -f /etc/elasticsearch/logs/elasticsearch.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment