XAttr设置调试版

[hadoop@hadoop1 ~]$ hadoop fs -setfattr -n name  -v value /xattr
2020-03-10 10:52:16,636 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
-setfattr: An XAttr name must be prefixed with user/trusted/security/system/raw, followed by a '.'

设置属性必须要有前缀。

给/xattr目录设置一个k-v属性。
设置属性:

[hadoop@hadoop1 ~]$ hadoop fs -setfattr -n user.xattr_test_key  -v xattr_test_value /xattr

查看/xattr的属性:

[hadoop@hadoop1 ~]$ hadoop fs -getfattr -n user.xattr_test_key /xattr
2020-03-10 11:05:07,500 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
# file: /xattr
user.xattr_test_key="xattr_test_value"

新建子目录再查看:

[hadoop@hadoop1 ~]$ hadoop fs -getfattr -n user.xattr_test_key /xattr/a
2020-03-10 11:43:51,824 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
# file: /xattr/a
getfattr: At least one of the attributes provided was not found.

显示子目录没有发现有这个属性的。

猜你喜欢

转载自blog.csdn.net/answer100answer/article/details/104770559