source: hadoop4win-setup/my_packages/hbase/bin/hbase-init @ 141

Last change on this file since 141 was 141, checked in by jazz, 15 years ago

新增 HBase 安裝/啟動/停止 script

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2if [ ! -f /usr/src/hbase-0.20.3.tar.gz ]; then
3  wget http://ftp.twaren.net/Unix/Web/apache/hadoop/hbase/hbase-0.20.3/hbase-0.20.3.tar.gz -O /usr/src/hbase-0.20.3.tar.gz
4fi
5
6tar zxvf /usr/src/hbase-0.20.3.tar.gz -C /opt
7ln -s /opt/hbase-* /opt/hbase
8
9cp /opt/hadoop/conf/core-site.xml /opt/hbase/conf
10cp /opt/hadoop/conf/hdfs-site.xml /opt/hbase/conf
11cp /opt/hadoop/conf/mapred-site.xml /opt/hbase/conf
12
13cat >> /opt/hbase/conf/hbase-env.sh << EOF
14  export JAVA_HOME=$JAVA_HOME
15  export HADOOP_CONF_DIR=/opt/hadoop/conf
16  export HBASE_HOME=/opt/hbase
17  export HBASE_MANAGES_ZK=true
18EOF
19
20cat > /opt/hbase/conf/hbase-site.xml << EOF
21<?xml version="1.0"?>
22<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
23<configuration>
24  <property>
25    <name>hbase.rootdir</name>
26    <value>hdfs://localhost:9000/hbase</value>
27  </property>
28  <property>
29    <name>hbase.cluster.distributed</name>
30    <value>true</value>
31  </property>
32</configuration>
33EOF
34
35echo "export PATH=/opt/hbase/bin/:\$PATH" >> /etc/profile
36echo "/bin/stop-hbase" > ~/.bash_logout
37echo "/bin/stop-hadoop" >> ~/.bash_logout
38echo "/bin/stop-hbase" > /etc/skel/.bash_logout
39echo "/bin/stop-hadoop" >> /etc/skel/.bash_logout
40
41cat > ~/hbase-test << EOF
42create 'test','data'
43put 'test','row1','data:1','v1'
44put 'test','row2','data:2','v2'
45put 'test','row3','data:3','v3'
46scan 'test'
47disable 'test'
48drop 'test'
49list
50exit
51EOF
Note: See TracBrowser for help on using the repository browser.