You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Ian Stevens <i....@syncapse.com> on 2011/05/18 22:50:00 UTC

Port 0 being used when calling HBaseTestingUtility().startMiniCluster(1) on AWS

Hi everyone. We had some tests which were using HBaseTestingUtility to start a single node cluster. These worked fine on our desktops and testing environments, but when we switched to running the tests on Amazon Web Services, startMiniCluster() raised a BindException:

>      [exec]     u.startMiniCluster(1)
>      [exec] BindException: java.net.BindException: Problem binding to /10.35.75.130:0 : Cannot assign requested address

I'm guessing the issue here is that it's using port 0 for some reason. In previous environments, a random port was automatically selected (by HBaseTestingUtility, I assume). We had no other configuration aside from any defaults. The code is just an instantiation of HBaseTestingUtility followed by startMiniCluster(1). Migrating our testing to AWS seems to have broken this.

Any ideas?

thanks,
Ian.


Re: Port 0 being used when calling HBaseTestingUtility().startMiniCluster(1) on AWS

Posted by Ted Yu <yu...@gmail.com>.
Ian:
Please take a look at https://issues.apache.org/jira/browse/HBASE-3794:

+    TEST_UTIL.getConfiguration().setInt("hbase.regionserver.port", 0);
     TestRegionServer rs = new
TestRegionServer(TEST_UTIL.getConfiguration());

On Wed, May 18, 2011 at 2:23 PM, Stack <st...@duboce.net> wrote:

> On Wed, May 18, 2011 at 1:50 PM, Ian Stevens <i....@syncapse.com>
> wrote:
> > Hi everyone. We had some tests which were using HBaseTestingUtility to
> start a single node cluster. These worked fine on our desktops and testing
> environments, but when we switched to running the tests on Amazon Web
> Services, startMiniCluster() raised a BindException:
> >
> >>      [exec]     u.startMiniCluster(1)
> >>      [exec] BindException: java.net.BindException: Problem binding to /
> 10.35.75.130:0 : Cannot assign requested address
> >
> > I'm guessing the issue here is that it's using port 0 for some reason. In
> previous environments, a random port was automatically selected (by
> HBaseTestingUtility, I assume). We had no other configuration aside from any
> defaults. The code is just an instantiation of HBaseTestingUtility followed
> by startMiniCluster(1). Migrating our testing to AWS seems to have broken
> this.
> >
>
> I would suggest checking the src.  We are logging port 0 as what we
> are using but my guess is that this is a mislog.  We use port zero so
> system will pick a random port and we're not logging what the random
> port chosen is.
>
> St.Ack
>

Re: Port 0 being used when calling HBaseTestingUtility().startMiniCluster(1) on AWS

Posted by Ian Stevens <i....@syncapse.com>.
It doesn't look like a mislog. Here's the root cause that my test code was obscuring:

2011-05-19 15:20:09,194 DEBUG [main] regionserver.HLog(547): closing hlog writer in hdfs://localhost:37249/user/root/.META./1028785192/.logs
Traceback (most recent call last):
  File "<string>", line 1, in <module>
	at org.apache.hadoop.hbase.ipc.HBaseServer.bind(HBaseServer.java:179)
	at org.apache.hadoop.hbase.ipc.HBaseServer$Listener.<init>(HBaseServer.java:242)
	at org.apache.hadoop.hbase.ipc.HBaseServer.<init>(HBaseServer.java:998)
	at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.<init>(HBaseRPC.java:637)
	at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:596)
	at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:224)
	at org.apache.hadoop.hbase.LocalHBaseCluster.<init>(LocalHBaseCluster.java:94)
	at org.apache.hadoop.hbase.MiniHBaseCluster.init(MiniHBaseCluster.java:59)
	at org.apache.hadoop.hbase.MiniHBaseCluster.<init>(MiniHBaseCluster.java:54)
	at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:186)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)

The logged address is the one provided to ServerSocket.bind(). Looks like it's a DNS issue.

Ian.

On 2011-05-18, at 5:23 PM, Stack wrote:

> On Wed, May 18, 2011 at 1:50 PM, Ian Stevens <i....@syncapse.com> wrote:
>> Hi everyone. We had some tests which were using HBaseTestingUtility to start a single node cluster. These worked fine on our desktops and testing environments, but when we switched to running the tests on Amazon Web Services, startMiniCluster() raised a BindException:
>> 
>>>      [exec]     u.startMiniCluster(1)
>>>      [exec] BindException: java.net.BindException: Problem binding to /10.35.75.130:0 : Cannot assign requested address
>> 
>> I'm guessing the issue here is that it's using port 0 for some reason. In previous environments, a random port was automatically selected (by HBaseTestingUtility, I assume). We had no other configuration aside from any defaults. The code is just an instantiation of HBaseTestingUtility followed by startMiniCluster(1). Migrating our testing to AWS seems to have broken this.
>> 
> 
> I would suggest checking the src.  We are logging port 0 as what we
> are using but my guess is that this is a mislog.  We use port zero so
> system will pick a random port and we're not logging what the random
> port chosen is.
> 
> St.Ack


Re: Port 0 being used when calling HBaseTestingUtility().startMiniCluster(1) on AWS

Posted by Stack <st...@duboce.net>.
On Wed, May 18, 2011 at 1:50 PM, Ian Stevens <i....@syncapse.com> wrote:
> Hi everyone. We had some tests which were using HBaseTestingUtility to start a single node cluster. These worked fine on our desktops and testing environments, but when we switched to running the tests on Amazon Web Services, startMiniCluster() raised a BindException:
>
>>      [exec]     u.startMiniCluster(1)
>>      [exec] BindException: java.net.BindException: Problem binding to /10.35.75.130:0 : Cannot assign requested address
>
> I'm guessing the issue here is that it's using port 0 for some reason. In previous environments, a random port was automatically selected (by HBaseTestingUtility, I assume). We had no other configuration aside from any defaults. The code is just an instantiation of HBaseTestingUtility followed by startMiniCluster(1). Migrating our testing to AWS seems to have broken this.
>

I would suggest checking the src.  We are logging port 0 as what we
are using but my guess is that this is a mislog.  We use port zero so
system will pick a random port and we're not logging what the random
port chosen is.

St.Ack