GlusterFS: 访问权限设置
GlusterFS支持基于POSIX Access Control Lists的访问权限设置,在Ubuntu或者类似的系统上,只需要使用setfacl或getfacl来进行操作即可。
POSIX Access Control Lists (ACLs) allows you to assign different permissions for different users or groups even though they do not correspond to the original owner or the owning group.
For example: User john creates a file but does not want to allow anyone to do anything with this file, except another user, antony (even though there are other users that belong to the group john).
This means, in addition to the file owner, the file group, and others, additional users and groups can be granted or denied access by using POSIX ACLs.
Activating POSIX ACLs Support
To use POSIX ACLs for a file or directory, the partition of the file or directory must be mounted with POSIX ACLs support.
Activating POSIX ACLs Support on Server
To mount the backend export directories for POSIX ACLs support, use the following command:
# mount -o acl
For example:
# mount -o acl /dev/sda1 /export1
Alternatively, if the partition is listed in the /etc/fstab file, add the following entry for the partition to include the POSIX ACLs option:
LABEL=/work /export1 ext3 rw, acl 14
Activating POSIX ACLs Support on Client
To mount the glusterfs volumes for POSIX ACLs support, use the following command:
# mount –t glusterfs