code: static InetSocketAddress getRemoteNamenodeAddress(Configuration conf, 
        InstanceId instance) 
      throws IOException {
      String fs = null;
      if (instance == InstanceId.NODEZERO) {
        fs = conf.get(DFS_NAMENODE_RPC_ADDRESS1_KEY);
        if (fs == null)
          fs = conf.get("fs.default.name1");
      } else if (instance == InstanceId.NODEONE) {
        fs = conf.get(DFS_NAMENODE_RPC_ADDRESS0_KEY);
        if (fs == null)
          fs = conf.get("fs.default.name0");
      } else {
        throw new IOException("Unknown instance " + instance);
      }
      if(fs != null) {
        Configuration newConf = new Configuration(conf);
        newConf.set(FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY, fs);
        conf = newConf;
      }
      return NameNode.getClientProtocolAddress(conf);
    }
docs: Returns the address of the remote namenode