| 1 | {{{ |
| 2 | #!html |
| 3 | <div style="text-align: center; color:#151B8D"><big style="font-weight: bold;"><big><big> |
| 4 | Hbase 單機設定 |
| 5 | </big></big></big></div> <div style="text-align: center; color:#7E2217"><big style="font-weight: bold;"><big> |
| 6 | HBase 0.20 + Hadoop 0.20 |
| 7 | </big></big></div> |
| 8 | }}} |
| 9 | [[PageOutline]] |
| 10 | |
| 11 | = 下載 = |
| 12 | |
| 13 | 取得 hbase 0.20 套件,並解壓縮到 /opt/hbase 目錄下 |
| 14 | |
| 15 | 並確認已經安裝了 hadoop 0.20 於 /opt/hadoop ,且有 /var/hadoop 此資料夾 |
| 16 | |
| 17 | = 設定 = |
| 18 | |
| 19 | * 修改 /opt/hbase/conf/hbase-env.sh |
| 20 | |
| 21 | {{{ |
| 22 | #!text |
| 23 | export JAVA_HOME=/usr/lib/jvm/java-6-sun |
| 24 | export HBASE_HOME=/opt/hbase |
| 25 | export HADOOP_HOME=/opt/hadoop |
| 26 | export HBASE_LOG_DIR=/var/hadoop/hbase/logs |
| 27 | export HBASE_PID_DIR=/var/hadoop/hbase/pids |
| 28 | }}} |
| 29 | |
| 30 | * 修改 /opt/hbase/conf/hbase-site.xml |
| 31 | |
| 32 | {{{ |
| 33 | #!xml |
| 34 | <configuration><property> |
| 35 | <name>hbase.rootdir</name> |
| 36 | <value>hdfs://localhost:9000/hbase</value> |
| 37 | <description>The directory shared by region servers. </description> |
| 38 | </property> |
| 39 | <property> |
| 40 | <name>hbase.tmp.dir</name> |
| 41 | <value>/var/hadoop/hbase/${user.name}</value> |
| 42 | <description>Temporary directory on the local filesystem.</description> |
| 43 | </property> |
| 44 | </configuration>n> |
| 45 | }}} |
| 46 | |
| 47 | = 啟動 = |
| 48 | |
| 49 | {{{ |
| 50 | $ /opt/hbase/bin/start-hbase.sh |
| 51 | }}} |
| 52 | |
| 53 | = 測試 = |
| 54 | |
| 55 | [http://localhost:60010] 此網頁正常 |
| 56 | |
| 57 | 以及可進入hbase 交談模式 |
| 58 | {{{ |
| 59 | $ /opt/hbase/bin/hbase shell |
| 60 | hbase(main):001:0> |
| 61 | hbase(main):002:0> help |
| 62 | hbase(main):003:0> exit |
| 63 | $ |
| 64 | }}} |
| 65 | |
| 66 | 完成 |