Hadoop Common
  1. Hadoop Common
  2. HADOOP-6429

Server listener binds to wrong IP address for domain name given

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.22.0
    • Fix Version/s: None
    • Component/s: ipc
    • Labels:
      None
    • Environment:

      Description

      High-level:
      In my configuration files, I specifiy:

       
      <property>
          <name>fs.default.name</name>
          <value>hdfs://{{internal-dns}}:8020</value>
       </property>
      

      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.

        /** 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
      

      The problem seems to be in the line

      address = new InetSocketAddress(bindAddress, port);

      . bindAddress contains the DNS name of the internal interface, but address comes out with the IP address of the external interface.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Eric Anderson
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development