Created
January 27, 2016 06:37
-
-
Save ragingbal/51883661e265942b3043 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export JAVA_HOME=/usr/local/java | |
JAVA_MIRROR_DOWNLOAD=https://www.reucon.com/cdn/java/jdk-8u51-linux-x64.tar.gz | |
ELASTICSEARCH_MIRROR_DOWNLOAD=https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/elasticsearch-2.1.1.tar.gz | |
KIBANA_MIRROR_DOWNLOAD=https://download.elastic.co/kibana/kibana/kibana-4.3.1-linux-x86.tar.gz | |
JAVA_ARCHIVE=jdk-8u51-linux-x64.tar.gz | |
ELASTICSEARCH_ARCHIVE=elasticsearch-2.1.1.tar.gz | |
KIBANA_ARCHIVE=kibana-4.3.1-linux-x86.tar.gz | |
function installExtras { | |
mkdir install_packages | |
sudo apt-get install -y unzip | |
sudo apt-get install -y git | |
} | |
function downloadJavaPackages { | |
curl -O $JAVA_MIRROR_DOWNLOAD | |
mv $JAVA_ARCHIVE install_packages/ | |
} | |
function downloadESPackages { | |
curl -O $ELASTICSEARCH_MIRROR_DOWNLOAD | |
mv $ELASTICSEARCH_ARCHIVE install_packages/ | |
curl -O $KIBANA_MIRROR_DOWNLOAD | |
mv $KIBANA_ARCHIVE install_packages/ | |
} | |
function installElastic { | |
echo "install elastic from local file" | |
FILE=~/install_packages/$ELASTICSEARCH_ARCHIVE | |
tar -xzf $FILE -C /usr/local | |
ln -s /usr/local/elasticsearch-2.1.1/ /usr/local/elasticsearch | |
} | |
function installKibana { | |
echo "install kibana from local file" | |
FILE=~/install_packages/$KIBANA_ARCHIVE | |
tar -xzf $FILE -C /usr/local | |
ln -s /usr/local/kibana-4.3.1-linux-x86/ /usr/local/kibana | |
} | |
function installLocalJava { | |
echo "installing oracle jdk" | |
FILE=~/install_packages/$JAVA_ARCHIVE | |
tar -xzf $FILE -C /usr/local | |
ln -s /usr/local/jdk1.8.0_51/ /usr/local/java | |
echo export JAVA_HOME=/usr/local/java >> ~/.bashrc | |
} | |
function updateProfile { | |
echo export JAVA_HOME=/usr/local/java >> ~/.bashrc | |
echo export ELASTICSEARCH_HOME=/usr/local/elasticsearch >> ~/.bashrc | |
echo export KIBANA_HOME=/usr/local/kibana >> ~/.bashrc | |
echo export PATH=\${KIBANA_HOME}/bin:\${JAVA_HOME}/bin:\${ELASTICSEARCH_HOME}/bin:$PATH >> ~/.bashrc | |
} | |
installExtras | |
downloadJavaPackages | |
downloadESPackages | |
installLocalJava | |
installElastic | |
installKibana | |
updateProfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment