Glusterfs

Oli ka aeg. Kes see ikka tänapäeval ühe serveriga storaget peab. Igaljuhul olen ma oma esimese glusterfs instantsi käivitamise üle nii uhke, et lausa panen siia. Mine tea ehk lisan endale ka hiljem väikese how-to

Download

Docs

storage1 masinas peab käima glasterfs-server

[root@storage1 ~]# /etc/init.d/glusterfsd status
glusterfsd (pid 23029 4386) is running...
[root@storage1 ~]#

loome esialgu kahest storagest koosneva volume (seda võib teha suvalises masinas kus glusterd käib kus on gluster CLI olemas)

[root@storage2 ~]# gluster volume create storage transport tcp 192.168.1.202:/mnt/storage 192.168.1.203:/mnt/storage
Creation of volume storage has been successful
[root@storage2 ~]# gluster volume info storage

Volume Name: storage
Type: Distribute
Status: Created
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: 192.168.1.202:/mnt/storage
Brick2: 192.168.1.203:/mnt/storage
[root@storage2 ~]#

Käivitame

[root@storage2 ~]# gluster volume start storage
Starting volume storage has been successful

Klient masinas mount-me glusterfs-i.

[root@client ~]# mount
/dev/xvda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/xvda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@client ~]# mount -t glusterfs 192.168.1.203:storage /mnt/glusterfs/
[root@client ~]# mount
/dev/xvda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/xvda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
glusterfs#192.168.1.203:storage on /mnt/glusterfs type fuse (rw,allow_other,default_permissions,max_read=131072)
[root@client ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 1.9G 1.3G 524M 71% /
/dev/xvda1 99M 13M 81M 14% /boot
tmpfs 250M 0 250M 0% /dev/shm
glusterfs#192.168.1.203:storage
942M 21M 873M 3% /mnt/glusterfs

lisame uue node

[root@storage2 ~]# gluster volume add-brick storage 192.168.1.201:/mnt/storage
Add Brick successful
[root@storage2 ~]# gluster volume info storage

Volume Name: storage
Type: Distribute
Status: Started
Number of Bricks: 3
Transport-type: tcp
Bricks:
Brick1: 192.168.1.202:/mnt/storage
Brick2: 192.168.1.203:/mnt/storage
Brick3: 192.168.1.201:/mnt/storage

Kliendi masinas peale mõninga aja möödumist

[root@client ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 1.9G 1.3G 524M 71% /
/dev/xvda1 99M 13M 81M 14% /boot
tmpfs 250M 0 250M 0% /dev/shm
glusterfs#192.168.1.203:storage
1.2G 25M 1.1G 3% /mnt/glusterfs

host1:

Vajalikud pakid repost:

[root@host3 ~]# yum install libibverbs-devel fuse-devel fuse

Leave a Reply