Skip to content

Instantly share code, notes, and snippets.

@evadnoob
Forked from rajraj/es.sh
Last active December 19, 2015 00:39
Show Gist options
  • Save evadnoob/5869793 to your computer and use it in GitHub Desktop.
Save evadnoob/5869793 to your computer and use it in GitHub Desktop.
#sudo yum update
#sudo yum install java-1.7.0-openjdk.i686 -y
# java-1.7.0-openjdk-devel.x86_64
# sudo alternatives --config java
rm -rf elasticsearch-*/
curl -L https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz| tar xzv
ES_DIR=`ls -1d elasticsearch*/ | sed -n 1p`
echo $ES_DIR
sudo mkdir -p /usr/local/elasticsearch/
sudo cp -Rv ${ES_DIR%/}/* /usr/local/elasticsearch/
curl -L http://github.com/evadnoob/elasticsearch-servicewrapper/tarball/master | tar xzv
ES_SERVICE_WRAPPER_DIR=`ls -1d *elasticsearch-servicewrapper*/ | sed -n 1p`
echo $ES_SERVICE_WRAPPER_DIR
sudo cp -Rv ${ES_SERVICE_WRAPPER_DIR%/}/service /usr/local/elasticsearch/bin/
# used to use upstart, but the script expects USE_UPSTART, but overrides it internally, so you have to edit the file, done with that.
# So now we just use the default init.d
# you'll need to check the different systems, some use upstart, others use init.d.
# USE_UPSTART=1
sudo bash -c '/usr/local/elasticsearch/bin/service/elasticsearch install'
sudo start elasticsearch
## Elastic Search may fail to start, as they renamed a class;
https://github.com/elasticsearch/elasticsearch/issues/4634
## Application parameters. Add parameters as needed starting from 1
#wrapper.app.parameter.1=org.elasticsearch.bootstrap.ElasticSearchF
#Should be, lower case s:
#wrapper.app.parameter.1=org.elasticsearch.bootstrap.ElasticsearchF
#curl http://localhost:9200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment