Tuesday, March 25, 2014

How to Install Elasticsearch


  1. install elasticsearch

  2. cd ~
    sudo apt-get update
    sudo apt-get install openjdk-7-jre-headless -y


    Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below

  3. NEW WAY / EASY WAY
  4. I personally prefer this type of install, it's simple, yet include a service wrapper. The configure file is located in /etc/elasticsearch
    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.5.deb
    sudo dpkg -i elasticsearch-0.90.5.deb
    sudo service elasticsearch start

  5. OLD WAY / HARD WAY
  6. wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.tar.gz
    tar -xf elasticsearch-0.90.0.tar.gz
    rm elasticsearch-0.90.0.tar.gz
    sudo mv elasticsearch-* elasticsearch
    sudo mv elasticsearch /usr/local/share

    curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
    sudo mv *servicewrapper*/service /usr/local/share/elasticsearch/bin/
    rm -Rf *servicewrapper*
    sudo /usr/local/share/elasticsearch/bin/service/elasticsearch install
    sudo ln -s `readlink -f /usr/local/share/elasticsearch/bin/service/elasticsearch` /usr/local/bin/rcelasticsearch

  7. START SERVICE
  8. sudo service elasticsearch start
    curl http://localhost:9200

  9. CONFIGURATION
  10. Usually we need to configure the Cluster Name and Node Name in /etc/elasticsearch/elasticsearch.yml,as in the same local network, the servers with the same cluster name will be joined together, and a simple and fixed node name is easier for maintenance.

2 comments: