Solr / Elasticsearch

This category contains everything around index searchers – SOLR, Elasticsearch, etc.


Install the latest Apache SOLR Build in a few minutes on Ubuntu/Debian

First install a Java runtime and needed utilities: apt-get update apt-get install openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib unzip lsof Then execute these as root: cd ~ wget http://www.eu.apache.org/dist/lucene/solr/5.5.4/solr-5.5.4.tgz tar xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh –strip-components=2 chmod +x install_solr_service.sh ./install_solr_service.sh solr-5.3.1.tgz Finally start Solr: service solr start You should now be able to access your server like this: http://localhost:8983/solr You […]


Shipping your Nginx logs to Elasticsearch using Logstash

First of all create a new log format in /etc/nginx/nginx.conf and add/replace an access log directive: log_format logstash ‘$http_host ‘ ‘$remote_addr [$time_local] ‘ ‘”$request” $status $body_bytes_sent ‘ ‘”$http_referer” “$http_user_agent” ‘ ‘$request_time ‘ ‘$upstream_response_time’; access_log /var/log/nginx/access.log logstash; Install Elasticsearch like described here. Install Logstash like described here. Add the following pattern to logstash in /opt/logstash/paggerns/nginx: NGUSERNAME […]


Setting up Logstash on Debian/Ubuntu

Install Logstash: cd /tmp wget https://download.elasticsearch.org/logstash/logstash/logstash-1.4.2.tar.gz tar -xvpf logstash-1.4.2.tar.gz mv logstash-1.4.2 /opt/logstash Create an init script /etc/init.d/logstash (this one worked fine for me on Ubuntu 14.04): #! /bin/sh ### BEGIN INIT INFO # Provides: logstash # Required-Start: $network $remote_fs $named $elasticsearch # Required-Stop: $network $remote_fs $named $elasticsearch # Default-Start: 2 3 4 5 # Default-Stop: […]


Install Elasticsearch on Debian/Ubuntu

Install Java: apt-get update apt-get install -y openjdk-8-jre openjdk-8-jre-headless On older Debian releases you may only find openjdk-7-jre openjdk-7-jre-headless instead. Add the repository and install Elasticsearch: wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add – apt-get install -y apt-transport-https software-properties-common add-apt-repository “deb https://artifacts.elastic.co/packages/5.x/apt stable main” apt-get update apt-get install -y elasticsearch On older Debian releases […]


Installing a 3 node Zookeeper Ensemble

First install the packages: apt-get install zookeeper zookeeper-bin zookeeperd As Zookeeper is launched using Java, you may want to update the Java options in /etc/default/zookeeper, for example: JAVA_OPTS="-Xms1024M -Xmx1024M -noverify -Duser.timezone=GMT+1" This would assign 1GB of RAM to the JVM for Zookeeper and set the timezone in Java to GMT+1. There are more options, this […]


Installing an Elasticsearch Cluster with 2 Nodes

Download the latest version of Elasticsearch from here and unpack it to /opt: cd /opt wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.4.tar.gz tar -xvpf elasticsearch-1.3.4.tar.gz ln -s elasticsearch-1.3.4 elasticsearch Given you want to create a cluster named my-ecs-cluster, having 2 nodes with IP address 192.168.45.21 and 192.168.45.21 (change it according to your setup, you might also want to use hostnames instead of […]


Installing SOLR 4.9 with Tomcat 7 on Debian Wheezy

First of all, let's install Java: apt-get install openjdk-7-jre-headless Installing Tomcat: apt-get install tomcat7 tomcat7-admin You should now be able to open http://<your-ip>:8080/ in a web browser. Configuring Tomcat manager auth: The tomcat7-admin package comes with two web apps: Web Application Manager and Virtual Host Manager. For security reasons none of them are accessible by […]