Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Dependencies

Tom Janssens edited this page Jan 14, 2015 · 5 revisions

Ruby Gems

Initially, the installation of Capistrano is easy, just execute these commands:

sudo gem install capistrano sudo gem install newrelic_rpm

The first line will install Capistrano, the second command installs New Relic support.

Elasticsearch

Installing

Follow these steps to install Elasticsearch 1.2 with Java 1.7 on our CentOS 5.9 servers:

Install Java 1.7

cd /opt/
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-linux-i586.tar.gz"
tar -xzf jdk-7u60-linux-i586.tar.gz
rm jdk-7u60-linux-i586.tar.gz
/usr/sbin/alternatives --install /usr/bin/java java /opt/jdk1.7.0_60/bin/java 2
/usr/sbin/alternatives --config java

Test with** java -version**. All that's left to do is setup the environment variables in /etc/profile.d/police.sh :

export JAVA_HOME=/opt/jdk1.7.0_60
export JRE_HOME=/opt/jdk1.7.0_60/jre
export PATH=$PATH:/opt/jdk1.7.0_60/bin:/opt/jdk1.7.0_60/jre/bin

Install Elasticsearch 1.2

cd /opt/
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.1.tar.gz
tar -xzf elasticsearch-1.2.1.tar.gz
rm elasticsearch-1.2.1.tar.gz
mv elasticsearch-1.2.1 elasticsearch

Now install ES as a service:

cd /tmp/ 
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
mv elasticsearch-elasticsearch-servicewrapper-4943d5a/service /opt/elasticsearch/bin/
rm -rf /tmp/elasticsearch-elasticsearch-servicewrapper-4943d5a/
/opt/elasticsearch/bin/service/elasticsearch install
/sbin/chkconfig elasticsearch on
/sbin/chkconfig --list | grep elasticsearch # Check if it's registered to start on boot

Make the following changes in /opt/elasticsearch/config/elasticsearch.yml:

cluster.name: elasticsearch-production or elasticsearch-staging
node.name: "police-001"
path.logs: /var/log/elasticsearch/
path.data: /var/data/elasticsearch

Start ES and check if it's running :

/sbin/service elasticsearch restart
tail -f /var/log/elasticsearch/elasticsearch.log # See if the log is receiving input
http_proxy='' curl 'http://127.0.0.1:9200/?pretty' -i # Check if the service is running and ready.
Now apply the *.mapping files in the *<repo>/install/custom/elasticsearch/* folder to set everything up and start indexing!

Useful links:

Clone this wiki locally