免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2374 | 回复: 0

[HBase] Hbase完全分布式安装配置手册 [复制链接]

论坛徽章:
0
发表于 2011-12-22 08:52 |显示全部楼层
<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); ">分布式存储系统</a>,利用HBase技术可在廉价PC Server上搭建起大规模结构化存储集群。</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的开源实现,类似Google Bigtable利用GFS作为其文件存储系统,HBase利用Hadoop HDFS作为其文件存储系统;Google运行MapReduce来处理Bigtable中的海量数据,HBase同样利用Hadoop MapReduce来处理HBase中的海量数据;Google Bigtable利用 Chubby作为协同服务,HBase利用Zookeeper作为对应。<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; ">&nbsp;&nbsp;</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中的各层系统,其中HBase位于结构化存储层,Hadoop HDFS为HBase提供了高可靠性的底层存储支持,Hadoop MapReduce为HBase提供了高性能的计算能力,Zookeeper为HBase提供了稳定服务和failover机制。<div class="spctrl" style="height: 14px; line-height: 14px; overflow-x: hidden; overflow-y: hidden; "></div>  此外,Pig和Hive还为HBase提供了高层语言支持,使得在HBase上进行数据统计处理变的非常简单。 Sqoop则为HBase提供了方便的RDBMS数据导入功能,使得传统数据库数据向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&nbsp;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&amp;do=blog&amp;id=315983" target="_blank" target="_blank">http://blog.chinaunix.net/space.php?uid=93477&amp;do=blog&amp;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&amp;do=blog&amp;id=403146" target="_blank" target="_blank">http://blog.chinaunix.net/space.php?uid=93477&amp;do=blog&amp;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前务必确定zookeeper可以正常运行.</font></div><div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>HBase有两种方式使用zookeeper服务,第一种是使用已经存在的独立zookeeper服务,另外一种是由HBase自己管理zookeeper服务,这里我们让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; ">&lt;configuration&gt;</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; ">&lt;property&gt;</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; ">&lt;name&gt;hbase.zookeeper.quorum&lt;/name&gt;</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; ">&lt;value&gt;hadoop1.ahau.edu.cn,hadoop2.ahau.edu.cn,hadoop3.ahau.edu.cn,hadoop4.ahau.edu.cn&lt;/value&gt;</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; ">&lt;description&gt;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; ">&lt;/description&gt;</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; ">&lt;/property&gt;</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; ">&lt;property&gt;</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; ">&lt;name&gt;hbase.zookeeper.property.dataDir&lt;/name&gt;</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; ">&lt;value&gt;/home/grid/zookeeper/&lt;/value&gt;</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; ">&lt;description&gt;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; ">&lt;/description&gt;</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; ">&lt;/property&gt;</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; ">&lt;property&gt;</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; ">&lt;name&gt;hbase.rootdir&lt;/name&gt;</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; ">&lt;value&gt;hdfs://hadoop1.ahau.edu.cn:9100/hbase&lt;/value&gt;</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; ">&lt;/property&gt;</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; ">&lt;property&gt;</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; ">&lt;name&gt;hbase.cluster.distributed&lt;/name&gt;</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; ">&lt;value&gt;true&lt;/value&gt;</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; ">&lt;/property&gt;</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; ">&lt;/configuration&gt;</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的节点</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的数据目录</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 &nbsp;#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复制到</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.复制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.把所有节点加入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目录同步到所有的节点服务器</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,关闭时,先停止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; ">&nbsp; &nbsp;启动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的状态,此时会有一个提醒框</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>分布式系统有个这么个提示,不是很蛋疼,所以一定要解决掉</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">&lt;property&gt;</font></li><li><font class="Apple-style-span" size="2">
&lt;name&gt;dfs.support.append&lt;/name&gt;</font></li><li><font class="Apple-style-span" size="2">
&lt;value&gt;true&lt;/value&gt;</font></li><li><font class="Apple-style-span" size="2">
&lt;/property&gt;</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的官网上有写,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">&nbsp; &nbsp; 或者&nbsp;</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包同步到所有节点</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复制到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一定要复制到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">有两种情况会导致这个错误,1主要是因为没有做反向解析,2是因为没有复制zoo.cfg,导致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">至此,博客里已经有三篇文章,可以完整的配置出Hadoop+MapReduce+ZooKeeper+HBase的环境.</font></div>
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP