【问题标题】:hbase zookeeper client connect issuehbase zookeeper客户端连接问题
【发布时间】:2013-05-30 07:03:18
【问题描述】:

登录集群环境时,我在 zookeeper 中收到以下错误。我正在使用与 hbase 一起提供的默认 zookeeper。

HBase is able to connect to ZooKeeper but the connection closes immediately. 
This could be a sign that the server has too many connections (30 is the default)
Consider inspecting your ZK server logs for that error and then make sure you  
are reusing HBase Configuration as often as you can. See HTable's javadoc for
more information.

【问题讨论】:

  • 需要更多细节。你想做什么以及如何做?向我们展示日志会很有帮助。同时,请确保您没有同时打开多个 HTable 实例。

标签: hadoop hbase apache-zookeeper


【解决方案1】:

对我来说,这似乎是一个文件句柄问题。 HBase 同时使用大量文件。在大多数 *nix 系统上,默认的 ulimit -n - 即用户文件限制 1024 是不够的。将文件句柄的最大数量增加到更高的值(例如 10,000 或更多)可能会有所帮助。请注意,为运行 HBase 进程的用户增加文件句柄是操作系统配置,而不是 HBase 配置。

如果您使用的是 Ubuntu,则需要进行以下更改:

在文件 /etc/security/limits.conf 中添加以下行

hadoop  -       nofile  32768

将 hadoop 替换为运行 Hadoop 和 HBase 的任何用户。如果您有单独的用户,则需要 2 个条目,每个用户一个。在同一个文件中设置 nproc 硬限制和软限制。例如:

hadoop soft/hard nproc 32000

在文件 /etc/pam.d/common-session 添加为文件的最后一行:

session required  pam_limits.so

否则将不会应用 /etc/security/limits.conf 中的更改。

不要忘记注销并重新登录以使更改生效。

参考:http://hbase.apache.org/book.html#basic.prerequisites

HTH

【讨论】:

    【解决方案2】:

    可能有很多原因。

    1. 我想说,先试试this
    2. 验证是否设置了 /etc/hosts 文件correctly
    3. Check 你的 hbase 配置。您是否配置了 hbase-env.sh 来管理 Zookeeper 本身?您是否在 hbase-site.xml 中配置了 zookeeper quorum?
    4. 尝试将 zoo.cfg 复制到 hadoop conf 目录中(实际上是在类路径上) 簇。 (Source)
    5. 如果这不起作用,请检查您的代码并查看您是否正在创建多个 HBaseConfiguration 对象。正如here 所述,该方法是创建一个单独的 HBaseConfiguration 对象,然后在所有代码中重用它。

    【讨论】:

    • 感谢您的回复,但我已经将客户端最大连接数更改为 100,但没有运气。我没有编写任何代码,我正在尝试将 apache nutch webcrawl 配置为 hbase 后端。
    • 我的主机文件条目是 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 masterIP MasterHostname salve1IP Slave1Hostname10.6.104.68 INHYDBILXHDP03
    【解决方案3】:

    你也可以看看hbase.regionserver.handler.count

    http://hbase.apache.org/configuration.html#recommended_configurations

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多