基本概述

? GFS是一個可擴展的分布式文件系統,用于大型的、分布式的、對大量數據進行訪問的應用。它運行于廉價的普通硬件上,并提供容錯功能。它可以給大量的用戶提供總體性能較高的服務。

基本部署步驟
一、實驗準備

名稱 角色 IP地址

centos7-1
node1
192.168.142.66

centos7-2
node2
192.168.142.77

centos7-3
node3
192.168.142.132

centos7-4
node4
192.168.142.136

centos7-min
client
192.168.142.172

二、開始安裝
(1)為滿足實驗目的增添硬盤

centos7-1

/dev/sdb1                 20G   33M   20G    1% /mnt/sdb1
/dev/sdc1                 20G   33M   20G    1% /mnt/sdc1
/dev/sdd1                 20G   33M   20G    1% /mnt/sdd1
/dev/sde1                 20G   33M   20G    1% /mnt/sde1

centos7-2

/dev/sdb1                 20G   33M   20G    1% /mnt/sdb1
/dev/sdc1                 20G   33M   20G    1% /mnt/sdc1
/dev/sdd1                 20G   33M   20G    1% /mnt/sdd1
/dev/sde1                 20G   33M   20G    1% /mnt/sde1

centos7-3

/dev/sdb1                 20G   33M   20G    1% /mnt/sdb1
/dev/sdc1                 20G   33M   20G    1% /mnt/sdc1
/dev/sdd1                 20G   33M   20G    1% /mnt/sdd1
/dev/sde1                 20G   33M   20G    1% /mnt/sde1

centos7-4

/dev/sdb1                 20G   33M   20G    1% /mnt/sdb1
/dev/sdc1                 20G   33M   20G    1% /mnt/sdc1
/dev/sdd1                 20G   33M   20G    1% /mnt/sdd1
/dev/sde1                 20G   33M   20G    1% /mnt/sde1

(2)安裝GFS(所有存儲節點均需要安裝)

修改本地hosts文件,方便識別

[root@node1 yum.repos.d]# vim /etc/hosts
192.168.142.66 node1
192.168.142.77 node2
192.168.142.132 node3
192.168.142.136 node4

配置本地YUM源

(原自帶YUM倉庫無法滿足需求)

[root@node1 mnt]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# mkdir bak
[root@node1 yum.repos.d]# mv CentOS-* bak/
[root@node3 zhy]# cp -r gfsrepo/ /mnt/
[root@node3 yum.repos.d]# vim GFSrep.repo
//手動添加
[GFSrep]
name=GFS
baseurl=file:///mnt/gfsrepo
gpgcheck=0
enabled=1

安裝gfs組件并開啟

[root@node1 yum.repos.d]# yum -y install glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma

//開啟服務
[root@node1 yum.repos.d]# systemctl start glusterd
[root@node1 yum.repos.d]# systemctl enable glusterd
[root@node1 yum.repos.d]# systemctl stop firewalld.service
[root@node1 yum.repos.d]# setenforce 0

與阿里時間服務器進行同步

[root@node1 yum.repos.d]# ntpdate ntp1.aliyun.com
18 Dec 19:55:56 ntpdate[2843]: adjust time server 120.25.115.20 offset 0.010820 sec

添加儲存信任池(只需要在任一存儲節點添加即可)

[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.
[root@node1 yum.repos.d]# gluster peer status          //查看各節點狀態

二、建立分布式卷

特點: (通過HASH算法進行分布)

沒有冗余性

單點故障,數據會丟失

[root@node1 yum.repos.d]# gluster volume create fenbu node1:/mnt/sdb1 node2:/mnt/sdb1 force
//使用node1的sdb1和node2的sdb1作為節點,部署分布式卷,“force”強制執行
volume create: fenbu: success: please start the volume to access data

 //查看分布式卷信息
[root@node1 yum.repos.d]# gluster volume info fenbu

Volume Name: fenbu
Type: Distribute
Volume ID: e7833052-a4c7-4c9f-9660-dc60db737543
。。。。。。
Bricks:
Brick1: node1:/mnt/sdb1
Brick2: node2:/mnt/sdb1

//查看卷組列表
[root@node1 yum.repos.d]# gluster volume list

//開啟分布式卷
[root@node1 yum.repos.d]# gluster volume start fenbu
volume start: fenbu: success

三、建立條帶卷

特點:

根據偏移量將文件分成N塊(N個條器節點),輪詢的存儲在每個Brick Server節點

存儲大文件時,性能尤為突出

不具備冗余性,類似Raid0

[root@node1 mnt]# gluster volume create tiaodai stripe 2 node1:/mnt/sdc1 node2:/mnt/sdc1 force
//“stripe”  分為兩個區

//開啟條帶卷
[root@node1 mnt]# gluster volume start tiaodai
volume start: tiaodai: success

//查看條帶卷信息
[root@node1 yum.repos.d]# gluster volume info fenbu
Volume Name: tiaodai
。。。。。。
Status: Started
。。。。。。
Bricks:
Brick1: node1:/mnt/sdc1
Brick2: node2:/mnt/sdc1
Options Reconfigured:

四、建立復制卷

特點:

同一份文件保存一份或者多分副本

讀寫速度較慢

具備冗余性

必須由兩個或更多數據庫組成

[root@node1 mnt]# gluster volume create fuzhi replica 2 node3:/mnt/sdb1 node4:/mnt/sdb1 force
//“replica”    建立副本數

[root@node1 mnt]# gluster volume start fuzhi
volume start: fuzhi: success

[root@node1 mnt]# gluster volume info fuzhi

Volume Name: fuzhi
。。。。。。
Status: Started
。。。。。。
Bricks:
Brick1: node3:/mnt/sdb1
Brick2: node4:/mnt/sdb1

五、建立分布式條帶卷

特點:

兼顧分布式卷和條帶卷的功能

用于大文件處理

至少需要四臺服務器

[root@node1 mnt]# gluster volume create fenbu-tiao stripe 2 node1:/mnt/sdd1 node2:/mnt/sdd1 node3:/mnt/sdd1 node4:/mnt/sdd1 force
//“stripe”   具備條帶卷功能,因此需要分片

[root@node1 mnt]# gluster volume start fenbu-tiao
volume start: fenbu-tiao: success

[root@node1 mnt]# gluster volume info fenbu-tiao

Volume Name: fenbu-tiao
。。。。。。
Status: Started
。。。。。。
Bricks:
Brick1: node1:/mnt/sdd1
Brick2: node2:/mnt/sdd1
Brick3: node3:/mnt/sdd1
Brick4: node4:/mnt/sdd1

六、建立分布式復制卷

特點:

兼顧分布式和復制卷的功能

具有冗余功能

[root@node1 mnt]# gluster volume create fenbu-copy replica 2 node1:/mnt/sde1 node2:/mnt/sde1 node3:/mnt/sde1 node4:/mnt/sde1 force

[root@node1 mnt]# gluster volume start fenbu-copy
volume start: fenbu-copy: success

[root@node1 mnt]# gluster volume info fenbu-copy

Volume Name: fenbu-copy
。。。。。。
Status: Started
。。。。。。
Bricks:
Brick1: node1:/mnt/sde1
Brick2: node2:/mnt/sde1
Brick3: node3:/mnt/sde1
Brick4: node4:/mnt/sde1

七、客戶端配置

修改本地Hosts文件

[root@node1 yum.repos.d]# vim /etc/hosts
192.168.142.66 node1
192.168.142.77 node2
192.168.142.132 node3
192.168.142.136 node4

配置本地YUM源

[root@node1 mnt]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# mkdir bak
[root@node1 yum.repos.d]# mv CentOS-* bak/
[root@node3 zhy]# cp -r gfsrepo/ /mnt/
[root@node3 yum.repos.d]# vim GFSrep.repo
//手動添加
[GFSrep]
name=GFS
baseurl=file:///mnt/gfsrepo
gpgcheck=0
enabled=1

安裝gfs組件

[root@node1 yum.repos.d]# yum -y install glusterfs glusterfs-fuse

GFS新建的卷進行掛載

[root@client yum.repos.d]# mkdir -p /data/fenbu              //新建分布式卷掛載點
[root@client yum.repos.d]# mkdir -p /data/tiaodai             //新建條帶卷掛載點
[root@client yum.repos.d]# mkdir -p /data/fuzhi               //新建復制卷掛載點
[root@client yum.repos.d]# mkdir -p /data/fenbu-tiao       //新建分布式條帶卷掛載點
[root@client yum.repos.d]# mkdir -p /data/fenbu-copy     //新建分布式復制卷

[root@client yum.repos.d]# mount.glusterfs node1:fenbu /data/fenbu/             //將分布卷進行掛載
[root@client yum.repos.d]# df -hT
文件系統                類型            容量  已用  可用 已用% %u6302載點
node1:fenbu             fuse.glusterfs   40G   65M   40G    1% /data/fenbu

[root@client yum.repos.d]# mount.glusterfs node1:tiaodai /data/tiaodai/         //掛載條帶卷
[root@client yum.repos.d]# df -hT
文件系統                類型            容量  已用  可用 已用% %u6302載點
node1:tiaodai           fuse.glusterfs   40G   65M   40G    1% /data/tiaodai

[root@client yum.repos.d]# mount.glusterfs node3:fuzhi /data/fuzhi             //掛載復制卷
[root@client yum.repos.d]# df -hT
文件系統                類型            容量  已用  可用 已用% %u6302載點
node3:fuzhi             fuse.glusterfs   20G   33M   20G    1% /data/fuzhi

[root@client yum.repos.d]# mount.glusterfs node1:fenbu-tiao /data/fenbu-tiao/         //掛載分布式條帶卷
[root@client yum.repos.d]# df -hT
文件系統                類型            容量  已用  可用 已用% %u6302載點
node1:fenbu-tiao        fuse.glusterfs   80G  130M   80G    1% /data/fenbu-tiao

[root@client yum.repos.d]# mount.glusterfs node4:fenbu-copy /data/fenbu-copy/       //掛載分布式復制卷
[root@client yum.repos.d]# df -hT
文件系統                類型            容量  已用  可用 已用% %u6302載點
node4:fenbu-copy        fuse.glusterfs   40G   65M   40G    1% /data/fenbu-copy

八、對各類卷進行測試

建立六個測試文件

[root@client data]# dd if=/dev/zero of=test1.log bs=10M count=10

[root@client data]# dd if=/dev/zero of=test2.log bs=10M count=10

[root@client data]# dd if=/dev/zero of=test3.log bs=10M count=10

[root@client data]# dd if=/dev/zero of=test4.log bs=10M count=10

[root@client data]# dd if=/dev/zero of=test5.log bs=10M count=10

[root@client data]# dd if=/dev/zero of=test6.log bs=10M count=10

將文件復制進各個卷中

[root@client data]# cp test* fenbu
[root@client data]# cp test* fenbu-copy/
[root@client data]# cp test* fenbu-tiao/
[root@client data]# cp test* fuzhi/
[root@client data]# cp test* tiaodai/

查看分布式卷(node1:sdb1、node2:sdb1)

//node1
[root@node1 mnt]# ll -h sdb1/
總用量 400M
-rw-r--r--. 2 root root 100M 12月 18 23:55 test1.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test2.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test4.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test6.log
//node2
[root@node2 mnt]# ll -h sdb1/
總用量 200M
-rw-r--r--. 2 root root 100M 12月 18 23:56 test3.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test5.log

查看條帶卷(node1:sdc1、node2:sdc1)

//將每個數據都分成兩塊存儲(分成幾份由建立時的stripe決定)
//node1
[root@node1 mnt]# ll -h sdc1/
總用量 300M
-rw-r--r--. 2 root root 50M 12月 18 23:57 test1.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test2.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test3.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test4.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test5.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test6.log
//node2
[root@node2 mnt]# ll -h sdc1/
總用量 300M
-rw-r--r--. 2 root root 50M 12月 18 23:57 test1.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test2.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test3.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test4.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test5.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test6.log

查看復制卷(node3:sdb1、node4:sdb1)

//所有數據均復制一份存儲
//node3
[root@node3 mnt]# ll -h sdb1/
總用量 600M
-rw-r--r--. 2 root root 100M 12月 18 23:57 test1.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test2.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test3.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test4.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test5.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test6.log
//node4
[root@node4 mnt]# ll -h sdb1/
總用量 600M
-rw-r--r--. 2 root root 100M 12月 18 23:57 test1.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test2.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test3.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test4.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test5.log
-rw-r--r--. 2 root root 100M 12月 18 23:57 test6.log

查看分布式條帶卷(node1:sdd1、node2:sdd1、node3:sdd1、node4:sdd1)

//node1 & node2
[root@node1 mnt]# ll -h sdd1/
總用量 200M
-rw-r--r--. 2 root root 50M 12月 18 23:57 test1.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test2.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test4.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test6.log
[root@node2 mnt]# ll -h sdd1/
總用量 200M
-rw-r--r--. 2 root root 50M 12月 18 23:57 test1.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test2.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test4.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test6.log

//node3 & node4
[root@node3 mnt]# ll -h sdd1/
總用量 100M
-rw-r--r--. 2 root root 50M 12月 18 23:57 test3.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test5.log
[root@node4 mnt]# ll -h sdd1/
總用量 100M
-rw-r--r--. 2 root root 50M 12月 18 23:57 test3.log
-rw-r--r--. 2 root root 50M 12月 18 23:57 test5.log

查看分布式復制卷(node1~4:sde1)

//node1 & node2
[root@node1 mnt]# ll -h sde1/
總用量 400M
-rw-r--r--. 2 root root 100M 12月 18 23:56 test1.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test2.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test4.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test6.log
[root@node2 mnt]# ll -h sde1/
總用量 400M
-rw-r--r--. 2 root root 100M 12月 18 23:56 test1.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test2.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test4.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test6.log

//node3 & node4
[root@node3 mnt]# ll -h sde1/
總用量 200M
-rw-r--r--. 2 root root 100M 12月 18 23:56 test3.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test5.log
[root@node4 mnt]# ll -h sde1/
總用量 200M
-rw-r--r--. 2 root root 100M 12月 18 23:56 test3.log
-rw-r--r--. 2 root root 100M 12月 18 23:56 test5.log

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

贊(0)
聲明:本網站發布的內容(圖片、視頻和文字)以原創、轉載和分享網絡內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。郵箱:3140448839@qq.com。本站原創內容未經允許不得轉載,或轉載時需注明出處:三五互聯知識庫 » GFS基礎配置安裝

登錄

找回密碼

注冊

主站蜘蛛池模板: 亚洲精品日本一区二区| 噜噜噜亚洲色成人网站∨| 中国美女a级毛片| 特黄 做受又硬又粗又大视频| 奇米四色7777中文字幕| 欧洲码亚洲码的区别入口| 日韩精品中文字幕无码一区 | 中文字幕在线视频不卡一区二区| 国产高清国产精品国产专区| 中文国产日韩欧美二视频| 一区天堂中文最新版在线| 蜜臀av无码一区二区三区| 久久久久免费看少妇高潮A片| 亚洲精品天堂一区二区| 国产精品不卡一区二区在线| 日韩中文字幕v亚洲中文字幕| 国产精品无码dvd在线观看| 亚洲产国偷v产偷v自拍色戒| 日本妇人成熟免费| 国内久久人妻风流av免费| 国产做a爱片久久毛片a片| 亚洲av色香蕉一二三区| 精品久久人人做爽综合| 中国亚州女人69内射少妇| 商城县| 狠狠色综合久久狠狠色综合| 美腿丝袜亚洲综合第一页| 成人做受视频试看60秒| 日本人妻巨大乳挤奶水免费| 性视频一区| 国产av一区二区不卡| 色哟哟www网站入口成人学校| 开阳县| 亚洲精品国产精品不乱码| 黄男女激情一区二区三区| 在线观看中文字幕国产码| 狠狠色噜噜狠狠狠狠色综合久| 丰满爆乳一区二区三区| 国产成人精品亚洲精品密奴| 99久久国产一区二区三区| 妖精视频yjsp毛片永久|