Developers Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


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
  1. Install Java
  2. Install Elasticsearch
  3. Configure your apps to use Elasticsearch
Step by step
  1. Get Java 1.8
    yum --enablerepo=clearos-core install java-1.8.0-openjdk
  2. Set Java 1.8 as default
    alternatives --config java
  3. Import public key
    rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch
  4. 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
  5. Install Elasticsearch (and follow instructions)
    yum install elasticsearch
  6. Configure Elasticsearch to automatically start during bootup
    chkconfig --add elasticsearch
  7. Reboot to test
    reboot
  8. Check if Elasticsearch is running with the following command
    curl localhost:9200
  9. 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
Long term
content/en_us/kb_elasticsearch.txt · Last modified: 2015/06/17 08:01 (external edit)

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Akb_elasticsearch&1713493887