7

我们有一个使用 Cloudera Manager 配置的 CDH3u2 的 8 节点集群。我们有一个专用的主节点运行我们唯一的 zookeeper 实例。当我将 hive 配置为运行从主节点执行的本地 hadoop 时,从 HBase 检索数据没有问题。当我通过 hive 运行分布式 map/reduce 时,当从节点连接到 zookeeper 时出现以下错误。

HBase 能够连接到 ZooKeeper,但连接会立即关闭。这可能表明服务器有太多连接(默认值为 30)。

我们尝试将最大连接数设置得更高(我们甚至尝试取消限制)。这是一个用户很少的开发集群,我知道问题不在于连接太多(我可以使用./zkCli从从节点连接到zookeeper)。

服务器端日志表明会话已被客户端终止。

客户端hadoop日志说:'引起:org.apache.zookeeper.KeeperException$ConnectionLossException:KeeperErrorCode = ConnectionLoss for /hbase

知道为什么我无法通过 Hive Map/Reduce 维护与 zookeeper 的连接吗?

hbase 和 zookeeper 的配置是:

# Autogenerated by Cloudera SCM on Wed Dec 28 08:42:23 CST 2011
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/zookeeper
clientPort=2181
maxClientCnxns=1000
minSessionTimeout=4000
maxSessionTimeout=40000

HBase 站点 XML 是:

<property>
  <name>hbase.rootdir</name>
  <value>hdfs://alnnimb01:8020/hbase</value>
  <description>The directory shared by region servers. Should be fully-qualified to include the filesystem to use. E.g: hdfs://NAMENODE_SERVER:PORT/HBASE_ROOTDIR</description>
</property>

<property>
  <name>hbase.master.port</name>
  <value>60000</value>
  <description>The port master should bind to.</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>hbase.master.info.port</name>
  <value>60010</value>
  <description>The port for the hbase master web UI Set to -1 if you do not want the info server to run.</description>
</property>
















<property>
  <name>zookeeper.znode.parent</name>
  <value>/hbase</value>
  <description>Root ZNode for HBase in ZooKeeper. All of HBase's ZooKeeper files that are configured with a relative path will go under this node. By default, all of HBase's ZooKeeper file path are configured with a relative path, so they will all go under this directory unless changed.</description>
</property>

<property>
  <name>zookeeper.znode.rootserver</name>
  <value>root-region-server</value>
  <description>Path to ZNode holding root region location. This is written by the master and read by clients and region servers. If a relative path is given, the parent folder will be ${zookeeper.znode.parent}. By default, this means the root location is stored at /hbase/root-region-server.</description>
</property>


  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
    <description>The ZooKeeper client port to which HBase clients will     connect</description>
  </property>

  <property>
<name>hbase.zookeeper.quorum</name>
<value>alnnimb01.aln.experian.com</value>
<description>Comma separated list of servers in the ZooKeeper Quorum. For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".</description>

4

4 回答 4

4

事实证明,Hive 提交的 Map/Reduce 正在尝试连接到 'localhost' 的 zookeeper,而不管配置文件中的 zookeeper.quorom 是如何设置的。我将 /etc/hosts 更改为必须将别名“localhost”指向我的主节点的 IP,并保持与 zookeeper 的连接。仍在寻找更好的解决方案,但这暂时可行。

于 2012-02-13T14:02:20.333 回答
3

我想到了。这是一个配置问题(正如我一直怀疑的那样)。解决方案是:

-在“hive-site.xml”中设置“hbase.zookeeper.quorum”并将其放在“hadoop-conf”目录中

让我失望的是 hive-default.xml 中没有“ hbase .zookeeper.quorum”。我一直在玩“ hive .zookeeper.quorum”,这不是要更改的正确配置。

于 2012-04-03T16:02:35.630 回答
1

很抱歉发布新答案。我想对上一个答案发表评论,但评论 UI 似乎消失了 >.< ...

无论如何,我想说我遇到了同样的问题,并且通过 /etc/hosts hack 解决了这个问题,但这似乎是一个非常肮脏的解决方案......

有没有人想出一个干净地解决这个问题的方法......??

谢谢 :) !

于 2012-03-26T22:50:49.033 回答
0

我遇到了完全相同的问题。我所做的是使用以下 conf 启动 hive cli,它工作正常。

hive --hiveconf hbase.zookeeper.quorum={zk-host}

您应该配置 HBase 以使用外部 zookeeper 并将 {zk-host} 替换为 zookeeper 的主机。在使用 jdbc 访问 hive 时,我仍在寻找如何解决此问题。

于 2018-05-23T06:07:30.870 回答