手机版
你好,游客 登录 注册
背景:
阅读新闻

HBase安装及程序调试的一些问题

[日期:2012-08-09] 来源:Linux社区  作者:freelongren [字体:大 中 小]
在各节点的/data/zookeeper-3.3.2/data下建立起myid,myid的内容和server.x中的x对应,比如xxx.xxx.xxx.193对应的myid的内容是1
    zoo.cfg
   
    # The number of milliseconds of each tick
tickTime=3000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/data/zookeeper-3.3.2/data
dataLogDir=/data/zookeeper-3.3.2/logs
# the port at which the clients will connect
clientPort=2181
server.1=xxx.xxx.xxx.193:2888:3888
server.2=xxx.xxx.xxx.194:2888:3888
server.3=xxx.xxx.xxx.221:2888:3888


    安装好zookeeper后,安装hbase,配置hbase-site.xml,注意hbase.zookeeper.quorum的值必须是奇数个
    hbase-site.xml
    <configuration>
     <property> 
    <name>hbase.rootdir</name> 
    <value>hdfs://hostname:54310/hbase</value> 
    <description>The directory shared by RegionServers.  must be hostname ,it will error if ip
    </description> 
  </property> 
  <property> 
    <name>hbase.cluster.distributed</name> 
    <value>true</value> 
    <description>The mode the cluster will be in. Possible values are 
      false: standalone and pseudo-distributed setups with managed Zookeeper 
      true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh) 
    </description> 
  </property> 
  <property> 
    <name>dfs.support.append</name> 
    <value>true</value>
 </property>
  <property> 
    <name>hbase.master.port</name> 
    <value>60000</value>
 </property>
 <property> 
    <name>hbase.zookeeper.property.dataDir</name> 
    <value>/data/john/database1.0/zookeeper-3.3.2</value>
 </property>
 <property> 
    <name>hbase.zookeeper.property.clientPort</name> 
    <value>2181</value>
 </property>
 <property> 
    <name>hbase.zookeeper.quorum</name> 
    <value>xxx.xxx.xxx.193,xxx.xxx.xxx.194,xxx.xxx.xxx.221</value>
    <description>the num of quorum must be odd</description>
 </property>
</configuration>

hbase-env.sh中
<property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
    <description>The mode the cluster will be in. Possible values are
      false: standalone and pseudo-distributed setups with managed Zookeeper
      true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
    </description>
  </property>
  让Hbase使用一个现有的不被Hbase托管的Zookeep集群,需要设置 conf/hbase-env.sh文件中的HBASE_MANAGES_ZK 属性为 false
    export HBASE_MANAGES_ZK=false
   
 启动Hadoop,启动hbase,
 启动hbase步骤:
 1. 首先启动zookeeper:bin/hbase-daemon.sh start zookeeper   
 2. jps一下,看是否有HQuorumPeer进程,没有的话,请查看log解决问题
 3. bin/start-hbase.sh
 
 在hbase中新建了新的数据库,可以在hadoop环境下利用bin/hadoop fs -ls /hbase查看,可以查看到表的名称
 要想知道表的结构,切换到hbase环境,bin/hbase shell  然后利用 describe 表名
 
 
 在安装过程中的问题:
 1. zookeeper节点启动不成功,查看状态后发现有not running,网上的说法是由于脚本中含有nc -q 1导致的,我在安装的过程中发现的解决的方式是:
                 在各节点的/etc/hosts文件中加入各节点的ip hostname,最终解决
 2. 启动hbase不成功,call xxx.xxx.xxx194 xxx的信息,和mismatch异常的问题,是由于当初我选择的hadoop版本是0.20.203,后来换成0.21都不行,最终换成0.20.2问题解决(hbase0.90.5+hadoop0.20.2)
             当然要将hbase中的lib里的hadoop-core-xxx.jar包替换成hadoop中的hadoop-core.jar

 3. 重启hbase是,有台机器的HRegionServer没有启动起来,解决方案:查看一下60020端口是否被占用了,如果没有被占用了,那么同步一下各节点的系统时间,可能是系统时间不同步导致的;如果被占用了,杀死占用的进程,重启hbase,(基本上问题出在系统时间不同步上)

linux
相关资讯       Hbase  Hbase安装 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款