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

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

細部微調

  • Property svn:executable set to *
File size: 2.0 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
[143]6if [ ! -f /opt/hase* ]; then
7  tar zxvf /usr/src/hbase-0.20.3.tar.gz -C /opt
8  ln -s /opt/hbase-* /opt/hbase
[141]9
[143]10  cp /opt/hadoop/conf/core-site.xml /opt/hbase/conf
11  cp /opt/hadoop/conf/hdfs-site.xml /opt/hbase/conf
12  cp /opt/hadoop/conf/mapred-site.xml /opt/hbase/conf
[141]13
[140]14cat >> /opt/hbase/conf/hbase-env.sh << EOF
15  export JAVA_HOME=$JAVA_HOME
16  export HADOOP_CONF_DIR=/opt/hadoop/conf
17  export HBASE_HOME=/opt/hbase
18  export HBASE_MANAGES_ZK=true
19EOF
[141]20
[140]21cat > /opt/hbase/conf/hbase-site.xml << EOF
22<?xml version="1.0"?>
23<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
24<configuration>
25  <property>
26    <name>hbase.rootdir</name>
27    <value>hdfs://localhost:9000/hbase</value>
28  </property>
[141]29  <property>
30    <name>hbase.cluster.distributed</name>
31    <value>true</value>
32  </property>
[140]33</configuration>
[141]34EOF
35
[143]36  echo "export PATH=/opt/hbase/bin/:\$PATH" >> /etc/profile
37  echo "/bin/stop-hbase" > ~/.bash_logout
38  echo "/bin/stop-hadoop" >> ~/.bash_logout
39  echo "/bin/stop-hbase" > /etc/skel/.bash_logout
40  echo "/bin/stop-hadoop" >> /etc/skel/.bash_logout
[141]41
42cat > ~/hbase-test << EOF
43create 'test','data'
44put 'test','row1','data:1','v1'
45put 'test','row2','data:2','v2'
46put 'test','row3','data:3','v3'
47scan 'test'
48disable 'test'
49drop 'test'
50list
51exit
[142]52EOF
53
[143]54  clear
55  echo "=========================================="
56  echo " !! NOTE !!                               "
57  echo " please 'source /etc/profile' to update   "
58  echo " current \$PATH environment variables or  "
59  echo " login again to update \$PATH variables.  "
60  echo " .                                        "
61  echo " run 'start-hbase' to start hbase daemons."
62  echo " run 'stop-hbase'  to stop hbase daemons. "
63  echo " run 'hbase shell hbase-test'  to test    "
64  echo " hbase services.                          "
65  echo "=========================================="
66
67  echo " Starting HBase ....."
68  /bin/start-hbase
69fi
Note: See TracBrowser for help on using the repository browser.