前言
①GFS是一个可扩展的分布式文件系统,用于大型的、分布式的、对大量数据进行访问的应用。它运行于廉价的普通硬件上,并提供容错功能。它可以给大量的用户提供总体性能较高的服务。
②GFS 也就是 google File System,Google公司为了存储海量搜索数据而设计的专用文件系统。
一、何为GlusterFS
1.1、GlusterFS的简单介绍
1.1.1、开源的分布式文件系统
1.1.2、由存储服务器、客户端以及NFS/Samba存储网关组成
1.1.3、无元数据服务器
1.2、GlusterFS的特点
1.2.1、扩展性和高性能
1.2.2、高可用性
1.2.3、全局统一命名空间
1.2.4、弹性卷管理
1.2.5、基于标准协议
1.3、GlusterFS的一些术语
1.3.1、Brick
1.3.2、Volume
1.3.3、FUSE
1.3.4、VFS
1.3.5、Glusterd
1.4、模块化堆栈式架构
1.4.1、模块化、堆栈式的架构
1.4.2、通过对模块的组合,实现复杂的功能
二、GlusterFS的工作原理
2.1、GlusterFS工作流程
2.2、弹性HASH算法
2.2.1、通过HASH算法得到一个32位的整数
2.2.2、划分为N个连续的子空间,每个空间对应一个Brick
2.2.3、弹性HASH算法的优点
①保证数据平均分布在每一个Brick中
②解决了对元数据服务器的依赖,进而解决了单点故障以及访问瓶颈
三、GlusterFS的卷类型
3.1、分布式卷
3.1.1、没有对文件进行分块处理
3.1.2、通过扩展文件属性保存HASH值
3.1.3、支持的底层文件系统有EXT3、EXT4、ZFS、XFS等
3.2、分布式卷的特点
3.2.1、文件分布在不同的服务器,不具备冗余性
3.2.2、更容易和廉价地扩展卷地大小
3.2.3、单点故障会造成数据丢失
3.2.4、依赖底层的数据保护
3.3、条带卷
3.3.1、根据偏移量将文件分层N块(N个条带节点),轮询地存储在每个Brick Server节点
3.3.2、存储大文件时,性能尤为突出
3.3.3、不具备冗余性,类型Reid0
3.4、条带卷的特点
3.4.1、数据被分割成更小块分布到块服务器群中的不同条带区
3.4.2、分布减少了负载且更小的文件加速了存取的速度
3.4.3、没有数据冗余
3.4.4、创建条带卷
创建了一个名为Stripe-volume的条带卷,文件将被分块轮询的存储在Server1:/dir1和Server2:/dir2两个Brick中
gluster volume create stripe-volume stripe 2 transport tcp server1:/dir1 server2:/dir2
3.5、复制卷
3.5.1、同一文件保存一份或多份副本
3.5.2、因为要保存副本,所以磁盘利用率较低
3.5.3、若多个节点上的存储空间不一致,将按照磁盘容量最低节点的容量作为该卷的总容量
3.6、复制卷的特点
3.6.1、卷中所有的服务器均保存一个完整的副本
3.6.2、卷的副本数量可由客户创建的时候决定
3.6.3、至少有两个块服务器或更多服务器
3.6.4、具备冗余性
3.6.5、创建复制卷
创建了一个名为rep-volume的条带卷,文件将同时存储两个副本,分布在Server1:/dir1和Server2:/dir2两个Brick中
gluster volume create rep-volume replica 2 transport tcp server1:/dir1 server2:/dir2
3.7、分布式条带卷
3.7.1、兼顾分布式卷和条带卷的功能
3.7.2、主要用于大文件访问处理
3.7.3、至少最少需要4台服务器
3.7.4、创建分布式条带卷
创建了名为dis-stripe的分布式条带卷,配置分布式的条带卷时,卷中Brick所包含的存储服务器数必须是条带数的倍数(>=2倍)
gluster volume create dis-stripe stripe 2 transport tcp server1:/dir1 server2:/dir2 server3:/dir3 server4:/dir4
3.8、分布式复制卷
3.8.1、兼顾分布式卷和复制卷的功能
3.8.2、用于需要冗余的情况
3.8.3、创建分布式条带卷
创建了名为dis-rep的分布式条带卷,配置分布式的复制卷时,卷中Brick所包含的存储服务器数必须是条带数的倍数(>=2倍)
gluster volume create dis-rep replica 2 transport tcp server1:/dir1 server2:/dir2 server3:/dir3 server4:/dir4
四、GlusterFS部署
4.1、群集环境
4.2、卷类型
卷名称 | 卷类型 | 空间大小 | Brick |
---|---|---|---|
dis-volume | 分布式卷 | 9.6G | node1(/sdb1)node2(/sdb1) |
stripe-volume | 条带卷 | 9.6G | node3(/sdb1)node4(/sdb1) |
rep-volume | 复制卷 | 4.8G | node1(/sdc1)node2(/sdc1) |
dis-stripe | 分布式条带卷 | 20G | node1(/sdd1)node2(/sdd1)node3(/sdd1)node4(/sdd1) |
dis-rep | 分布式复制卷 | 9.6G | node1(/sde1)node2(/sde1)node3(/sde1)node4(/sde1) |
4.3、部署
每个node节点上设置四个磁盘,每个磁盘5G
4.3.1、添加映射(node1、node2、node3、node4和client上设置)
[root@node1 yum.repos.d]# systemctl stop firewalld
[root@node1 yum.repos.d]# setenforce 0
[root@node1 ~]# vi /etc/hosts #node1上演示
192.168.111.10 node1
192.168.111.20 node2
192.168.111.30 node3
192.168.111.40 node4
4.3.2、解压缩并安装软件(node1、node2、node3、node4和client上安装)
[root@node1 ~]# unzip gfsrepo.zip #node上演示
[root@node1 ~]# cd /etc/yum.repos.d/ #设置源
[root@node1 yum.repos.d]# vi GLFS.repo
[GLFS]
name=glfs
baseurl=file:///root/gfsrepo
gpgcheck=0
enabled=1
[root@node1 yum.repo.d]# rm -rf local.repo
[root@node1 ~]# yum -y install glusterfs glusterfs-server gluster-fuse glusterfs-rdma
4.3.3、开启服务
[root@node1 yum.repos.d]# systemctl start glusterd.service
[root@node1 yum.repos.d]# systemctl enable glusterd.service
[root@node1 yum.repos.d]# systemctl status glusterd.service
4.3.4、时间同步(node1、node2、node3、node4上安装)
[root@node1 ~]# ntpdate ntp1.aliyun.com #node上演示
16 Nov 22:40:31 ntpdate[2414]: step time server 120.25.115.20 offset 1.141361 sec
[root@node1 ~]# date
2020年 11月21日 星期六 22:40:35 CST
4.3.5、添加入存储信任池只要在一台主机上添加其他机器(node1上设置)
[root@node1 yum.repos.d]# gluster peer probe node2
peer probe: success.
[root@node1 yum.repos.d]# gluster peer probe node3
peer probe: success.
[root@node1 yum.repos.d]# gluster peer probe node4
peer probe: success.
4.3.6、查看节点状态
[root@node1 yum.repos.d]# gluster peer status
Number of Peers: 3
Hostname: node2
Uuid: 4f51d9b8-c635-498a-82ee-b46d841e4fa1
State: Peer in Cluster (Connected)
Hostname: node3
Uuid: b675a395-4dde-4b3d-8f8f-62c23b11abc7
State: Peer in Cluster (Connected)
Hostname: node4
Uuid: 3425cbbc-ce66-4c43-9934-3ed07d15f956
State: Peer in Cluster (Connected)
4.3.7、初始化磁盘(node1、node2、node3、node4)
[root@node1 yum.repos.d]# fdisk -l
[root@node1 yum.repos.d]# fdisk /dev/sdb
[root@node1 yum.repos.d]# fdisk /dev/sdb
[root@node1 yum.repos.d]# fdisk /dev/sdb
[root@node1 yum.repos.d]# fdisk /dev/sdb
[root@node1 yum.repos.d]# fdisk -l
[root@node1 yum.repos.d]# mkfs.ext4 /dev/sdb1
[root@node1 yum.repos.d]# mkfs.ext4 /dev/sdc1
[root@node1 yum.repos.d]# mkfs.ext4 /dev/sdd1
[root@node1 yum.repos.d]# mkfs.ext4 /dev/sde1
4.3.8、创建卷类型(node1、node2、node3、node4)
挂载磁盘
[root@node1 yum.repos.d]# mkdir -p /data/{sdb1,sdc1,sdd1,sde1}
[root@node1 yum.repos.d]# mount /dev/sdb1 /data/sdb1
[root@node1 yum.repos.d]# mount /dev/sdc1 /data/sdc1
[root@node1 yum.repos.d]# mount /dev/sdd1 /data/sdd1
[root@node1 yum.repos.d]# mount /dev/sde1 /data/sde1
[root@node1 yum.repos.d]# df -Th
文件系统 类型 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root xfs 37G 4.5G 33G 13% /
devtmpfs devtmpfs 897M 0 897M 0% /dev
tmpfs tmpfs 912M 0 912M 0% /dev/shm
tmpfs tmpfs 912M 9.1M 903M 1% /run
tmpfs tmpfs 912M 0 912M 0% /sys/fs/cgroup
/dev/sr0 iso9660 4.3G 4.3G 0 100% /mnt
/dev/sda1 xfs 1014M 179M 836M 18% /boot
tmpfs tmpfs 183M 12K 183M 1% /run/user/42
tmpfs tmpfs 183M 0 183M 0% /run/user/0
/dev/sdb1 ext4 4.8G 20M 4.6G 1% /data/sdb1
/dev/sdc1 ext4 4.8G 20M 4.6G 1% /data/sdc1
/dev/sdd1 ext4 4.8G 20M 4.6G 1% /data/sdd1
/dev/sde1 ext4 4.8G 20M 4.6G 1% /date/sde1
①分布式卷
[root@node1 yum.repos.d]# gluster volume create dis-vol node1:/data/sdb1 node2:/data/sdb1 force #创建
volume create: dis-vol: success: please start the volume to access data
[root@node1 yum.repos.d]# gluster volume info dis-vol #查看状态信息
Volume Name: dis-vol
Type: Distribute
Volume ID: 88e88b9f-b3bc-4946-ac11-c7a90ec17acf
Status: Created
Snapshot Count: 0
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: node1:/data/sdb1
Brick2: node2:/data/sdb1
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
[root@node1 yum.repos.d]# gluster volume start dis-vol #开启
volume start: dis-vol: success
[root@node1 yum.repos.d]# gluster volume status dis-vol #查看状态
Status of volume: dis-vol
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick node1:/data/sdb1 49152 0 Y 2924
Brick node2:/data/sdb1 49152 0 Y 2915
Task Status of Volume dis-vol
------------------------------------------------------------------------------
There are no active volume tasks
②条带卷
[root@node1 yum.repos.d]# gluster volume create stripe-vol stripe 2 node3:/data/sdb1 node4:/data/sdb1 force
volume create: stripe-vol: success: please start the volume to access data
[root@node1 yum.repos.d]# gluster volume info stripe-vol
Volume Name: stripe-vol
Type: Stripe
Volume ID: a6f10da6-c933-469a-9c84-49f55c3ede0e
Status: Created
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: node3:/data/sdb1
Brick2: node4:/data/sdb1
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
[root@node1 yum.repos.d]# gluster volume start stripe-vol
volume start: stripe-vol: success
[root@node1 yum.repos.d]# gluster volume status stripe-vol
Status of volume: stripe-vol
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick node3:/data/sdb1 49152 0 Y 13678
Brick node4:/data/sdb1 49152 0 Y 13759
Task Status of Volume stripe-vol
------------------------------------------------------------------------------
There are no active volume tasks
③复制卷
[root@node1 yum.repos.d]# gluster volume create rep-vol replica 2 node1:/data/sdc1 node2:/data/sdc1 force
volume create: rep-vol: success: please start the volume to access data
[root@node1 yum.repos.d]# gluster volume info rep-vol
Volume Name: rep-vol
Type: Replicate
Volume ID: 80ffeed8-6031-40a8-a2c3-80701d36d791
Status: Created
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: node1:/data/sdc1
Brick2: node2:/data/sdc1
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
[root@node1 yum.repos.d]# gluster volume start rep-vol
volume start: rep-vol: success
[root@node1 yum.repos.d]# gluster volume status rep-vol
Status of volume: rep-vol
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick node1:/data/sdc1 49153 0 Y 3110
Brick node2:/data/sdc1 49153 0 Y 3065
Self-heal Daemon on localhost N/A N/A Y 3130
Self-heal Daemon on node2 N/A N/A Y 3085
Self-heal Daemon on node3 N/A N/A Y 13749
Self-heal Daemon on node4 N/A N/A Y 13837
Task Status of Volume rep-vol
------------------------------------------------------------------------------
There are no active volume tasks
④分布式条带卷
[root@node1 yum.repos.d]# gluster volume create dis-stripe stripe 2 node1:/data/sdd1 node2:/data/sdd1 node3:/data/sdd1 node4:/data/sdd1 force
volume create: dis-stripe: success: please start the volume to access data
[root@node1 yum.repos.d]# gluster volume info dis-stripe
Volume Name: dis-stripe
Type: Distributed-Stripe
Volume ID: 58895adb-c659-432c-a41a-5dbb741cc718
Status: Created
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: node1:/data/sdd1
Brick2: node2:/data/sdd1
Brick3: node3:/data/sdd1
Brick4: node4:/data/sdd1
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
[root@node1 yum.repos.d]# gluster volume start dis-stripe
volume start: dis-stripe: success
[root@node1 yum.repos.d]# gluster volume status dis-stripe
Status of volume: dis-stripe
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick node1:/data/sdd1 49154 0 Y 3213
Brick node2:/data/sdd1 49154 0 Y 3144
Brick node3:/data/sdd1 49153 0 Y 13807
Brick node4:/data/sdd1 49153 0 Y 13889
Task Status of Volume dis-stripe
------------------------------------------------------------------------------
There are no active volume tasks
⑤分布式复制卷
[root@node1 yum.repos.d]# gluster volume create dis-rep replica 2 node1:/data/sde1 node2:/data/sde1 node3:/data/sde1 node4:/data/sde1 force
volume create: dis-rep: success: please start the volume to access data
[root@node1 yum.repos.d]# gluster volume info dis-rep
Volume Name: dis-rep
Type: Distributed-Replicate
Volume ID: 57dc83f8-a6ae-4af4-9d4c-75a0da661fff
Status: Created
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: node1:/data/sde1
Brick2: node2:/data/sde1
Brick3: node3:/data/sde1
Brick4: node4:/data/sde1
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
[root@node1 yum.repos.d]# gluster volume start dis-rep
volume start: dis-rep: success
[root@node1 yum.repos.d]# gluster volume status dis-rep
Status of volume: dis-rep
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick node1:/data/sde1 49155 0 Y 3283
Brick node2:/data/sde1 49155 0 Y 3195
Brick node3:/data/sde1 49154 0 Y 13867
Brick node4:/data/sde1 49154 0 Y 13947
Self-heal Daemon on localhost N/A N/A Y 3303
Self-heal Daemon on node3 N/A N/A Y 13887
Self-heal Daemon on node4 N/A N/A Y 13967
Self-heal Daemon on node2 N/A N/A Y 3215
Task Status of Volume dis-rep
------------------------------------------------------------------------------
There are no active volume tasks
⑥查看卷列表
[root@node1 yum.repos.d]# gluster volume list
dis-rep
dis-stripe
dis-vol
rep-vol
stripe-vol
4.3.9、挂载卷(客户机)
[root@client ~]# mkdir -p /text/{dis,stripe,rep,dis-stripe,dis-rep} #创建挂载目录
[root@client ~]# mount.glusterfs node1:dis-vol /text/dis #挂载分布卷
[root@client ~]# mount.glusterfs node1:stripe-vol /text/stripe #挂载条带卷
[root@client ~]# mount.glusterfs node1:rep-vol /text/rep #挂载复制卷
[root@client ~]# mount.glusterfs node1:dis-stripe /text/dis-stripe #挂载分布式条带卷
[root@client ~]# mount.glusterfs node1:dis-rep /text/dis-rep #挂载分布式复制卷
[root@client ~]# df -Th #查看磁盘占用情况
文件系统 类型 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root xfs 17G 1.5G 16G 9% /
devtmpfs devtmpfs 901M 0 901M 0% /dev
tmpfs tmpfs 912M 0 912M 0% /dev/shm
tmpfs tmpfs 912M 8.7M 904M 1% /run
tmpfs tmpfs 912M 0 912M 0% /sys/fs/cgroup
/dev/sr0 iso9660 4.3G 4.3G 0 100% /mnt
/dev/sda1 xfs 1014M 143M 872M 15% /boot
tmpfs tmpfs 183M 0 183M 0% /run/user/0
node1:dis-vol fuse.glusterfs 9.6G 41M 9.1G 1% /text/dis
node1:stripe-vol fuse.glusterfs 9.6G 41M 9.1G 1% /text/stripe
node1:rep-vol fuse.glusterfs 4.8G 21M 4.6G 1% /text/rep
node1:dis-stripe fuse.glusterfs 20G 81M 19G 1% /text/dis-stripe
node1:dis-rep fuse.glusterfs 9.6G 41M 9.1G 1% /text/dis-rep
4.4、测试
4.4.1、创建文件
创建测试文件
[root@client ~]# dd if=/dev/zero of=/demo1.log bs=40M count=1
记录了1+0 的读入
记录了1+0 的写出
41943040字节(42 MB)已复制,0.185274 秒,226 MB/秒
[root@client ~]# dd if=/dev/zero of=/demo2.log bs=40M count=1
记录了1+0 的读入
记录了1+0 的写出
41943040字节(42 MB)已复制,0.1539 秒,273 MB/秒
[root@client ~]# dd if=/dev/zero of=/demo3.log bs=40M count=1
记录了1+0 的读入
记录了1+0 的写出
41943040字节(42 MB)已复制,0.141536 秒,296 MB/秒
[root@client ~]# dd if=/dev/zero of=/demo4.log bs=40M count=1
记录了1+0 的读入
记录了1+0 的写出
41943040字节(42 MB)已复制,0.149856 秒,280 MB/秒
[root@client ~]# dd if=/dev/zero of=/demo5.log bs=40M count=1
记录了1+0 的读入
记录了1+0 的写出
41943040字节(42 MB)已复制,0.139292 秒,301 MB/秒
查看文件
[root@client ~]# cd /
[root@client /]# ll
拷贝文件到挂载目录下
[root@client /]# cp demo* /text/dis
[root@client /]# cp demo* /text/stripe
[root@client /]# cp demo* /text/rep
[root@client /]# cp demo* /text/dis-stripe
[root@client /]# cp demo* /text/dis-rep
查看文件
[root@client /]# ll /text/dis
[root@client /]# ll /text/stripe
[root@client /]# ll /text/rep
[root@client /]# ll /text/dis-stripe
[root@client /]# ll /text/dis-rep
4.4.2、查看分布式卷分布情况(node1:/data/sdb1,node2:/data/sdb1)
[root@node1 yum.repos.d]# ls -lh /data/sdb1
总用量 161M
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo1.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo2.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo3.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo4.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node2 yum.repos.d]# ls -lh /data/sdb1
总用量 41M
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
4.4.3、查看条带卷分布情况(node3:/data/sdb1,node4:/data/sdb1)
[root@node3 yum.repos.d]# ls -lh /data/sdb1
总用量 101M
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo1.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo2.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo3.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo4.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node4 yum.repos.d]# ls -lh /data/sdb1
总用量 101M
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo1.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo2.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo3.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo4.log
-rw-r--r--. 2 root root 20M 11月 21 10:14 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
4.4.4、查看复制卷分布情况(node1:/data/sdc1,node2:/data/sdc1)
[root@node1 yum.repos.d]# ls -lh /data/sdc1
总用量 201M
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo1.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo2.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo3.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo4.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node2 yum.repos.d]# ls -lh /data/sdc1
总用量 201M
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo1.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo2.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo3.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo4.log
-rw-r--r--. 2 root root 40M 11月 21 10:14 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
4.4.5、查看分布式条带卷分布情况(node1:/data/sdd1 node2:/data/sdd1 node3:/data/sdd1 node4:/data/sdd1)
[root@node1 yum.repos.d]# ls -lh /data/sdd1
总用量 81M
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo1.log
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo2.log
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo3.log
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo4.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node2 yum.repos.d]# ls -lh /data/sdd1
总用量 81M
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo1.log
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo2.log
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo3.log
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo4.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node3 yum.repos.d]# ls -lh /data/sdd1
总用量 21M
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node4 yum.repos.d]# ls -lh /data/sdd1
总用量 21M
-rw-r--r--. 2 root root 20M 11月 21 10:15 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
4.4.6、查看分布式复制卷分布情况(node1:/data/sde1 node2:/data/sde1 node3:/data/sde1 node4:/data/sde1)
[root@node1 yum.repos.d]# ls -lh /data/sde1
总用量 161M
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo1.log
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo2.log
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo3.log
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo4.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node2 yum.repos.d]# ls -lh /data/sde1
总用量 161M
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo1.log
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo2.log
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo3.log
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo4.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node3 yum.repos.d]# ls -lh /data/sde1
总用量 41M
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
[root@node4 yum.repos.d]# ls -lh /data/sde1
总用量 41M
-rw-r--r--. 2 root root 40M 11月 21 10:15 demo5.log
drwx------. 2 root root 16K 11月 21 09:14 lost+found
4.4.7、访问控制
仅拒绝:
[root@node1 yum.repos.d]# gluster volume set dis-vol auth.reject 192.168.111.50
volume set: success
仅允许
[root@node1 yum.repos.d]# gluster volume set dis-vol auth.allow 192.168.111.50
volume set: success