You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Tuan Le Dinh <ld...@gmail.com> on 2015/09/24 08:49:42 UTC

Change Zookeeper clientPort from HbaseTestingUtility

Hi hbase members,

I am using HbaseTestingUtility version 0.98.14-hadoop2 for integration test.
I want Zookeeper to listen on a fixed port 2181.
However, using the code snippets below, Zookeeper uses a random port
everytime it runs.

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

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

What am I doing wrong here? Please help me to figure it out.

Thank you.
Tuan Le

Re: Change Zookeeper clientPort from HbaseTestingUtility

Posted by Ted Yu <yu...@gmail.com>.
Please see the following in HBaseTestingUtility.java :

   * Start a mini ZK cluster. If the property
"test.hbase.zookeeper.property.clientPort" is set
   *  the port mentionned is used as the default port for ZooKeeper.
   */
  private MiniZooKeeperCluster startMiniZKCluster(final File dir,
      int zooKeeperServerNum)

Cheers

On Wed, Sep 23, 2015 at 11:49 PM, Tuan Le Dinh <ld...@gmail.com> wrote:

> Hi hbase members,
>
> I am using HbaseTestingUtility version 0.98.14-hadoop2 for integration
> test.
> I want Zookeeper to listen on a fixed port 2181.
> However, using the code snippets below, Zookeeper uses a random port
> everytime it runs.
>
> HBaseTestingUtility testUtil = new HBaseTestingUtility();
> testUtil.getConfiguration().set("hbase.zookeeper.property.clientPort",
> "2181");
> MiniHBaseCluster cluster = testUtil.startMiniCluster();
>
> LOG: Started MiniZK Cluster and connect 1 ZK server on client port: 64914
>
> What am I doing wrong here? Please help me to figure it out.
>
> Thank you.
> Tuan Le
>