You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Eric Anderson (JIRA)" <ji...@apache.org> on 2009/12/10 17:10:18 UTC

[jira] Created: (HADOOP-6429) Server listener binds to wrong IP address for domain name given

Server listener binds to wrong IP address for domain name given
---------------------------------------------------------------

                 Key: HADOOP-6429
                 URL: https://issues.apache.org/jira/browse/HADOOP-6429
             Project: Hadoop Common
          Issue Type: Bug
          Components: ipc
    Affects Versions: 0.22.0
         Environment: Ubuntu Linux,  kernel 2.6.24-25-server, x86_64 architecture.  Java 1.6.0., OpenJDK.  Server has 4 physical Ethernet cards,  configured as follows: {{eth0}} is assigned an IP address {{external-ip}}.  {{eth1}}-{{eth3}} are bonded as {{bond0}}, which is assigned an IP address {{internal-ip}}.  This server has two dns entries: {{external-dns}} which resolves to {{external-ip}} and {{internal-dns}} which resolves to {{internal-ip}}.
            Reporter: Eric Anderson


High-level: 
In my configuration files, I specifiy:
{code:xml} 
<property>
    <name>fs.default.name</name>
    <value>hdfs://{{internal-dns}}:8020</value>
 </property>
{code}

The name node server binds to address {{external-ip}}:8020, while all the data nodes try to connect to {{internal-ip}}:8020, and nothing works.

Low-level: I've traced this down as far as {{org.apache.hadoop.ipc.Server}}, private class {{Listener}}.  
{code:java}
  /** Listens on the socket. Creates jobs for the handler threads*/
  private class Listener extends Thread {
    
    private ServerSocketChannel acceptChannel = null; //the accept channel
    private Selector selector = null; //the selector that we use for the server
    private InetSocketAddress address; //the address we bind at
    private Random rand = new Random();
    private long lastCleanupRunTime = 0; //the last time when a cleanup connec-
                                         //-tion (for idle connections) ran
    private long cleanupInterval = 10000; //the minimum interval between 
                                          //two cleanup runs
    private int backlogLength = conf.getInt("ipc.server.listen.queue.size", 128);
    
    public Listener() throws IOException {
      address = new InetSocketAddress(bindAddress, port);
      LOG.info("in Server/Listener. bindAddress=" + bindAddress + ", address="+address);    //Added by EA for testing
      // Create a new server socket and set to non blocking mode
      acceptChannel = ServerSocketChannel.open();
      acceptChannel.configureBlocking(false);

      // Bind the server socket to the local host and port
      bind(acceptChannel.socket(), address, backlogLength);
      port = acceptChannel.socket().getLocalPort(); //Could be an ephemeral port
{code}

The problem  seems to be in the line {code}address = new InetSocketAddress(bindAddress, port);{code}.  bindAddress  contains the DNS name of the *internal* interface, but address comes out with the IP address of the *external* interface.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6429) Server listener binds to wrong IP address for domain name given

Posted by "Eric Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12788768#action_12788768 ] 

Eric Anderson commented on HADOOP-6429:
---------------------------------------

Here's more configuration information.  The internal DNS name and ip address are {{sdr.esl}} and {{10.138.207.6}}, respectively.  The external counterparts are {{sdr.cs.colorado.edu}} and {{128.138.207.6}}.

{noformat}
andersoe@sdr: ~ $ java -version
java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)
andersoe@sdr: ~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:1e:68:0f:25:d8 brd ff:ff:ff:ff:ff:ff
    inet 128.138.207.6/26 brd 128.138.207.63 scope global eth0
    inet6 fe80::21e:68ff:fe0f:25d8/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
    link/ether 00:1e:68:0f:25:dc brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
    link/ether 00:1e:68:0f:25:da brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
    link/ether 00:1e:68:0f:25:db brd ff:ff:ff:ff:ff:ff
    inet 169.254.5.247/16 brd 169.254.255.255 scope link eth3:avahi
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue 
    link/ether 00:1e:68:0f:25:dc brd ff:ff:ff:ff:ff:ff
    inet 10.138.207.6/16 brd 10.138.255.255 scope global bond0
    inet6 fe80::21e:68ff:fe0f:25dc/64 scope link 
       valid_lft forever preferred_lft forever
7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue 
    link/ether 92:f2:d3:0a:89:1e brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global vnet0
    inet6 fe80::90f2:d3ff:fe0a:891e/64 scope link 
       valid_lft forever preferred_lft forever
andersoe@sdr: ~ $ dig sdr.esl

; <<>> DiG 9.4.2-P2.1 <<>> sdr.esl
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64307
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;sdr.esl.			IN	A

;; ANSWER SECTION:
sdr.esl.		0	IN	A	10.138.207.6

;; Query time: 0 msec
;; SERVER: 10.138.207.2#53(10.138.207.2)
;; WHEN: Thu Dec 10 09:12:05 2009
;; MSG SIZE  rcvd: 41

andersoe@sdr: ~ $ dig sdr.cs.colorado.edu

; <<>> DiG 9.4.2-P2.1 <<>> sdr.cs.colorado.edu
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 209
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;sdr.cs.colorado.edu.		IN	A

;; ANSWER SECTION:
sdr.cs.colorado.edu.	0	IN	A	128.138.207.6

;; Query time: 0 msec
;; SERVER: 10.138.207.2#53(10.138.207.2)
;; WHEN: Thu Dec 10 09:12:10 2009
;; MSG SIZE  rcvd: 53

andersoe@sdr: ~ $ uname -a
Linux sdr 2.6.24-25-server #1 SMP Tue Oct 20 07:20:02 UTC 2009 x86_64 GNU/Linux
andersoe@sdr: ~ $ 
{noformat}

> Server listener binds to wrong IP address for domain name given
> ---------------------------------------------------------------
>
>                 Key: HADOOP-6429
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6429
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc
>    Affects Versions: 0.22.0
>         Environment: Ubuntu Linux,  kernel 2.6.24-25-server, x86_64 architecture.  Java 1.6.0., OpenJDK.  Server has 4 physical Ethernet cards,  configured as follows: {{eth0}} is assigned an IP address {{external-ip}}.  {{eth1}}-{{eth3}} are bonded as {{bond0}}, which is assigned an IP address {{internal-ip}}.  This server has two dns entries: {{external-dns}} which resolves to {{external-ip}} and {{internal-dns}} which resolves to {{internal-ip}}.
>            Reporter: Eric Anderson
>
> High-level: 
> In my configuration files, I specifiy:
> {code:xml} 
> <property>
>     <name>fs.default.name</name>
>     <value>hdfs://{{internal-dns}}:8020</value>
>  </property>
> {code}
> The name node server binds to address {{external-ip}}:8020, while all the data nodes try to connect to {{internal-ip}}:8020, and nothing works.
> Low-level: I've traced this down as far as {{org.apache.hadoop.ipc.Server}}, private class {{Listener}}.  
> {code:java}
>   /** Listens on the socket. Creates jobs for the handler threads*/
>   private class Listener extends Thread {
>     
>     private ServerSocketChannel acceptChannel = null; //the accept channel
>     private Selector selector = null; //the selector that we use for the server
>     private InetSocketAddress address; //the address we bind at
>     private Random rand = new Random();
>     private long lastCleanupRunTime = 0; //the last time when a cleanup connec-
>                                          //-tion (for idle connections) ran
>     private long cleanupInterval = 10000; //the minimum interval between 
>                                           //two cleanup runs
>     private int backlogLength = conf.getInt("ipc.server.listen.queue.size", 128);
>     
>     public Listener() throws IOException {
>       address = new InetSocketAddress(bindAddress, port);
>       LOG.info("in Server/Listener. bindAddress=" + bindAddress + ", address="+address);    //Added by EA for testing
>       // Create a new server socket and set to non blocking mode
>       acceptChannel = ServerSocketChannel.open();
>       acceptChannel.configureBlocking(false);
>       // Bind the server socket to the local host and port
>       bind(acceptChannel.socket(), address, backlogLength);
>       port = acceptChannel.socket().getLocalPort(); //Could be an ephemeral port
> {code}
> The problem  seems to be in the line {code}address = new InetSocketAddress(bindAddress, port);{code}.  bindAddress  contains the DNS name of the *internal* interface, but address comes out with the IP address of the *external* interface.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.