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

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

fine tune output messages of hbase-init

  • Property svn:executable set to *
File size: 1.9 KB
RevLine 
[140]1#!/bin/bash
2if [ ! -f /usr/src/hbase-0.20.3.tar.gz ]; then
[141]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
[140]4fi
5
6tar zxvf /usr/src/hbase-0.20.3.tar.gz -C /opt
7ln -s /opt/hbase-* /opt/hbase
[141]8
[140]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
[141]12
[140]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
[141]19
[140]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>
[141]28  <property>
29    <name>hbase.cluster.distributed</name>
30    <value>true</value>
31  </property>
[140]32</configuration>
[141]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
[142]51EOF
52
53clear
54echo "=========================================="
55echo " !! NOTE !!                               "
56echo " please 'source /etc/profile' to update   "
57echo " current \$PATH environment variables or  "
58echo " login again to update \$PATH variables.  "
59echo " .                                        "
60echo " run 'start-hbase' to start hbase daemons."
61echo " run 'stop-hbase'  to stop hbase daemons. "
62echo " run 'hbase shell ~/hbase-test'  to test  "
63echo " hbase services.                          "
64echo "=========================================="
Note: See TracBrowser for help on using the repository browser.