Elasticsearch
Elasticsearch is a flexible and powerful free / libre / open source, distributed, real-time search and analytics engine. It is super fast, RESTful, based on Apache Lucene and has a very high activity level: www.ohloh.net/p/elasticsearch
It is part of “The Elasticsearch ELK Stack”. The two other apps of the stack are:
- Logstash helps you take logs and other time based event data from any system and store it in a single place for additional transformation and processing.
- Kibana is Elasticsearch’s data visualization engine, allowing you to natively interact with all your data in Elasticsearch via custom dashboards.
It is also part of Tiki Suite
Assumption: you want to use Elasticsearch for data on a ClearOS instance to index data on the same server (ex.: with WordPress, Tiki, etc.). To have a more advanced setup (ex.: a cluster), please refer to the Elasticsearch documentation.
Big picture steps
- Install Java
- Install Elasticsearch
- Configure your apps to use Elasticsearch
- By default ClearOS 6.x installs Java 1.6.0_30 and Elasticsearch 1.2 requires requires Java 7, so we'll get latest stable versions below.
Step by step
- Get Java 1.8
yum --enablerepo=clearos-core install java-1.8.0-openjdk
- Set Java 1.8 as default
alternatives --config java
- Import public key
rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch
- create /etc/yum.repos.d/elasticsearch.repo with the following snippet
[elasticsearch-1.4] name=Elasticsearch repository for 1.4.x packages baseurl=http://packages.elasticsearch.org/elasticsearch/1.4/centos gpgcheck=1 gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch enabled=1
- Install Elasticsearch (and follow instructions)
yum install elasticsearch
- Configure Elasticsearch to automatically start during bootup
chkconfig --add elasticsearch
- Reboot to test
reboot
- Check if Elasticsearch is running with the following command
curl localhost:9200
- Make sure example.org:9200 does not answer. If it does, you need to activate the firewall. It's important to add security (by default, it's wide open). See Elasticsearch documentation.
Here is an example of a working Elasticsearch instance.
[root@example ~]# curl localhost:9200 { "status" : 200, "name" : "Norrin Radd", "cluster_name" : "elasticsearch", "version" : { "number" : "1.4.4", "build_hash" : "c88f77ffc81301dfa9dfd81ca2232f09588bd512", "build_timestamp" : "2015-02-19T13:05:36Z", "build_snapshot" : false, "lucene_version" : "4.10.3" }, "tagline" : "You Know, for Search" }
Todo
- Setup monitoring (Especially how much RAM it is using)
- Add support for Elasticsearch to index Flexshares (and make available to apps such as Tiki, etc.)
Long term
- Add support for Elasticsearch to index emails from IMAP
- Make an official Elasticsearch app for ClearOS.
Related links
content/en_us/kb_elasticsearch.txt · Last modified: 2015/06/17 08:01 (external edit)