HBaseTestingUtility设置Zookeeper clientPort的配置未起作用。

3

我在集成测试中使用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

这里出了什么问题?
1个回答

3

试试这个:

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

在 MacOS 上无法工作。已尝试过。非常奇怪,因为它在 Windows 的另一个项目中可以工作。 - Fuad Efendi

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接