我使用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
这里有什么问题?
答案 0 :(得分:2)
试试这个:
HBaseTestingUtility testUtil = new HBaseTestingUtility();
testUtil.getConfiguration().set("test.hbase.zookeeper.property.clientPort", "2181");
MiniHBaseCluster cluster = testUtil.startMiniCluster();