2

我们正在尝试从部署到 WebLogic 12c 的 WebApp 连接到 HBase 服务器。

WebApp 使用包含 HBase 客户端连接代码的 jar 文件。此代码通过 HTablePool 的实例连接到 HBase,该实例在第一次请求 HTable 时进行如下延迟初始化:

public HTableInterface getTable(String tableName) {

    if (pool == null) {

        logger.info("Initializing connection to HBase");

        final Configuration config = HBaseConfiguration.create();

        config.set("hbase.zookeeper.quorum", "<HBaseHost>");

        pool = new HTablePool(config, Integer.MAX_VALUE);

        logger.info("HTable pool created");

    }

    return = pool.getTable(tableName);


}

此代码在从 JUnit 调用时工作正常(即,无需将其部署到 WebLogic)。但是一旦将其部署到 WL 并从 WebApp 调用,就会引发以下异常(请注意,我已将所有特定连接详细信息替换为 , 等。

信息:启动客户端连接,connectString=:2181 sessionTimeout=180000 watcher=hconnection 14-Jun-2013 17:28:06 org.apache.zookeeper.ClientCnxn$SendThread startConnect 信息:打开与服务器的套接字连接 /:2181 13/06/ 14 17:28:06 INFO zookeeper.RecoverableZooKeeper:此进程的标识符是 6504@ 2013 年 6 月 14 日 17:28:06 org.apache.zookeeper.ClientCnxn$SendThread 运行警告:服务器空的会话 0x0,意外错误,关闭套接字连接并尝试重新连接 java.lang.IllegalArgumentException:没有注册可以处理名为 Client 的配置,位于 org.apache.zookeeper 的 com.bea.common.security.jdkutils.JAASConfiguration.getAppConfigurationEntry(JAASConfiguration.java:130) .client.ZooKeeperSaslClient.(ZooKeeperSaslClient.java:92) 在 org.apache。zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:938) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:973) 13/06/14 17:28:07 警告 zookeeper.RecoverableZooKeeper:可能是暂时的ZooKeeper 异常:org.apache.zookeeper.KeeperException$ConnectionLossExce ption:KeeperErrorCode = ConnectionLoss for /hbase/master 13/06/14 17:28:07 INFO util.RetryCounter:在重试 #1 之前休眠 2000 毫秒...在重试 #1 之前休眠 2000 毫秒...在重试 #1 之前休眠 2000 毫秒...

看起来我们可能缺少一些额外的 JAAS 配置来允许来自 WL 的传出连接?

任何帮助将非常感激。

4

1 回答 1

3

好的,经过更多谷歌搜索后,我们发现这是由于:

https://issues.apache.org/jira/browse/ZOOKEEPER-1696

不使用 SASL 时 WebLogic / Zookeeper 组合的问题。

上面的 Zookeeper Jira 链接到 Zookeeper 源的修复,不幸的是我们不能使用它,因为我们必须使用 Cloudera CDH 4.2.2 运行

我们很可能会切换到 JBoss。至少 JBoss 5(我们可以运行的最低版本)没有显示此问题。我们还将尝试 JBoss 6 和 7,看看会发生什么。

会接受这个作为答案,希望它对某人有用。

于 2013-06-17T15:58:18.660 回答