Skip to content

Instantly share code, notes, and snippets.

@ploegert
Created July 14, 2015 15:33
Show Gist options
  • Select an option

  • Save ploegert/e84e010e7a156ef96723 to your computer and use it in GitHub Desktop.

Select an option

Save ploegert/e84e010e7a156ef96723 to your computer and use it in GitHub Desktop.
Shell Script to setup & install TSDB
#
# ConfigTSDB.sh
#
install_prereqs()
{
sudo bash
cd /home/jciazdeploy
apt-get update -y
apt-get install git -y
apt-get install autoconf -y
apt-get install automake -y
apt-get install gnuplot -y
apt-get install openjdk-7-jdk
apt-get install wget -y
apt-get install vim -y
apt-get install make -y
sudo apt-get autoremove automake -y
sudo apt-get install automake -y
}
#==========================================================================================
# Install Oracle Java
install_java()
{
log "Installing Java"
add-apt-repository -y ppa:webupd8team/java
apt-get -y update > /dev/null
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
apt-get -y install oracle-java7-installer > /dev/null
export JAVA_HOME=/usr
}
#==========================================================================================
install_hbase()
{
cd /home/jciazdeploy/
wget http://psg.mtu.edu/pub/apache/hbase/stable/hbase-1.0.1.1-bin.tar.gz
tar xzvf hbase-1.0.1.1-bin.tar.gz
}
config_hbase()
{
cd /home/jciazdeploy/hbase-1.0.1.1/conf
chmod 755 *
./hbase-env.sh
#Setup /home/jciazdeploy/hbase-1.0.1.1/conf/hbase-site.xml
mv hbase-site.xml hbase-site-old.xml
wget https://raw.githubusercontent.com/ploegert/ploegert.github.io/master/hbase-site.xml
cd ~/hbase-1.0.1.1/bin
./start-hbase.sh
}
#==========================================================================================
install_opentsdb()
{
git clone git://github.com/OpenTSDB/opentsdb.git
cd /home/jciazdeploy/opentsdb/
./build.sh
}
config_tsdb()
{
export COMPRESSION=NONE
export HBASE_HOME=/home/jciazdeploy/hbase-1.0.1.1 ./src/create_table.sh
export HBASE_HOME=/home/jciazdeploy/hbase-1.0.1.1
./src/create_table.sh
cd /home/jciazdeploy/opentsdb/src
cp /home/jciazdeploy/opentsdb/src/opentsdb.conf /home/jciazdeploy/opentsdb/src/opentsdb-orig.conf
rm opentsdb.conf
wget https://raw.githubusercontent.com/ploegert/ploegert.github.io/master/opentsdb.conf
cp /home/jciazdeploy/opentsdb/src/opentsdb.conf /etc/
cd /home/jciazdeploy/opentsdb/build
nohup ./tsdb tsd &
}
#==========================================================================================
install_prereqs
install_java
install_hbase
config_hbase
install_opentsdb
config_tsdb
#==========================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment