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

Last change on this file since 238 was 236, checked in by jazz, 13 years ago
  • modified my_packages/hadoop/bin/hadoop4win-init
    • [BUGFIX] fix error at line 31
  • modified my_packages/hbase/bin/hbase-init
    • add HBASE_PID_DIR to hbase-env.sh
  • modified my_packages/ant/bin/ant-init
    • fix syntax error of unzip
  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/bash
2if [ ! -f /usr/src/hbase-*.tar.gz ]; then
3  echo "Hbase tar ball not found at /usr/src/hbase-*.tar.gz!!"
4  exit
5fi
6
7if [ ! -f /opt/hase* ]; then
8  tar zxvf /usr/src/hbase-*.tar.gz -C /opt
9  ln -s /opt/hbase-* /opt/hbase
10
11  cp /opt/hadoop/conf/core-site.xml /opt/hbase/conf
12  cp /opt/hadoop/conf/hdfs-site.xml /opt/hbase/conf
13  cp /opt/hadoop/conf/mapred-site.xml /opt/hbase/conf
14
15cat >> /opt/hbase/conf/hbase-env.sh << EOF
16  export JAVA_HOME=$JAVA_HOME
17  export HADOOP_CONF_DIR=/opt/hadoop/conf
18  export HBASE_HOME=/opt/hbase
19  export HBASE_MANAGES_ZK=true
20  export HBASE_PID_DIR=c:/hadoop4win/var/hadoop/pid
21EOF
22
23cat > /opt/hbase/conf/hbase-site.xml << EOF
24<?xml version="1.0"?>
25<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
26<configuration>
27  <property>
28    <name>hbase.rootdir</name>
29    <value>hdfs://localhost:9000/hbase</value>
30  </property>
31  <property>
32    <name>hbase.cluster.distributed</name>
33    <value>true</value>
34  </property>
35</configuration>
36EOF
37
38  echo "export PATH=/opt/hbase/bin/:\$PATH" >> /etc/profile
39  echo "/bin/stop-hbase" > ~/.bash_logout
40  echo "/bin/stop-hadoop" >> ~/.bash_logout
41  echo "/bin/stop-hbase" > /etc/skel/.bash_logout
42  echo "/bin/stop-hadoop" >> /etc/skel/.bash_logout
43
44cat > ~/hbase-test << EOF
45create 'test','data'
46put 'test','row1','data:1','v1'
47put 'test','row2','data:2','v2'
48put 'test','row3','data:3','v3'
49scan 'test'
50disable 'test'
51drop 'test'
52list
53exit
54EOF
55
56cat >> /etc/profile << EOF
57  echo "============================================"
58  echo " Use 'start-hadoop' to start hadoop daemons."
59  echo " Use 'start-hadoop' to stop  hadoop daemons."
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  echo " Use 'jps' to check java process for        "
67  echo " troubleshooting.                           "
68  echo "============================================"
69EOF
70
71  echo " Starting HBase ....."
72  /bin/start-hbase
73fi
Note: See TracBrowser for help on using the repository browser.