- 論壇徽章:
- 0
|
<font class="Apple-style-span" size="2">HBase 想說愛你不容易</font><div><font class="Apple-style-span" size="2"><br></font></div><div><span class="Apple-style-span" style="font-family: arial, 宋體, sans-serif; line-height: 24px; "><font class="Apple-style-span" size="2">HBase – Hadoop Database,是一個高可靠性、高性能、面向列、可伸縮的<a target="_blank" href="http://baike.baidu.com/view/1911305.htm" style="text-decoration: underline; color: rgb(19, 110, 194); ">分布式存儲系統(tǒng)</a>,利用HBase技術(shù)可在廉價PC Server上搭建起大規(guī)模結(jié)構(gòu)化存儲集群。</font></span></div><div><span class="Apple-style-span" style="font-family: arial, 宋體, sans-serif; line-height: 24px; "><font class="Apple-style-span" size="2"><div class="spctrl" style="height: 14px; line-height: 14px; overflow-x: hidden; overflow-y: hidden; "></div> HBase是Google Bigtable的開源實現(xiàn),類似Google Bigtable利用GFS作為其文件存儲系統(tǒng),HBase利用Hadoop HDFS作為其文件存儲系統(tǒng);Google運行MapReduce來處理Bigtable中的海量數(shù)據(jù),HBase同樣利用Hadoop MapReduce來處理HBase中的海量數(shù)據(jù);Google Bigtable利用 Chubby作為協(xié)同服務(wù),HBase利用Zookeeper作為對應(yīng)。<div class="text_pic" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(232, 232, 232); border-right-color: rgb(232, 232, 232); border-bottom-color: rgb(232, 232, 232); border-left-color: rgb(232, 232, 232); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(246, 246, 246); padding-top: 5px; padding-right: 5px; padding-bottom: 3px; padding-left: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; text-align: center; float: right; position: relative; width: 199px; visibility: visible; background-position: initial initial; background-repeat: initial initial; "><a class=" pic-handle" title="查看圖片" href="http://baike.baidu.com/image/4e83cb62c5dbd78ae6113ae2" target="_blank" style="text-decoration: none; color: rgb(19, 110, 194); background-image: url(http://img.baidu.com/img/baike/s/zoom.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; width: 14px; height: 14px; line-height: 0; display: block; position: absolute; right: 4px; bottom: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(246, 246, 246); border-right-color: rgb(246, 246, 246); border-bottom-color: rgb(246, 246, 246); border-left-color: rgb(246, 246, 246); background-position: 0px 0px; background-repeat: no-repeat no-repeat; "> </a><a href="http://blog.chinaunix.net/attachment/201107/15/93477_1310719451LK42.jpg" target="_blank" target="_blank"><img src="http://blog.chinaunix.net/attachment/201107/15/93477_1310719451LK42.jpg" .load="imgResize(this, 650);" border="0" ;=""></a><p class="pic-info" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 102); font-family: 宋體; font-weight: normal; display: inline; word-wrap: break-word; word-break: break-all; font-style: normal; line-height: 18px; min-height: 18px; zoom: 1; "></p></div><div class="spctrl" style="height: 14px; line-height: 14px; overflow-x: hidden; overflow-y: hidden; "></div> 上圖描述了Hadoop EcoSystem中的各層系統(tǒng),其中HBase位于結(jié)構(gòu)化存儲層,Hadoop HDFS為HBase提供了高可靠性的底層存儲支持,Hadoop MapReduce為HBase提供了高性能的計算能力,Zookeeper為HBase提供了穩(wěn)定服務(wù)和failover機制。<div class="spctrl" style="height: 14px; line-height: 14px; overflow-x: hidden; overflow-y: hidden; "></div> 此外,Pig和Hive還為HBase提供了高層語言支持,使得在HBase上進行數(shù)據(jù)統(tǒng)計處理變的非常簡單。 Sqoop則為HBase提供了方便的RDBMS數(shù)據(jù)導(dǎo)入功能,使得傳統(tǒng)數(shù)據(jù)庫數(shù)據(jù)向HBase中遷移變的非常方便。</font></span></div><div><font class="Apple-style-span" face="arial, 宋體, sans-serif" size="2"><span class="Apple-style-span" style="line-height: 24px; "><br></span></font></div><div><font class="Apple-style-span" face="arial, 宋體, sans-serif" size="2"><span class="Apple-style-span" style="line-height: 24px;">下面介紹一下HBase完全分布式安裝的步驟:</span></font></div><div><font class="Apple-style-span" size="2">1.使用Hadoop 0.20.2+ZooKeeper 3.3.3+HBase 0.90.3,</font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>Hadoop的安裝見:<a href="http://blog.chinaunix.net/space.php?uid=93477&do=blog&id=315983" target="_blank" target="_blank">http://blog.chinaunix.net/space.php?uid=93477&do=blog&id=315983</a></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>ZooKeeper的安裝見:<a href="http://blog.chinaunix.net/space.php?uid=93477&do=blog&id=403146" target="_blank" target="_blank">http://blog.chinaunix.net/space.php?uid=93477&do=blog&id=403146</a></font></div><div><font class="Apple-style-span" size="2">2.下載HBase 0.90.3,解壓至/home/grid/hbase</font></div><div><font class="Apple-style-span" face="arial, 宋體, sans-serif" size="2"><span class="Apple-style-span" style="line-height: 24px; ">3.先檢測zookeeper是否安裝正確</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>HBase需要zookeeper,所以在配置HBase前務(wù)必確定zookeeper可以正常運行.</font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>HBase有兩種方式使用zookeeper服務(wù),第一種是使用已經(jīng)存在的獨立zookeeper服務(wù),另外一種是由HBase自己管理zookeeper服務(wù),這里我們讓HBase來管理zookeeper,可以少打一些命令:)</font></div><div><font class="Apple-style-span" size="2">4.配置hbase/conf/hbase-site.xml</font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>增加如下行:</font></div><div><div id="codeText" class="codeText" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); width: 662px; overflow-x: auto; overflow-y: auto; margin-top: 0px; margin-right: 0px; margin-bottom: 1.1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; letter-spacing: 0.1px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); font: normal normal normal 12px/normal Consolas, monospace; "><ol start="1" class="dp-css" style="margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(92, 92, 92); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); line-height: 1.3; background-position: initial initial; background-repeat: initial initial; "><font class="Apple-style-span" size="2"><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><configuration></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><name>hbase.zookeeper.quorum</name></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><value>hadoop1.ahau.edu.cn,hadoop2.ahau.edu.cn,hadoop3.ahau.edu.cn,hadoop4.ahau.edu.cn</value></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><description>Comma separated list of servers in the ZooKeeper Quorum.</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; ">For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; ">By default this is set to localhost for local and pseudo-distributed modes</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; ">of operation. For a fully-distributed setup, this should be set to a full</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; ">list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; ">this is the list of servers which we will start/stop ZooKeeper on.</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></description></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><name>hbase.zookeeper.property.dataDir</name></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><value>/home/grid/zookeeper/</value></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><description>Property from ZooKeeper's config zoo.cfg.</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; ">The directory where the snapshot is stored.</li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></description></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><name>hbase.rootdir</name></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><value>hdfs://hadoop1.ahau.edu.cn:9100/hbase</value></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><name>hbase.cluster.distributed</name></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><value>true</value></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></property></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "></configuration></li></font></ol></div></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">hbase.zookeeper.quorum指定所有zookeeper的節(jié)點</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><span class="Apple-tab-span" style="white-space:pre"> </span></span><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">hbase.zookeeper.property.dataDir指定zookeeper的數(shù)據(jù)目錄</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><span class="Apple-tab-span" style="white-space:pre"> </span></span><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">hbase.rootdir指定hdfs的路徑</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><span class="Apple-tab-span" style="white-space:pre"> </span></span><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">hbase.cluster.distributed為true表示完全分布式部署</span></font></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2"><br></font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2">5.修改hbase/conf/hbase-evn.sh</font></span></div><div><div id="codeText" class="codeText" style="color: rgb(0, 0, 0); font-family: Simsun; line-height: 18px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); width: 645px; overflow-x: auto; overflow-y: auto; margin-top: 0px; margin-right: 0px; margin-bottom: 1.1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; letter-spacing: 0.1px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); font: normal normal normal 12px/normal Consolas, monospace; "><ol start="1" class="dp-css" style="margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(92, 92, 92); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); line-height: 1.3; background-position: initial initial; background-repeat: initial initial; "><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><font class="Apple-style-span" size="2">export JAVA_HOME=/usr/local/jdk1.6.0_25 #JAVA的目錄</font></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><font class="Apple-style-span" size="2">export HBASE_CLASSPATH=/home/grid/hadoop/conf #Hadoop配置所在目錄</font></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><font class="Apple-style-span" size="2">export HBASE_OPTS="-ea -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"</font></li><li style="padding-left: 10px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial; "><font class="Apple-style-span" size="2">export HBASE_MANAGES_ZK=true #HBase是否管理zookeeper</font></li></ol></div></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">6.將zookeeper的配置文件zoo.cfg復(fù)制到</span><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">HBASE_CLASSPATH指定的目錄</span></font></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2">7.復(fù)制hadoop/conf/hdfs-site.xml到hbase/conf目錄</font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2">8.把所有節(jié)點加入hbase/conf/regionservers,每行一個主機名</font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2">9.所有主機名都要做好反向解析,否則啟動HBase會報錯</font></span></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">10.檢測一下HBase是否能夠</span><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; ">啟動zookeeper</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><a href="http://blog.chinaunix.net/attachment/201107/15/93477_1310717359I6iw.jpg" target="_blank" target="_blank"></a></span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><a href="http://blog.chinaunix.net/attachment/201107/15/93477_1310717359I6iw.jpg" target="_blank" target="_blank"></a></span></font></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>hbase$bin/hbase-daemon.sh start zookeeper</font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>hbase#bin/hbase-daemon.sh stop zookeeper<span class="Apple-tab-span" style="white-space:pre"> </span></font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2">11.把hbase目錄同步到所有的節(jié)點服務(wù)器</font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2">12.啟動時,先啟動Hadoop,然后是HBase,關(guān)閉時,先停止HBase,再停止Hadoop</font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2">13.啟動Hadoop</font></span></div><div><span class="Apple-style-span" style="color: rgb(92, 92, 92); font-family: Consolas, monospace; line-height: 15px; "><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>hadoop$bin/start-all.sh</font></span></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "> 啟動HBase</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><span class="Apple-tab-span" style="white-space:pre"> </span>hbase$bin/start-hbase.sh</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; ">14.啟動以后可能會遇到問題,具體的問題日志里都會有寫,本文最后有一些常見的問題的解決辦法</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; ">15.打開頁面http://hadoop1.ahau.edu.cn:60010/master.jsp</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><span class="Apple-tab-span" style="white-space:pre"> </span>查看hbase的狀態(tài),此時會有一個提醒框</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><span class="Apple-style-span" style="line-height: 18px; color: rgb(0, 0, 0); font-family: Simsun; "><a href="http://blog.chinaunix.nethttp://blog.chinaunix.net/attachment/201107/15/93477_1310717359I6iw.jpg" target="_blank" target="_blank"><img src="http://blog.chinaunix.nethttp://blog.chinaunix.net/attachment/201107/15/93477_1310717359I6iw.jpg" border="0" ;=""></a></span></span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><span class="Apple-tab-span" style="white-space:pre"> </span>分布式系統(tǒng)有個這么個提示,不是很蛋疼,所以一定要解決掉</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><br></span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; ">16.按照wiki的提示,在hadoop/conf/hdfs-site.xml和hbase/conf/hdfs-site.xml里增加dfs.support.append的支持</span></font></div><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0;" start="1" class="dp-css"><li><font class="Apple-style-span" size="2"><property></font></li><li><font class="Apple-style-span" size="2">
<name>dfs.support.append</name></font></li><li><font class="Apple-style-span" size="2">
<value>true</value></font></li><li><font class="Apple-style-span" size="2">
</property></font></li></ol></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; ">17.無果,仍舊有上面的提示,開始漫長的google</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; ">18.HBase的官網(wǎng)上有寫,hbase不支持官方的0.20.2的dfs.support.append,需要自己編譯分支hadoop</span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2"><span class="Apple-style-span" style="line-height: 15px; "><a href="http://blog.chinaunix.net/attachment/201107/15/93477_1310717873bqJ3.jpg" target="_blank" target="_blank"><img src="http://blog.chinaunix.net/attachment/201107/15/93477_1310717873bqJ3.jpg" .load="imgResize(this, 650);" border="0" ;=""></a></span></font></div><div><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace" size="2">19.編譯安裝可以參考 北飛孤雁 大神的博客</font></div><div><font class="Apple-style-span" size="2"><font class="Apple-style-span" color="#5c5c5c" face="Consolas, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span></font><a href="http://blog.csdn.net/lansine2005/article/details/6595294" target="_blank" target="_blank">http://blog.csdn.net/lansine2005/article/details/6595294</a></font></div><div><font class="Apple-style-span" size="2"> 或者 </font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://www.michael-noll.com/blog/2011/04/14/building-an-hadoop-0-20-x-version-for-hbase-0-90-2/" target="_blank" target="_blank">http://www.michael-noll.com/blog/2011/04/14/building-an-hadoop-0-20-x-version-for-hbase-0-90-2/</a></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>第二個地址是英文的</font></div><div><font class="Apple-style-span" size="2">20.編譯需要git和ant,ant的版本最好在1.8.0以上,我用1.7.6時報錯</font></div><div><font class="Apple-style-span" size="2">21.編譯出來的jar包,需要替換原來hadoop里的包,也就是說要把原來的包刪掉,否則hadoop還是會啟動老的jar包</font></div><div><font class="Apple-style-span" size="2">22.把新編譯出來的jar包同步到所有節(jié)點</font></div><div><font class="Apple-style-span" size="2">23.再次啟動hadoop和hbase,那個紅色的提示消失了</font></div><div><font class="Apple-style-span" size="2"><br></font></div><div><font class="Apple-style-span" size="2">常見問題匯總:</font></div><div><font class="Apple-style-span" size="2">1.使用官方的hadoop0.20.2時,啟動hbase報錯:</font></div><div><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0;" start="1" class="dp-css"><li><font class="Apple-style-span" size="2">FATAL master.HMaster: Unhandled exception. Starting shutdown.org.apache.hadoop.ipc.RPC$VersionMismatch: Protocol org.apache.hadoop.hdfs.protocol.ClientProtocol version mismatch. (client = 42, server = 41)</font></li></ol></div></div><div><font class="Apple-style-span" size="2">原因是hbase/lib里的包與hadoop的不一致,把hadoop目錄里的hadoop-0.20.2-core.jar復(fù)制到hbase的lib里就可以解決</font></div><div><font class="Apple-style-span" size="2">2.啟動hbase,報:</font></div><div><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0;" start="1" class="dp-css"><li><font class="Apple-style-span" size="2">no valid quorum servers found in zoo.cfg</font></li></ol></div></div><div><font class="Apple-style-span" size="2">zoo.cfg一定要復(fù)制到hadoop/conf目錄下,否則就會報這個錯</font></div><div><font class="Apple-style-span" size="2">3.hbase報錯</font></div><div><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0;" start="1" class="dp-css"><li><font class="Apple-style-span" size="2">Could not find my address</font></li></ol></div></div><div><font class="Apple-style-span" size="2">有兩種情況會導(dǎo)致這個錯誤,1主要是因為沒有做反向解析,2是因為沒有復(fù)制zoo.cfg,導(dǎo)致hbase讀不到zookeeper的配置</font></div><div><font class="Apple-style-span" size="2"><br></font></div><div><font class="Apple-style-span" size="2"><br></font></div><div><font class="Apple-style-span" size="2">至此,博客里已經(jīng)有三篇文章,可以完整的配置出Hadoop+MapReduce+ZooKeeper+HBase的環(huán)境.</font></div> |
|