elastic search

Elasticsearch

Install JDK

sudo apt-get install openjdk-7-jre

java -version

Install elasticsearch

wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.2.deb

sudo dpkg -i elasticsearch-1.7.2.deb

Make sure elasticsearch starts and stops automatically

sudo update-rc.d elasticsearch defaults

Is it working?

This will list cluster name, version, etc

curl -XGET 'localhost:9200' 

Kibana

Install

wget https://download.elastic.co/kibana/kibana/kibana-4.6.1-amd64.deb

sudo dpkg -i kibana-4.6.1-amd64.deb

sudo update-rc.d kibana defaults

sudo service kibana start

curl -XGET 'localhost:5601'

Getting started

Download Shakespeare data set

wget https://www.elastic.co/guide/en/kibana/3.0/snippets/shakespeare.json

wget https://github.com/bly2k/files/blob/master/accounts.zip

unzip accounts.zip

Setup mapping for the Shakespeare data set, accounts doesn’t require a mapping.

Bulk load into elasticsearch

curl -XPOST 'localhost:9200/shakespeare/_bulk?pretty' --data-binary @shakespeare.json
curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json

Verify bulk load

curl 'localhost:9200/_cat/indices?v'

ELK Stack Arduino

Docker

docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch -p 9200:9200

docker ps

docker exec -it ac10fbffff12 bash

curl -XGET 'localhost:9200'