GlusterFs主要由存儲服務器,客戶端及NFS/samba存儲網(wǎng)關組成,
GlusterFs特點:擴展性和高性能,高可用性,全局統(tǒng)一命名空間,彈性卷管理,基于標準協(xié)議
GlusterFs術語:Brick(存儲塊),Vlume(邏輯卷),F(xiàn)USE(內(nèi)核模塊),VFS,Glusterd(后臺管理進程)
GlusterFs的工作原理:

彈性HASH算法的優(yōu)點:1)保證數(shù)據(jù)平均分布在每個Brick中。
(2)解決了對元數(shù)據(jù)服務器的依賴,進而解決了單點故障及訪問瓶頸。
GlusterFS七種卷:分布式卷,條帶卷,復制卷,分布式條帶卷,分布式復制卷,條帶復制卷,分布式條帶復制卷
GlusterFS七種卷中,具備冗余性的:復制卷,分布式復制卷,條帶復制卷,分布式條帶復制卷。
實驗步驟如下:四臺服務器,一臺客戶機

四臺服務器的信息如下:

在所有節(jié)點上執(zhí)行以下操作
開啟4臺虛擬機,根據(jù)上述表添加磁盤,通過fdisk分區(qū),mkfs格式化,創(chuàng)建相應的掛載目錄,并將格式化的磁盤掛載到相應的目錄中,最后修改/etc/fstab配置文件,使其永久生效。
附上命令,以node1為例
(1)創(chuàng)建掛載目錄:mkidr -p /b3 /c4 /d5 /e6
(2)分區(qū)所有硬盤以sdb為例:fdisk /dev/sdb
(3)格式化:#mkfs.ext4 /dev/sdb1
(4)掛載:#mount /dev/sdb1 /b3
(5)永久掛載
#vim /etc/fstab
/dev/sdb1 /b3 ext4 defaults 0 0
/dev/sdc1 /c4 ext4 defaults 0 0
/dev/sdd1 /d5 ext4 defaults 0 0
/dev/sde1 /e6 ext4 defaults 0 0
二,
1.關閉所有防火墻和SElinux
#systemctl stop firewalld
#systemctl disable firewalld
#setenforce 0
2.配置hosts文件(所有主機上都要配置)
vim /etc/hosts
192.168.1.1 node1
192.168.1.2 node2
192.168.1.3 node3
192.168.1.4 node4
3.安裝軟件,在所有的服務器上都要安裝(GlusterFS)
#yum -y install glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma
4.啟動glusterfs(在所有節(jié)點上)
#systemctl start glusterd
#systemctl enable glusterd
5.添加節(jié)點(在node1上執(zhí)行),添加node1—node4節(jié)點
[root@node1 ~]# gluster peer probe node1
peer probe: success. Probe on localhost not needed
[root@node1 ~]# gluster peer probe node2
peer probe: success.
[root@node1 ~]# gluster peer probe node3
peer probe: success.
[root@node1 ~]# gluster peer probe node4
peer probe: success.
6.創(chuàng)建卷(在node1上創(chuàng)建卷)(加粗的為命令)
(1)創(chuàng)建分布式卷:
[root@node1 ~]# gluster volume create dis-volume node1:/e6 node2:/e6 force
volume create: dis-volume: success: please start the volume to access data
啟動卷:
[root@node1 ~]# gluster volume start dis-volume
volume start: dis-volume: success
沒有指定類型默認創(chuàng)建的是分布式卷
(2)創(chuàng)建條帶卷
[root@node1 ~]# gluster volume create stripe-volume stripe 2 node1:/d5 node2:/d5 force
volume create: stripe-volume: success: please start the volume to access data
啟動卷:
[root@node1 ~]# gluster volume start stripe-volume
volume start: stripe-volume: success
(3)創(chuàng)建復制卷
[root@node1 ~]# gluster volume create rep-volume replica 2 node3:/d5 node4:/d5 force
volume create: rep-volume: success: please start the volume to access data
啟動卷:
[root@node1 ~]# gluster volume start rep-volume
volume start: rep-volume: success
(4)創(chuàng)建分布式條帶卷
[root@node1 ~]# gluster volume create dis-stripe stripe 2 node1:/b3 node2:/b3 node3:/b3 node4:/b3 force
volume create: dis-stripe: success: please start the volume to access data
啟動:
[root@node1 ~]# gluster volume start dis-stripe
volume start: dis-stripe: success
(5)創(chuàng)建分布式復制卷
[root@node1 ~]# gluster volume create dis-rep replica 2 node1:/c4 node2:/c4 node3:/c4 node4:/c4 force
volume create: dis-rep: success: please start the volume to access data
啟動卷:
[root@node1 ~]# gluster volume start dis-rep
volume start: dis-rep: success
三,客戶端配置如下:
1.安裝客戶端軟件
[root@node5 yum.repos.d]# yum -y install glusterfs glusterfs-fuse
2創(chuàng)建掛載目錄
[root@node5 ~]# mkdir -p /test /{dis,stripe,rep,dis_and_stripe,dis_and_rep}
3.修改hosts文件
[root@node5 ~]# vim /etc/hosts
192.168.1.1 node1
192.168.1.2 node2
192.168.1.3 node3
192.168.1.6 node6
192.168.1.4 node4
192.168.1.5 node5
4.掛載gluster文件系統(tǒng)
[root@node5 test]# mount -t glusterfs node1:dis-volume /test/dis
[root@node5 test]# mount -t glusterfs node1:stripe-volume /test/stripe
[root@node5 test]# mount -t glusterfs node1:rep-volume /test/rep
[root@node5 test]# mount -t glusterfs node1:dis-volume /test/dis_and_stripe
[root@node5 test]# mount -t glusterfs node1:dis-rep /test/dis_and_rep
四、測試gluster文件系統(tǒng)
1.卷中寫入文件(前5條生成一個43M的文件,后5條石復制文件到卷中)
[root@node5 ~]# dd if=/dev/zero of=demo1.log bs=43M count=1
[root@node5 ~]# dd if=/dev/zero of=demo2.log bs=43M count=1
[root@node5 ~]# dd if=/dev/zero of=demo3.log bs=43M count=1
[root@node5 ~]# dd if=/dev/zero of=demo4.log bs=43M count=1
[root@node5 ~]# dd if=/dev/zero of=demo5.log bs=43M count=1
[root@node5 ~]#cp demo /test/dis
[root@node5 ~]#cp demo
/test/stripe
[root@node5 ~]#cp demo /test/rep
[root@node5 ~]#cp demo
/test/dis_and_stripe
[root@node5 ~]#*cp demo /test/dis_and_rep
.查看文件分布
(1)查看分布式卷文件分布
[root@node1 ~]# ll -h /e6
總用量 130M
-rw-r–r– 2 root root 43M 10月 25 19:35 demo1.log
-rw-r–r– 2 root root 43M 10月 25 19:35 demo2.log
-rw-r–r– 2 root root 43M 10月 25 19:35 demo3.log
drwx—— 2 root root 16K 9月 23 09:07 lost found
[root@node2 ~]# ll -h /e6
總用量 86M
-rw-r–r– 2 root root 43M 10月 25 19:35 demo4.log
-rw-r–r– 2 root root 43M 10月 25 19:36 demo5.log
[root@node2 ~]#
(2)查看條帶卷文件分布
[root@node1 ~]# ll -h /d5
總用量 108M
-rw-r–r– 2 root root 22M 10月 25 19:34 demo1.log
-rw-r–r– 2 root root 22M 10月 25 19:34 demo2.log
-rw-r–r– 2 root root 22M 10月 25 19:34 demo3.log
-rw-r–r– 2 root root 22M 10月 25 19:34 demo4.log
-rw-r–r– 2 root root 22M 10月 25 19:36 demo5.log
drwx—— 2 root root 16K 9月 23 09:06 lost found
[root@node2 ~]# ll -h /d5
總用量 108M
-rw-r–r– 2 root root 22M 10月 25 19:34 demo1.log
-rw-r–r– 2 root root 22M 10月 25 19:34 demo2.log
-rw-r–r– 2 root root 22M 10月 25 19:34 demo3.log
-rw-r–r– 2 root root 22M 10月 25 19:34 demo4.log
-rw-r–r– 2 root root 22M 10月 25 19:36 demo5.log
drwx—— 2 root root 16K 9月 23 09:14 lost found
(3)查看復制卷文件分布
[root@node3 ~]# ll -h /d5
總用量 216M
-rw-r–r– 2 root root 43M 10月 25 19:34 demo1.log
-rw-r–r– 2 root root 43M 10月 25 19:34 demo2.log
-rw-r–r– 2 root root 43M 10月 25 19:34 demo3.log
-rw-r–r– 2 root root 43M 10月 25 19:34 demo4.log
-rw-r–r– 2 root root 43M 10月 25 19:36 demo5.log
drwx—— 2 root root 16K 9月 23 09:59 lost found
[root@node4 ~]# ll -h /d5**
總用量 216M
-rw-r–r– 2 root root 43M 10月 25 19:34 demo1.log
-rw-r–r– 2 root root 43M 10月 25 19:34 demo2.log
-rw-r–r– 2 root root 43M 10月 25 19:34 demo3.log
-rw-r–r– 2 root root 43M 10月 25 19:34 demo4.log
-rw-r–r– 2 root root 43M 10月 25 19:36 demo5.log
drwx—— 2 root root 16K 9月 23 10:08 lost found

實驗到此結束

其它的維護命令
(1)查看glusterfs卷
[root@node1 ~]# gluster volume list
dis-rep
dis-stripe
dis-volume
rep-volume
stripe-volume
(2)查看所有卷的狀態(tài)
[root@node1 ~]# gluster volume status
(3)查看所有卷的信息
[root@node1 ~]# gluster volume info

(4)設置卷的訪問控制
[root@node1 ~]# gluster volume set dis-rep auth.allow 192.168.1.*
volume set: success

更多關于云服務器域名注冊,虛擬主機的問題,請訪問三五互聯(lián)官網(wǎng):m.shinetop.cn

贊(0)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享網(wǎng)絡內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。郵箱:3140448839@qq.com。本站原創(chuàng)內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明出處:三五互聯(lián)知識庫 » GlusterFs分布式文件系統(tǒng)群集

登錄

找回密碼

注冊

主站蜘蛛池模板: 国产精品亚洲综合久久小说| 老色鬼在线精品视频| 亚洲男人天堂av在线| 亚洲欧美日韩综合久久久| 91老熟女老人国产老太| 高清中文字幕国产精品| 色婷婷综合久久久久中文一区二区| 丰满人妻熟妇乱精品视频| 成人午夜av在线播放| 苗栗县| 九九热在线精品视频99| 国产亚洲精品一区二区无| 欧美三级中文字幕在线观看| 国产91午夜福利精品| 国产自产对白一区| 五月婷之久久综合丝袜美腿| 国产普通话对白刺激| 又大又硬又爽免费视频| 潮喷失禁大喷水无码| 阜康市| 亚洲中文无码永久免费| 欧美亚洲高清日韩成人| 玩弄丰满少妇人妻视频| 亚洲国产综合精品2020| 亚洲日本va午夜在线影院| 欧美人与动牲交A免费观看| 中文字幕网红自拍偷拍视频| 18禁无遮挡啪啪无码网站| 国产成AV人片久青草影院| 国产乱码日韩精品一区二区| 国产一级小视频| 国产亚洲精品97在线视频一| 色窝窝免费播放视频在线| 女高中生自慰污污网站| 国内精品无码一区二区三区| 亚洲三级香港三级久久| 欧美www在线观看| 国产永久免费高清在线观看| 国产成人综合久久亚洲精品| 国产成人剧情AV麻豆果冻| 国产亚洲久久久久久久|