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

Last change on this file was 241, checked in by jazz, 13 years ago
  • modified hadoop4win-setup.bat
    • change order of hadoop4win-init and ant-init
  • modified my_packages/ant/bin/ant-init
    • fix typo in echo message
    • use unzip "-d" to change directory
  • modified my_packages/hbase/bin/hbase-init
    • setup hbase.tmp.dir and HBASE_PID_DIR
  • modified my_packages/hadoop/bin/hadoop4win-init
    • use mv and cp instead of symbolic link
    • copy example config as pseudo config
    • force to leave safe mode since Hadoop 0.20.2 need extra 30 seconds to check.
    • add sleep 10 seconds since start-hadoop will take 10 seconds.
  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[140]1#!/bin/bash
[232]2if [ ! -f /usr/src/hbase-*.tar.gz ]; then
3  echo "Hbase tar ball not found at /usr/src/hbase-*.tar.gz!!"
4  exit
[140]5fi
6
[143]7if [ ! -f /opt/hase* ]; then
[232]8  tar zxvf /usr/src/hbase-*.tar.gz -C /opt
[241]9  mv /opt/hbase-* /opt/hbase
[141]10
[143]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
[141]14
[140]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
[241]20  export HBASE_PID_DIR=/var/hbase/pid
[140]21EOF
[141]22
[140]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>
[141]31  <property>
[241]32    <name>hbase.tmp.dir</name>
33    <value>/var/hbase</value>
34  </property>
35  <property>
[141]36    <name>hbase.cluster.distributed</name>
37    <value>true</value>
38  </property>
[140]39</configuration>
[141]40EOF
41
[143]42  echo "export PATH=/opt/hbase/bin/:\$PATH" >> /etc/profile
43  echo "/bin/stop-hbase" > ~/.bash_logout
44  echo "/bin/stop-hadoop" >> ~/.bash_logout
45  echo "/bin/stop-hbase" > /etc/skel/.bash_logout
46  echo "/bin/stop-hadoop" >> /etc/skel/.bash_logout
[141]47
48cat > ~/hbase-test << EOF
49create 'test','data'
50put 'test','row1','data:1','v1'
51put 'test','row2','data:2','v2'
52put 'test','row3','data:3','v3'
53scan 'test'
54disable 'test'
55drop 'test'
56list
57exit
[142]58EOF
59
[232]60cat >> /etc/profile << EOF
61  echo "============================================"
62  echo " Use 'start-hadoop' to start hadoop daemons."
63  echo " Use 'start-hadoop' to stop  hadoop daemons."
64  echo " ."
65  echo " run 'start-hbase' to start hbase daemons.  "
66  echo " run 'stop-hbase'  to stop hbase daemons.   "
67  echo " run 'hbase shell hbase-test'  to test      "
68  echo " hbase services.                            "
69  echo " ."
70  echo " Use 'jps' to check java process for        "
71  echo " troubleshooting.                           "
72  echo "============================================"
73EOF
[143]74
75  echo " Starting HBase ....."
76  /bin/start-hbase
[236]77fi
Note: See TracBrowser for help on using the repository browser.