-
Notifications
You must be signed in to change notification settings - Fork 1
/
hbase112.sh
59 lines (46 loc) · 1.55 KB
/
hbase112.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Install HBase 1.1.2
# See http://hbase.apache.org/book.html
SETUP="/vagrant/vagrant-setup"
PPWD=$PWD
if [ -d "/usr/share/hbase" ]
then
echo "HBase is already installed, nothing done!"
else
source $SETUP/include.sh
# yum install -y bzip2 gzip lzo-devel zlib-devel
source $SETUP/hadoop251.sh
source $SETUP/zookeeper346.sh
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "hadoop service is running"
else
echo "Starting hadoop service"
service hadoop start
fi
echo "Creating -hbase directory in HDFS"
su - hadoop -c "/usr/share/hadoop/bin/hadoop fs -mkdir /hbase"
cd /usr/share
HBASE_FILE="hbase-1.1.2"
wget_and_untar http://mirror.ox.ac.uk/sites/rsync.apache.org/hbase/1.1.2/ $HBASE_FILE-bin.tar.gz
mkdir hbase
mkdir hbase/logs
cd $HBASE_FILE
mv * ../hbase
cd ..
rmdir $HBASE_FILE
echo -e "\nLD_LIBRARY_PATH=/usr/local/lib\nexport LD_LIBRARY_PATH\n" >> ./hbase/conf/hbase-env.sh
rm ./hbase/conf/hbase-site.xml
cp $SETUP/hbase/conf/hbase-site.xml ./hbase/conf/hbase-site.xml
perl -pi -e "s/# export HBASE_MANAGES_ZK=true/export HBASE_MANAGES_ZK=false/g" ./hbase/conf/hbase-env.sh
perl -pi -e "s/# export JAVA_HOME=\x2Fusr\x2Fjava\x2Fjdk1.6.0\x2F/export JAVA_HOME=\x2Fusr\x2Fjava\x2Flatest\x2F/g" ./hbase/conf/hbase-env.sh
mkdir /usr/share/hbase/zookeeper
ln -s /usr/share/hadoop/etc/hadoop/hdfs-site.xml /usr/share/hbase/conf/hdfs-site.xml
chown -Rf hadoop.hadoop hbase
chmod +r hbase
chmod +x hbase/conf
chmod -R +r hbase/conf
cp $SETUP/hbase/init.d/hbase /etc/init.d/hbase
chmod 755 /etc/init.d/hbase
cd $PPWD
fi