Skip to content

Instantly share code, notes, and snippets.

@Karmak23
Forked from ricardo-rossi/ElasticSearch.sh
Last active August 28, 2015 09:44
Show Gist options
  • Save Karmak23/d3c7b99f91ae1f9314ab to your computer and use it in GitHub Desktop.
Save Karmak23/d3c7b99f91ae1f9314ab to your computer and use it in GitHub Desktop.

Revisions

  1. @ricardo-rossi ricardo-rossi revised this gist Aug 28, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #!/bin/bash

    ### USAGE
    ###
    ### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
  2. @ricardo-rossi ricardo-rossi revised this gist Mar 31, 2015. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    # USAGE
    #
    # ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
    # ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
    # ./ElasticSearch.sh will fail because no version was specified (exit code 1)
    #
    # CLI options Contributed by @janpieper
    # Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
    ### USAGE
    ###
    ### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
    ### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
    ### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
    ###
    ### CLI options Contributed by @janpieper
    ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch

    ### ElasticSearch version
    if [ -z "$1" ]; then
    @@ -33,7 +33,7 @@ cd ~
    sudo apt-get update
    sudo apt-get install openjdk-7-jre-headless -y

    # To use Java 8 instead, uncomment the following two lines
    ### To install Java 8 instead, uncomment the following two lines
    # sudo update-java-alternatives -s java-8-oracle
    # sudo apt-get install oracle-java8-set-default

    @@ -57,7 +57,7 @@ sudo service elasticsearch start
    curl http://localhost:9200

    ### Should return something like this:
    #{
    # {
    # "status" : 200,
    # "name" : "Storm",
    # "version" : {
    @@ -68,7 +68,7 @@ curl http://localhost:9200
    # "lucene_version" : "4.9"
    # },
    # "tagline" : "You Know, for Search"
    #}
    # }



  3. @ricardo-rossi ricardo-rossi revised this gist Mar 31, 2015. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,11 @@
    ###
    # ElasticSearch.sh -- USAGE
    # USAGE
    #
    # ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
    # ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
    # ./ElasticSearch.sh will fail because no version was specified (exit code 1)
    #
    # CLI options Contributed by @janpieper
    # Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
    ###

    ### ElasticSearch version
    if [ -z "$1" ]; then
  4. @ricardo-rossi ricardo-rossi revised this gist Mar 31, 2015. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,12 @@
    ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
    ### USAGE
    ###
    # ElasticSearch.sh -- USAGE
    #
    # ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
    # ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
    # ./ElasticSearch.sh will fail because no version was specified (exit code 1)
    #
    # CLI options Contributed by @janpieper
    # Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
    ###

    ### ElasticSearch version
    @@ -32,7 +34,11 @@ fi
    cd ~
    sudo apt-get update
    sudo apt-get install openjdk-7-jre-headless -y


    # To use Java 8 instead, uncomment the following two lines
    # sudo update-java-alternatives -s java-8-oracle
    # sudo apt-get install oracle-java8-set-default

    ### Download and Install ElasticSearch
    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.deb
    sudo dpkg -i elasticsearch-${ELASTICSEARCH_VERSION}.deb
  5. @ricardo-rossi ricardo-rossi revised this gist Mar 31, 2015. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,11 @@
    ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
    ### USAGE
    # ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
    # ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
    # ./ElasticSearch.sh will fail because no version was specified (exit code 1)
    #
    # CLI options Contributed by @janpieper
    ###

    ### ElasticSearch version
    if [ -z "$1" ]; then
  6. @ricardo-rossi ricardo-rossi revised this gist Mar 31, 2015. 1 changed file with 26 additions and 4 deletions.
    30 changes: 26 additions & 4 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,34 @@
    ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch

    ### ElasticSearch version
    if [ -z "$1" ]; then
    echo ""
    echo " Please specify the Elasticsearch version you want to install!"
    echo ""
    echo " $ $0 1.5.0"
    echo ""
    exit 1
    fi

    ELASTICSEARCH_VERSION=$1

    if [[ ! "${ELASTICSEARCH_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
    echo ""
    echo " The specified Elasticsearch version isn't valid!"
    echo ""
    echo " $ $0 1.5.0"
    echo ""
    exit 2
    fi

    ### Install OpenJDK
    cd ~
    sudo apt-get update
    sudo apt-get install openjdk-7-jre-headless -y

    ### Download and Install ElasticSearch
    ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb
    sudo dpkg -i elasticsearch-1.3.1.deb
    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.deb
    sudo dpkg -i elasticsearch-${ELASTICSEARCH_VERSION}.deb

    ### Install the Java Service Wrapper for ElasticSearch
    curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
  7. @ricardo-rossi ricardo-rossi revised this gist Aug 6, 2014. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,14 @@
    ### Install OpenJDK

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

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

    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb
    sudo dpkg -i elasticsearch-1.3.1.deb

    ### Install the Java Service Wrapper for ElasticSearch

    curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
    sudo mkdir /usr/local/share/elasticsearch
    sudo mkdir /usr/local/share/elasticsearch/bin
    @@ -21,11 +18,9 @@ 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

    ### Start ElasticSearch

    sudo service elasticsearch start

    ### Make sure service is running

    curl http://localhost:9200

    ### Should return something like this:
  8. @ricardo-rossi ricardo-rossi revised this gist Aug 6, 2014. 1 changed file with 18 additions and 1 deletion.
    19 changes: 18 additions & 1 deletion ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,23 @@ sudo ln -s `readlink -f /usr/local/share/elasticsearch/bin/service/elasticsearch

    sudo service elasticsearch start

    ### Test that service is running
    ### Make sure service is running

    curl http://localhost:9200

    ### Should return something like this:
    #{
    # "status" : 200,
    # "name" : "Storm",
    # "version" : {
    # "number" : "1.3.1",
    # "build_hash" : "2de6dc5268c32fb49b205233c138d93aaf772015",
    # "build_timestamp" : "2014-07-28T14:45:15Z",
    # "build_snapshot" : false,
    # "lucene_version" : "4.9"
    # },
    # "tagline" : "You Know, for Search"
    #}



  9. @ricardo-rossi ricardo-rossi revised this gist Aug 6, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,8 @@ sudo dpkg -i elasticsearch-1.3.1.deb
    ### Install the Java Service Wrapper for ElasticSearch

    curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
    sudo mkdir /usr/local/share/elasticsearch
    sudo mkdir /usr/local/share/elasticsearch/bin
    sudo mv *servicewrapper*/service /usr/local/share/elasticsearch/bin/
    rm -Rf *servicewrapper*
    sudo /usr/local/share/elasticsearch/bin/service/elasticsearch install
  10. @ricardo-rossi ricardo-rossi revised this gist Aug 6, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,5 @@ sudo ln -s `readlink -f /usr/local/share/elasticsearch/bin/service/elasticsearch
    sudo service elasticsearch start

    ### Test that service is running

    curl http://localhost:9200
  11. @ricardo-rossi ricardo-rossi revised this gist Aug 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,4 @@ sudo ln -s `readlink -f /usr/local/share/elasticsearch/bin/service/elasticsearch
    sudo service elasticsearch start

    ### Test that service is running
    ### curl http://localhost:9200
    curl http://localhost:9200
  12. @ricardo-rossi ricardo-rossi revised this gist Aug 6, 2014. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions ElasticSearch.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,26 @@
    ### Install OpenJDK

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

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

    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb
    sudo dpkg -i elasticsearch-1.3.1.deb

    ### Install the Java Service Wrapper for ElasticSearch

    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

    ### Start ElasticSearch

    sudo service elasticsearch start

    ### Test that service is running
    ### curl http://localhost:9200
  13. @ricardo-rossi ricardo-rossi renamed this gist Aug 6, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  14. @ricardo-rossi ricardo-rossi renamed this gist Aug 6, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  15. @ricardo-rossi ricardo-rossi revised this gist Aug 6, 2014. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@

    cd ~
    sudo apt-get update
    sudo apt-get install openjdk-7-jre-headless -y
    https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb

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

    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb
    sudo dpkg -i elasticsearch-1.3.1.deb

  16. @ricardo-rossi ricardo-rossi created this gist Aug 6, 2014.
    5 changes: 5 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@

    cd ~
    sudo apt-get update
    sudo apt-get install openjdk-7-jre-headless -y
    https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb