Skip to content

Instantly share code, notes, and snippets.

@lepfhty
Last active August 29, 2015 13:59
Show Gist options
  • Save lepfhty/10498250 to your computer and use it in GitHub Desktop.
Save lepfhty/10498250 to your computer and use it in GitHub Desktop.
Copy this file and drop it in the top-level directory of your elasticsearch download. Edit the parameters at the top of the file. Make it executable `chmod +x es-install.sh`. Then run it `./es-install.sh`.
#!/bin/bash
ES_VERSION=0.90.10
ES_HOME=$PWD
ES_HEAP_SIZE=4096
ES_CLUSTER_NAME=elasticsearch
PLUGIN_LIST=(
'elasticsearch/elasticsearch-lang-javascript/1.4.0'
'elasticsearch/elasticsearch-mapper-attachments/1.9.0'
'com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/1.7.4'
'mobz/elasticsearch-head'
)
cd $ES_HOME/config
echo "cluster.name: $ES_CLUSTER_NAME" > tmp.yml
cat elasticsearch.yml >> tmp.yml
mv tmp.yml elasticsearch.yml
git clone git@github.com:elasticsearch/elasticsearch-servicewrapper.git
cd elasticsearch-servicewrapper
git checkout 0.90
cd $ES_HOME/bin
ln -f -s ../elasticsearch-servicewrapper/service/ service
sed -i -e '1s|<.*>|'"$ES_HOME"'|' service/elasticsearch.conf
sed -i -e '2s|=.*$|='"$ES_HEAP_SIZE"'|' service/elasticsearch.conf
for plugin in ${PLUGIN_LIST[@]}; do
./plugin --install $plugin
done
./service/elasticsearch restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment