hadoop setfacl --set 不工作

hadoop setfacl --set not working

使用受 kerberos 保护的 Hadoop-2.6.0。尝试使用以下命令为目录设置 ACL

命令

hadoop fs -setfacl --set user::rwx,user:user1:---,group::rwx,other::rwx /test1

它给出的信息为"Too many arguments"

错误

-setfacl: Too many arguments
Usage: hadoop fs [generic options] -setfacl [-R] [{-b|-k} {-m|-x <acl_spec>} <path>]|[--set <acl_spec> <path>]

我确信命令语法是正确的,而且从 REST API 执行时相同的命令工作正常。

需要一个解决方案。

这是 HDFS setfacl 命令的正确语法。如果您是 Windows cmd.exe 的 运行,那么如果命令行参数包含任何 cmd.exe 参数定界符,您可能需要将命令行参数用引号引起来。在cmd.exe中,参数分隔符为space、逗号、分号和等号。 ACL 规范的语法包含逗号,因此我们需要将其括在引号中。否则,cmd.exe 在调用 Hadoop 代码之前将其拆分为多个参数,这就是为什么您会看到参数过多错误的原因。当我在 Windows 上 运行 时,它起作用了:

hadoop fs -setfacl --set "user::rwx,user:user1:---,group::rwx,other::rwx" /test1