【问题标题】:HBaseTestingUtility set Configuration Zookeeper clientPort not workingHBaseTestingUtility 设置配置 Zookeeper 客户端端口不工作
【发布时间】:2015-12-21 12:50:24
【问题描述】:

我使用 HBaseTestingUtility 进行集成测试。我想让 Zookeeper 监听 2181 端口

HBaseTestingUtility testUtil = new HBaseTestingUtility();
testUtil.getConfiguration().set("hbase.zookeeper.property.clientPort", "2181");
MiniHBaseCluster cluster = testUtil.startMiniCluster();

但是,每次测试运行时,Zookeeper 都会在随机端口上监听。

LOG: Started MiniZK Cluster and connect 1 ZK server on client port: 62251

这里有什么问题?

【问题讨论】:

    标签: configuration hbase apache-zookeeper hbasetestingutility


    【解决方案1】:

    试试这个:

    HBaseTestingUtility testUtil = new HBaseTestingUtility();
    testUtil.getConfiguration().set("test.hbase.zookeeper.property.clientPort", "2181");
    MiniHBaseCluster cluster = testUtil.startMiniCluster();
    

    【讨论】:

    • 不适用于 MacOS。试过了。很奇怪,因为它适用于 Windows 中的另一个项目。
    猜你喜欢
    • 2013-01-22
    • 2013-03-16
    • 1970-01-01
    • 2021-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-27
    • 1970-01-01
    相关资源
    最近更新 更多