[ 
https://issues.apache.org/jira/browse/HDFS-7942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14371760#comment-14371760
 ] 

Brandon Li commented on HDFS-7942:
----------------------------------

Here is the explanation for wildcard usage in export 
table.(http://linux.die.net/man/5/exports)
{noformat}
wildcards
+Machine names may contain the wildcard characters * and ?, or may contain 
character class lists within [square 
brackets]. This can be used to make the exports file more compact; for 
instance, *.cs.foo.edu matches all hosts in 
the domain cs.foo.edu. As these characters also match the dots in a domain 
name, the given pattern will also 
match all hosts within any subdomain of cs.foo.edu.
{noformat}

Since NFS Gateway uses java regular expression, the usage of wildcards is a bit 
different. For example,
{noformat}
1. instead of "*.cs.foo.edu", one should use "\\w*.cs.foo.edu"
2. instead of "206.190.52.[26|23]", one should use "206.190.52.(26|23)"
{noformat}
I will update the user guide accordingly.

> NFS: support regexp grouping in nfs.exports.allowed.hosts
> ---------------------------------------------------------
>
>                 Key: HDFS-7942
>                 URL: https://issues.apache.org/jira/browse/HDFS-7942
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: nfs
>    Affects Versions: 2.6.0
>            Reporter: Brandon Li
>            Assignee: Brandon Li
>         Attachments: HDFS-7942.001.patch
>
>
> Thanks, [~yeshavora], for reporting this problem.
> Set regex value in nfs.exports.allowed.hosts property.
> {noformat}
> <property><name>nfs.exports.allowed.hosts</name><value>206.190.52.[26|23] 
> rw</value></property>
> {noformat}
> With this value, neither 206.190.52.26 nor 206.190.52.23 can mount nfs and 
> act as nfs client. In conclusion, no host can mount nfs with this regex value 
> due to access denied error.
> {noformat}
> >$ sudo su - -c "mount -o 
> >soft,proto=tcp,vers=3,rsize=1048576,wsize=1048576,nolock 206.190.52.23:/ 
> >/tmp/tmp_mnt" root
> mount.nfs: access denied by server while mounting 206.190.52.23:/
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to