HDFS-11365. Log portnumber in PrivilegedNfsGatewayStarter. Contributed by Mukul Kumar Singh.
This commit is contained in:
parent
b4078e1d0e
commit
1af0a4d901
|
@ -18,9 +18,12 @@ package org.apache.hadoop.hdfs.nfs.nfs3;
|
||||||
|
|
||||||
import java.net.DatagramSocket;
|
import java.net.DatagramSocket;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
import org.apache.commons.daemon.Daemon;
|
import org.apache.commons.daemon.Daemon;
|
||||||
import org.apache.commons.daemon.DaemonContext;
|
import org.apache.commons.daemon.DaemonContext;
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.hdfs.nfs.conf.NfsConfigKeys;
|
import org.apache.hadoop.hdfs.nfs.conf.NfsConfigKeys;
|
||||||
import org.apache.hadoop.hdfs.nfs.conf.NfsConfiguration;
|
import org.apache.hadoop.hdfs.nfs.conf.NfsConfiguration;
|
||||||
|
|
||||||
|
@ -34,7 +37,7 @@ import org.apache.hadoop.hdfs.nfs.conf.NfsConfiguration;
|
||||||
* Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594880
|
* Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594880
|
||||||
*/
|
*/
|
||||||
public class PrivilegedNfsGatewayStarter implements Daemon {
|
public class PrivilegedNfsGatewayStarter implements Daemon {
|
||||||
|
static final Log LOG = LogFactory.getLog(PrivilegedNfsGatewayStarter.class);
|
||||||
private String[] args = null;
|
private String[] args = null;
|
||||||
private DatagramSocket registrationSocket = null;
|
private DatagramSocket registrationSocket = null;
|
||||||
|
|
||||||
|
@ -49,9 +52,15 @@ public class PrivilegedNfsGatewayStarter implements Daemon {
|
||||||
NfsConfigKeys.DFS_NFS_REGISTRATION_PORT_KEY + "' configured to a " +
|
NfsConfigKeys.DFS_NFS_REGISTRATION_PORT_KEY + "' configured to a " +
|
||||||
"privileged port.");
|
"privileged port.");
|
||||||
}
|
}
|
||||||
registrationSocket = new DatagramSocket(
|
|
||||||
new InetSocketAddress("localhost", clientPort));
|
try {
|
||||||
registrationSocket.setReuseAddress(true);
|
registrationSocket = new DatagramSocket(
|
||||||
|
new InetSocketAddress("localhost", clientPort));
|
||||||
|
registrationSocket.setReuseAddress(true);
|
||||||
|
} catch (SocketException e) {
|
||||||
|
LOG.error("Init failed for port=" + clientPort, e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
args = context.getArguments();
|
args = context.getArguments();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue