[ https://issues.apache.org/jira/browse/HDFS-6455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhiraj Butala updated HDFS-6455: --------------------------------- Attachment: HDFS-6455.patch Thanks for the feedback Brandon. Attaching a patch which catches the exception and logs it as ERROR in logs. NFS server does not exit now. 'showmount' command times out when invalid exports are provided. Output of 'hdfs nfs3': {code} 14/07/06 02:13:37 INFO nfs3.Nfs3Base: registered UNIX signal handlers for [TERM, HUP, INT] 14/07/06 02:13:38 INFO oncrpc.RpcProgram: Will accept client connections from unprivileged ports 14/07/06 02:13:38 INFO nfs3.IdUserGroup: Not doing static UID/GID mapping because '/etc/nfs.map' does not exist. 14/07/06 02:13:38 INFO nfs3.IdUserGroup: Updated user map size: 36 14/07/06 02:13:38 INFO nfs3.IdUserGroup: Updated group map size: 65 14/07/06 02:13:38 ERROR nfs.NfsExports: Invalid NFS Exports provided: java.lang.IllegalArgumentException: Incorrectly formatted line 'abc ro :foobar rw' at org.apache.hadoop.nfs.NfsExports.getMatch(NfsExports.java:363) at org.apache.hadoop.nfs.NfsExports.<init>(NfsExports.java:158) at org.apache.hadoop.nfs.NfsExports.getInstance(NfsExports.java:57) at org.apache.hadoop.hdfs.nfs.nfs3.RpcProgramNfs3.<init>(RpcProgramNfs3.java:177) at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.<init>(Nfs3.java:45) at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.startService(Nfs3.java:66) at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.main(Nfs3.java:72) 14/07/06 02:13:38 INFO nfs3.WriteManager: Stream timeout is 600000ms. 14/07/06 02:13:38 INFO nfs3.WriteManager: Maximum open streams is 256 14/07/06 02:13:38 INFO nfs3.OpenFileCtxCache: Maximum open streams is 256 14/07/06 02:13:39 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 14/07/06 02:13:39 INFO nfs3.RpcProgramNfs3: Delete current dump directory /tmp/.hdfs-nfs3 14/07/06 02:13:39 INFO nfs3.RpcProgramNfs3: Create new dump directory /tmp/.hdfs-nfs3 14/07/06 02:13:39 INFO nfs3.Nfs3Base: NFS server port set to: 2049 14/07/06 02:13:39 INFO oncrpc.RpcProgram: Will accept client connections from unprivileged ports 14/07/06 02:13:39 ERROR nfs.NfsExports: Invalid NFS Exports provided: java.lang.IllegalArgumentException: Incorrectly formatted line 'abc ro :foobar rw' at org.apache.hadoop.nfs.NfsExports.getMatch(NfsExports.java:363) at org.apache.hadoop.nfs.NfsExports.<init>(NfsExports.java:158) at org.apache.hadoop.nfs.NfsExports.getInstance(NfsExports.java:57) at org.apache.hadoop.hdfs.nfs.mount.RpcProgramMountd.<init>(RpcProgramMountd.java:88) at org.apache.hadoop.hdfs.nfs.mount.Mountd.<init>(Mountd.java:37) at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.<init>(Nfs3.java:46) at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.startService(Nfs3.java:66) at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.main(Nfs3.java:72) 14/07/06 02:13:40 INFO oncrpc.SimpleUdpServer: Started listening to UDP requests at port 4242 for Rpc program: mountd at localhost:4242 with workerCount 1 14/07/06 02:13:40 INFO oncrpc.SimpleTcpServer: Started listening to TCP requests at port 4242 for Rpc program: mountd at localhost:4242 with workerCount 1 14/07/06 02:13:40 INFO oncrpc.SimpleTcpServer: Started listening to TCP requests at port 2049 for Rpc program: NFS3 at localhost:2049 with workerCount 0 {code} > NFS: Exception should be added in NFS log for invalid separator in > allowed.hosts > -------------------------------------------------------------------------------- > > Key: HDFS-6455 > URL: https://issues.apache.org/jira/browse/HDFS-6455 > Project: Hadoop HDFS > Issue Type: Bug > Components: nfs > Affects Versions: 2.2.0 > Reporter: Yesha Vora > Attachments: HDFS-6455.patch > > > The error for invalid separator in dfs.nfs.exports.allowed.hosts property > should be added in nfs log file instead nfs.out file. > Steps to reproduce: > 1. Pass invalid separator in dfs.nfs.exports.allowed.hosts > {noformat} > <property><name>dfs.nfs.exports.allowed.hosts</name><value>host1 ro:host2 > rw</value></property> > {noformat} > 2. restart NFS server. NFS server fails to start and print exception console. > {noformat} > [hrt_qa@host1 hwqe]$ ssh -o StrictHostKeyChecking=no -o > UserKnownHostsFile=/dev/null host1 "sudo su - -c > \"/usr/lib/hadoop/sbin/hadoop-daemon.sh start nfs3\" hdfs" > starting nfs3, logging to /tmp/log/hadoop/hdfs/hadoop-hdfs-nfs3-horst1.out > DEPRECATED: Use of this script to execute hdfs command is deprecated. > Instead use the hdfs command for it. > Exception in thread "main" java.lang.IllegalArgumentException: Incorrectly > formatted line 'host1 ro:host2 rw' > at org.apache.hadoop.nfs.NfsExports.getMatch(NfsExports.java:356) > at org.apache.hadoop.nfs.NfsExports.<init>(NfsExports.java:151) > at org.apache.hadoop.nfs.NfsExports.getInstance(NfsExports.java:54) > at > org.apache.hadoop.hdfs.nfs.nfs3.RpcProgramNfs3.<init>(RpcProgramNfs3.java:176) > at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.<init>(Nfs3.java:43) > at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.main(Nfs3.java:59) > {noformat} > NFS log does not print any error message. It directly shuts down. > {noformat} > STARTUP_MSG: java = 1.6.0_31 > ************************************************************/ > 2014-05-27 18:47:13,972 INFO nfs3.Nfs3Base (SignalLogger.java:register(91)) > - registered UNIX signal handlers for [TERM, HUP, INT] > 2014-05-27 18:47:14,169 INFO nfs3.IdUserGroup > (IdUserGroup.java:updateMapInternal(159)) - Updated user map size:259 > 2014-05-27 18:47:14,179 INFO nfs3.IdUserGroup > (IdUserGroup.java:updateMapInternal(159)) - Updated group map size:73 > 2014-05-27 18:47:14,192 INFO nfs3.Nfs3Base (StringUtils.java:run(640)) - > SHUTDOWN_MSG: > /************************************************************ > SHUTDOWN_MSG: Shutting down Nfs3 at > {noformat} > NFS.out file has exception. > {noformat} > EPRECATED: Use of this script to execute hdfs command is deprecated. > Instead use the hdfs command for it. > Exception in thread "main" java.lang.IllegalArgumentException: Incorrectly > formatted line 'host1 ro:host2 rw' > at org.apache.hadoop.nfs.NfsExports.getMatch(NfsExports.java:356) > at org.apache.hadoop.nfs.NfsExports.<init>(NfsExports.java:151) > at org.apache.hadoop.nfs.NfsExports.getInstance(NfsExports.java:54) > at > org.apache.hadoop.hdfs.nfs.nfs3.RpcProgramNfs3.<init>(RpcProgramNfs3.java:176) > at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.<init>(Nfs3.java:43) > at org.apache.hadoop.hdfs.nfs.nfs3.Nfs3.main(Nfs3.java:59) > ulimit -a for user hdfs > core file size (blocks, -c) 409600 > data seg size (kbytes, -d) unlimited > scheduling priority (-e) 0 > file size (blocks, -f) unlimited > pending signals (-i) 188893 > max locked memory (kbytes, -l) unlimited > max memory size (kbytes, -m) unlimited > open files (-n) 32768 > pipe size (512 bytes, -p) 8 > POSIX message queues (bytes, -q) 819200 > real-time priority (-r) 0 > stack size (kbytes, -s) 10240 > cpu time (seconds, -t) unlimited > max user processes (-u) 65536 > virtual memory (kbytes, -v) unlimited > file locks (-x) unlimited > {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252)