GlusterFSは複数台ノードを繋げて分散ファイルシステムとして使いますが、実は1台でも構築できます。
GlusterFSの利点として、分散ファイルシステムでよりパフォーマンスを得られるほかに、1台でも容易にできて尚且つ POSIX ACL が提供できる点かなと思っている.
NFSでも「NFS4 ACL」でPOSIX ACLと同様の機能は提供できるが、正直設定が難しい。setfacl/getfaclがそのまま使える GlusterFS が楽かな.
同じ様にリモートストレージながらPOSIX ACLが使えるものに Lustre, ceph があるが、これらは大規模システムです。
ここではGlusterFSを1台で構築して、そのストレージにACLを掛けて、リモートストレージながら細かいアクセス制御ができることを示したいと思う
GlusterFSマシン1台で、内蔵ストレージが1台とます。
その内蔵ストレージですが、単体でもRAIDカードを付けての大規模ストレージでも構いません
| デバイス | 領域 | サイズ | 備考 |
| /dev/sda | OS領域 | 32GB | |
| /dev/sdb | GlusterFS | 64GB | Brick部分 |
[root@glusterfs ~]# cat /etc/redhat-release
Rocky Linux release 9.6 (Blue Onyx)
[root@glusterfs ~]# lsblk -i
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 32G 0 disk
|-sda1 8:1 0 1M 0 part
|-sda2 8:2 0 1G 0 part /boot
|-sda3 8:3 0 128M 0 part [SWAP]
|-sda4 8:4 0 1K 0 part
`-sda5 8:5 0 30.9G 0 part /
sdb 8:16 0 64G 0 disk
[root@glusterfs ~]#GlusterFSのストレージ、brickを用意します. フォーマットはxfsにしました. パーティションは作ってないです.
[root@glusterfs ~]# mkfs.xfs -L glusterfs /dev/sdb
[root@glusterfs ~]# mkdir /brick
[root@glusterfs ~]# echo "LABEL=glusterfs /brick xfs defaults 0 0" >> /etc/fstab
[root@glusterfs ~]# systemctl daemon-reload
[root@glusterfs ~]# mount -a
[root@glusterfs ~]# df -lTh /brick
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb xfs 64G 489M 64G 1% /brick
[root@glusterfs ~]#っでGlusterFSのパッケージを入れます。一応「glusterfs」としてパッケージはありますが、古い
[root@glusterfs ~]# dnf info glusterfs
Last metadata expiration check: 1:39:41 ago on Sun 05 Oct 2025 12:56:35 PM JST.
Available Packages
Name : glusterfs
Version : 6.0
Release : 57.4.el9
Architecture : x86_64
Size : 652 k
Source : glusterfs-6.0-57.4.el9.src.rpm
Repository : appstream
:っで最新の glusterfs 11 は「centos-release-gluster11」パッケージ経由でいれられる
[root@glusterfs ~]# dnf install centos-release-gluster11
:
[root@glusterfs ~]# dnf repolist --all
:
centos-gluster11 CentOS-9-stream - Gluster 11 enabled
centos-gluster11-test CentOS-9-stream - Gluster 11 Testing enabled
centos-storage-common CentOS-9 - Storage SIG - common disabled
:
[root@glusterfs ~]# dnf list available --disablerepo=* --enablerepo=centos-gluster11
:
[root@glusterfs ~]# dnf info --disablerepo=centos-gluster11-test glusterfs-server
:
Name : glusterfs-server
Version : 11.1
Release : 1.el9s
Architecture : x86_64
Size : 1.2 M
Source : glusterfs-11.1-1.el9s.src.rpm
Repository : centos-gluster11
:
[root@glusterfs ~]# dnf install --disablerepo=centos-gluster11-test glusterfs-serverっで
[root@glusterfs ~]# systemctl start glusterd
[root@glusterfs ~]# systemctl status glusterd
● glusterd.service - GlusterFS, a clustered file-system server
Loaded: loaded (/usr/lib/systemd/system/glusterd.service; enabled; preset: enabled)
Active: active (running) since Sun 2025-10-05 14:55:56 JST; 10s ago
Docs: man:glusterd(8)
Process: 2769 ExecStart=/usr/sbin/glusterd -p /var/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 2770 (glusterd)
Tasks: 8 (limit: 206056)
Memory: 15.1M
CPU: 11ms
CGroup: /system.slice/glusterd.service
mq2770 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO
Oct 05 14:55:56 glusterfs systemd[1]: Starting GlusterFS, a clustered file-system server...
Oct 05 14:55:56 glusterfs systemd[1]: Started GlusterFS, a clustered file-system server.
[root@glusterfs ~]#glusterdデーモンが起動していて、このマシン以外は繋げていない。普通ならここでglusterfsが起動するマシンを複数乗せるが今回は1台のみ
[root@glusterfs ~]# gluster pool list
UUID Hostname State
a5a28a00-8373-451c-aaeb-f7e90bcb3ebc localhost Connected
[root@glusterfs ~]#っで用意したデバイス(/dev/sdb)をストレージプールに加えます
[root@glusterfs ~]# gluster volume create gv0 glusterfs:/brick force
volume create: gv0: success: please start the volume to access data
[root@glusterfs ~]# gluster volume start gv0 <--有効にします
volume start: gv0: success
[root@glusterfs ~]#次に肝心の POSIX ACLの設定です. 一応既定ではACLが有効なってます.
[root@glusterfs ~]# gluster volume get gv0 all
:
features.acl enable
:
[root@glusterfs ~]#
(もし無効なら)
gluster volume set gv0 storage.posix.acl onfirewallとか
[root@glusterfs ~]# firewall-cmd --add-service=glusterfs --zone=public --permanent
[root@glusterfs ~]# firewall-cmd --reload[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.6 (Blue Onyx)
[root@rockylinux9 ~]#クライアントツールを入れます
[root@rockylinux9 ~]# dnf install centos-release-gluster11
[root@rockylinux9 ~]# dnf install glusterfs glusterfs-fuseっでmount操作. オプションに「acl」を載せることが必要です
[root@rockylinux9 ~]# mount -t glusterfs -o defaults,acl glusterfs:/gv0 /mnt
[root@rockylinux9 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 6.3G 9.3M 6.3G 1% /run
/dev/sda5 xfs 127G 34G 93G 27% /
/dev/sda2 xfs 960M 368M 593M 39% /boot
tmpfs tmpfs 3.2G 56K 3.2G 1% /run/user/42
tmpfs tmpfs 3.2G 36K 3.2G 1% /run/user/0
glusterfs:/gv0 fuse.glusterfs 64G 1.2G 63G 2% /mnt <-- mountされました
[root@rockylinux9 ~]#そしてACLのテスト
[root@rockylinux9 ~]# mkdir /mnt/cs
[root@rockylinux9 ~]# setfacl -m user:cryosparc:rwx /mnt/cs
[root@rockylinux9 ~]# ls -l /mnt
total 0
drwxrwxr-x+ 2 root root 6 Oct 5 15:24 cs <--[+]が出ました
[root@rockylinux9 ~]#
[root@rockylinux9 ~]# getfacl /mnt/cs/
getfacl: Removing leading '/' from absolute path names
# file: mnt/cs/
# owner: root
# group: root
user::rwx
user:cryosparc:rwx
group::r-x
mask::rwx
other::r-x
[root@rockylinux9 ~]#っとリモートのストレージに対してのACLが達成できました
/etc/fstabなら
glusterfs:/gv0 /mnt glusterfs defaults,acl 0 0を追加
autofsなら
[root@rockylinux9 ~]# cat /etc/auto.master
/- /etc/auto.home --timeout=60
[root@rockylinux9 ~]# cat /etc/auto.home
/mnt -fstype=glusterfs,_netdev,acl glusterfs:/gv0
とします