| 1 | |
| 2 | |
| 3 | hbase 0.18.1 port hadoop-cloudera 0.18.3 |
| 4 | {{{ |
| 5 | #!/bin/bash |
| 6 | hbase_ori_home=~/hbase |
| 7 | hbase_lib=$hbase_ori_home/lib |
| 8 | hadoop_lib=/usr/lib/hadoop/lib |
| 9 | hbase_sh=$hbase_ori_home/bin |
| 10 | hadoop_sh=/usr/lib/hadoop/bin |
| 11 | hbase_conf=$hbase_ori_home/conf |
| 12 | hadoop_conf=/etc/hadoop/conf |
| 13 | |
| 14 | # Install lib |
| 15 | cd $hbase_lib |
| 16 | sudo cp commons-collections-3.2.jar commons-math-1.1.jar \ |
| 17 | jruby-complete-1.1.2.jar lucene-core-2.2.0.jar $hadoop_lib |
| 18 | sudo cp ../hbase-*.jar $hadoop_lib |
| 19 | |
| 20 | # Install hbase_bin |
| 21 | cd $hbase_sh |
| 22 | sudo cp Formatter.rb hbase-daemons.sh hirb.rb \ |
| 23 | start-hbase.sh hbase-daemon.sh HBase.rb regionservers.sh \ |
| 24 | stop-hbase.sh hbase $hadoop_sh |
| 25 | sudo cp hbase /usr/bin |
| 26 | |
| 27 | # Install conf |
| 28 | cd $hbase_conf |
| 29 | sudo cp hbase-default.xml hbase-env.sh hbase-site.xml \ |
| 30 | log4j.properties regionservers $hadoop_conf |
| 31 | |
| 32 | # Install /etc/default/hbase |
| 33 | sudo cp $hbase_sh/hbase-config.sh /etc/default/hbase |
| 34 | |
| 35 | # Install init |
| 36 | cd $hbase_ori_home |
| 37 | sudo cp hbase-init /etc/init.d/hbase |
| 38 | }}} |
| 39 | |
| 40 | |
| 41 | |
| 42 | * 修改 /etc/hadoop/conf/hbase-site.xml |
| 43 | |
| 44 | * /etc/init.d/hbase start 會要密碼 |
| 45 | {{{ |
| 46 | start() { |
| 47 | su -s /bin/sh hadoop -c "$HBASE_HOME/bin/start-hbase.sh" |
| 48 | } |
| 49 | stop() { |
| 50 | su -s /bin/sh hadoop -c "$HBASE_HOME/bin/stop-hbase.sh" |
| 51 | } |
| 52 | }}} |
| 53 | |
| 54 | * 目前卡在 |