Skip to content

Instantly share code, notes, and snippets.

@igorcosta
Created January 6, 2017 00:40
Show Gist options
  • Save igorcosta/e643f2a0a99c1b7b312d5167ca8cfffe to your computer and use it in GitHub Desktop.
Save igorcosta/e643f2a0a99c1b7b312d5167ca8cfffe to your computer and use it in GitHub Desktop.
Elastic Search install instructions
Elastic Search Setup guide for N OS
=============
Mac Install
-------
- Download last version http://www.elasticsearch.org/download/
- Extract in /usr/local/share/elasticsearch
- cd /usr/local/share/
- sudo chown -R root:wheel elasticsearch
- cd elasticsearch
- run start command : sudo bin/elasticsearch -f
- try to access to http://localhost:9200/ (you must have something like {ok: true,status: 200, ...)
- ES is ready !
Ubuntu Install
--------------
- install java : sudo apt-get install openjdk-7-jre-headless -y --force-yes
- go to your downloads folder : cd ~/download # or as you want
- download elasticsearch : wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.5.deb
- install package : sudo dpkg -i elasticsearch-0.90.5.deb
- start ES : sudo service elasticsearch start
- EASY !
Install plugin JDBC (for mysql)
-------------------
- ./bin/plugin -install river-jdbc -url http://bit.ly/1iovWV9
- Download mysql java connector on http://dev.mysql.com/downloads/connector/j/
- copy .jar in elasticsearch/plugins/river-jdbc
- !RESTART ElasticSearch!
- You can have a connexion problem between Java and mysql ->
- Go to your mysql conf file (/etc/mysql/my.conf)
- remove line "skip-external-locking" to allow remote access (like java)
Plugin on Ubuntu
----------------
- the elasticsearch folder is in /usr/share/elasticsearch
- it's the same syntax to install a plugin
- So go to your elasticsearch folder:
- sudo bin/plugin -install river-jdbc -url http://bit.ly/1iovWV9
- don't forget to copy jdbc connector .jar in plugins/river-jdbc
- sudo bin/plugin -install mobz/elasticsearch-head
Divers
======
- Stop cluster with API : curl -XPOST 'http://localhost:9200/_shutdown'
- Install plugin head (graphical interface): ./bin/plugin -install mobz/elasticsearch-head
- search :
- All documents : curl -XGET 'http://localhost:9200/index/type/_search?q=word'
- field : curl -XGET 'http://localhost:9200/index/type/_search?q=field:value'
- key word : curl -XGET 'http://localhost:9200/index/type/_search?q=wor*'
- approximately equal to the key word : curl -XGET 'http://localhost:9200/index/type/_search?q=worrd~'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment