You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Pankaj kr <pa...@huawei.com> on 2014/12/29 07:59:25 UTC

Listen port will be bind always to the passed command line address

Hi,

                In Thrift server,  listen port will be bind always to the address which  is passed through command line argument.
                ------
InetSocketAddress inetSocketAddress = bindToPort(cmd.getOptionValue("bind"), listenPort);
-----

private static InetSocketAddress bindToPort(String bindValue, int listenPort)
      throws UnknownHostException {
    try {
      if (bindValue == null) {
        return new InetSocketAddress(listenPort);
      } else {
        return new InetSocketAddress(InetAddress.getByName(bindValue), listenPort);
      }
    } catch (UnknownHostException e) {
      throw new RuntimeException("Could not bind to provided ip address", e);
    }
  }

                In case when bind address is not passed through argument then it is binding with any local  address. It should read hbase.thrift.info.bindAddress  value from configuration first.

                                Shall I raise a Jira and  implement this change?

Regards,
Pankaj

Re: Listen port will be bind always to the passed command line address

Posted by Stack <st...@duboce.net>.
On Sun, Dec 28, 2014 at 10:59 PM, Pankaj kr <pa...@huawei.com> wrote:

> Hi,
>
>                 In Thrift server,  listen port will be bind always to the
> address which  is passed through command line argument.
>                 ------
> InetSocketAddress inetSocketAddress =
> bindToPort(cmd.getOptionValue("bind"), listenPort);
> -----
>
> private static InetSocketAddress bindToPort(String bindValue, int
> listenPort)
>       throws UnknownHostException {
>     try {
>       if (bindValue == null) {
>         return new InetSocketAddress(listenPort);
>       } else {
>         return new InetSocketAddress(InetAddress.getByName(bindValue),
> listenPort);
>       }
>     } catch (UnknownHostException e) {
>       throw new RuntimeException("Could not bind to provided ip address",
> e);
>     }
>   }
>
>                 In case when bind address is not passed through argument
> then it is binding with any local  address. It should read
> hbase.thrift.info.bindAddress  value from configuration first.
>
>                                 Shall I raise a Jira and  implement this
> change?
>
Please.
St.Ack