一、gluster Basic establishment
Brick:
A filesystem mountpoint
A *unit of storage used as a Glusterfs building block
Translator:
Logic between the bits and the Global Namespace
Layered to provide Glusterfs functionality
Volume:
bricks combined and passed though translators
Node/Peer
server running the gluster daemon and sharing volumes

二、Types of Volumes
(1)分布式卷:Distributed Glusterfs Volume
gluster volume_第1张图片
file只能存储在brick1或brick2中,但不能同时存储在两者中(一个文件来了是存在brick1还是brick2当中?用户不用操心,使用的是gluster的弹性hash计算出来的),不支持数据冗余,brick故障将导致数据完全丢失,只能依靠底层来保护数据(比如raid)

# gluster volume create NEW-VOLNAME [transport [tcp | rdma | tcp,rdma]] NEW-BRICK...
#gluster volume create test-volume server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4
Creation of test-volume has been successful
Please start the volume to access data

显示磁盘信息

#gluster volume info
Volume Name: test-volume
Type: Distribute
Status: Created
Number of Bricks: 4
Transport-type: tcp
Bricks:
Brick1: server1:/exp1
Brick2: server2:/exp2
Brick3: server3:/exp3
Brick4: server4:/exp4

(2)复制卷:Replicated Glusterfs Volume
gluster volume_第2张图片
数据存放多份,这个很好理解,就不说了,emmmmm.....

# gluster volume create NEW-VOLNAME [replica COUNT] [transport [tcp | rdma | tcp,rdma]] NEW-BRICK...
#gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2
Creation of test-volume has been successful
Please start the volume to access data

(3)分布式复制卷:Distributed Replicated Glusterfs Volume
gluster volume_第3张图片
结合Distributed 和 Replicated,比如设置 Distributed 2 Replicated 2,那么你存文件的时候就会存在Distributed 1的brick和Distributed 2的brick当中,但是存在那个上面是使用的gluster的弹性哈希,然后 Replicated 2 就是在复制一份,这两份Replicatied就是两个Distributed 进行复制

# gluster volume create NEW-VOLNAME [replica COUNT] [transport [tcp | rdma | tcp,rdma]] NEW-BRICK...

gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4
Creation of test-volume has been successful
Please start the volume to access data

(4)条带卷:Striped Glusterfs Volume
gluster volume_第4张图片
许多客户端经常同时访问该块,这将导致单块brick的负载过大,从而降低性能。在条带化模式中,数据将分成不同的条带后存储在brick当中。因此,大文件将被分成较小的块(等于卷中的块数)存放起来,每个块存储在一个brick当中。,但不提供数据冗余。

# gluster volume create NEW-VOLNAME [stripe COUNT] [transport [tcp | dma | tcp,rdma]] NEW-BRICK...
#gluster volume create test-volume stripe 2 transport tcp server1:/exp1 server2:/exp2
Creation of test-volume has been successful
Please start the volume to access data

(5)分布式条带卷:Distributed Striped Glusterfs Volume
gluster volume_第5张图片
一个文件存如到Distributed卷中,而每个Distributed又有多个 Striped卷,也就是一个文件存进来是存在Striped当中(分成多块存入,有几个Striped就分几块),而存放在哪个Distributed是根据弹性hash

#gluster volume create NEW-VOLNAME [stripe COUNT] [transport [tcp | rdma | tcp,rdma]] NEW-BRICK...
#gluster volume create test-volume stripe 4 transport tcp
 server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 server7:/exp7 server8:/exp8
Creation of test-volume has been successful
Please start the volume to access data.