#!/bin/bash if [ ! -f /usr/src/hbase-*.tar.gz ]; then echo "Hbase tar ball not found at /usr/src/hbase-*.tar.gz!!" exit fi if [ ! -f /opt/hase* ]; then tar zxvf /usr/src/hbase-*.tar.gz -C /opt ln -s /opt/hbase-* /opt/hbase cp /opt/hadoop/conf/core-site.xml /opt/hbase/conf cp /opt/hadoop/conf/hdfs-site.xml /opt/hbase/conf cp /opt/hadoop/conf/mapred-site.xml /opt/hbase/conf cat >> /opt/hbase/conf/hbase-env.sh << EOF export JAVA_HOME=$JAVA_HOME export HADOOP_CONF_DIR=/opt/hadoop/conf export HBASE_HOME=/opt/hbase export HBASE_MANAGES_ZK=true export HBASE_PID_DIR=c:/hadoop4win/var/hadoop/pid EOF cat > /opt/hbase/conf/hbase-site.xml << EOF hbase.rootdir hdfs://localhost:9000/hbase hbase.cluster.distributed true EOF echo "export PATH=/opt/hbase/bin/:\$PATH" >> /etc/profile echo "/bin/stop-hbase" > ~/.bash_logout echo "/bin/stop-hadoop" >> ~/.bash_logout echo "/bin/stop-hbase" > /etc/skel/.bash_logout echo "/bin/stop-hadoop" >> /etc/skel/.bash_logout cat > ~/hbase-test << EOF create 'test','data' put 'test','row1','data:1','v1' put 'test','row2','data:2','v2' put 'test','row3','data:3','v3' scan 'test' disable 'test' drop 'test' list exit EOF cat >> /etc/profile << EOF echo "============================================" echo " Use 'start-hadoop' to start hadoop daemons." echo " Use 'start-hadoop' to stop hadoop daemons." echo " ." echo " run 'start-hbase' to start hbase daemons. " echo " run 'stop-hbase' to stop hbase daemons. " echo " run 'hbase shell hbase-test' to test " echo " hbase services. " echo " ." echo " Use 'jps' to check java process for " echo " troubleshooting. " echo "============================================" EOF echo " Starting HBase ....." /bin/start-hbase fi