日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

CentOS8.3部署GlusterFS

發(fā)布時(shí)間:2023/12/20 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS8.3部署GlusterFS 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.配置ip主機(jī)名對(duì)應(yīng)關(guān)系

cat /etc/hosts 127.0.0.1 ? localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 ? ? ? ? localhost localhost.localdomain localhost6 localhost6.localdomain6 ${server01_ip}?? ?glusterfs01 ${server02_ip}?? ?glusterfs02 ${server03_ip}?? ?glusterfs03

2.配置yum源

cat /etc/yum.repos.d/CentOS-Linux-Gluster-8.repo? [centos-glusterfs8] name=CentOS-$releasever - Glusterfs 8 mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=$releasever&repo=storage-gluster-8 #baseurl=https://mirror.centos.org/$contentdir/$releasever/storage/$basearch/gluster-8/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage[centos-glusterfs8-test] name=CentOS-$releasever - Glusterfs 8 Testing baseurl=https://buildlogs.centos.org/centos/$releasever/storage/$basearch/gluster-8/ gpgcheck=0 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage

3.安裝centos-release-storage-common保證gpgcheck可用

dnf install centos-release-storage-common -y

4.安裝glusterfs-server

dnf install glusterfs-server -y

5.格式化并掛載磁盤

mkfs.xfs -i size=512 /dev/sdb1 mkdir -p /data/brick1 echo '/dev/sdb1 /data/brick1 xfs defaults 1 2' >> /etc/fstab mount -a && mount

6.啟動(dòng)glusterd并設(shè)置開機(jī)自啟動(dòng)

systemctl start glusterd systemctl enable glusterd

7.配置信任關(guān)系池
在glusterfs01執(zhí)行

gluster peer probe glusterfs02 gluster peer probe glusterfs03

上面命令執(zhí)行完成后,3個(gè)節(jié)點(diǎn)之間的信任關(guān)系全部配好

可以在第二個(gè)節(jié)點(diǎn)驗(yàn)證一下

gluster peer probe glusterfs01 peer probe: Host glusterfs01 port 24007 already in peer list

所有節(jié)點(diǎn)執(zhí)行下面命令進(jìn)行驗(yàn)證,每個(gè)節(jié)點(diǎn)都有兩個(gè)對(duì)方,則正常。

gluster peer status Number of Peers: 2Hostname: glusterfs01 Uuid: 3f25ece4-c288-4836-a54e-9a2be65ddece State: Peer in Cluster (Connected)Hostname: glusterfs02 Uuid: 88b03b30-d1bd-4f06-9c65-b7248c46d418 State: Peer in Cluster (Connected)

8.創(chuàng)建glusterFS卷
所有節(jié)點(diǎn)執(zhí)行下面命令

mkdir -p /data/brick1/gv0

只在其中一個(gè)節(jié)點(diǎn)執(zhí)行下面命令

gluster volume create gv0 replica 3 glusterfs01:/data/brick1/gv0 glusterfs02:/data/brick1/gv0 glusterfs03:/data/brick1/gv0 gluster volume start gv0

執(zhí)行下面命令,看到Status為Started則完成

gluster volume info

9.測(cè)試glusterfs卷
在一臺(tái)節(jié)點(diǎn)執(zhí)行下面命令

mount -t glusterfs glusterfs01:/gv0 /mnt for i in `seq -w 1 100`; do cp -rp /var/log/messages /mnt/copy-test-$i; done ls -lA /mnt/copy* | wc -l 100

在所有節(jié)點(diǎn)執(zhí)行下面命令,可以看到100個(gè)文件證明集群可用

ls -lA /data/brick1/gv0/copy*

10.配置gluster客戶端
另開一臺(tái)機(jī)器作為客戶端,先做完1,2,3 步,配置好hosts和yum源

安裝客戶端需要用到的包

dnf -y install openssh-server wget fuse fuse-libs libibverbs

安裝客戶端

dnf -y install glusterfs glusterfs-fuse glusterfs-rdma

配置fuse內(nèi)核模塊

modprobe fusedmesg | grep -i fuse #看到下面結(jié)果則加載成功 [78154.906846] fuse: init (API version 7.31)

進(jìn)行掛載

mount -t glusterfs glusterfs01:/gv0 /mnt #即使使用ip也需要寫好hosts或者有dns解析 df -h #查看到掛載成功則完成

自動(dòng)掛載示例

vi /etc/fstab #加入下面行 glusterfs01:/gv0 /mnt glusterfs defaults,_netdev 0 0 mount -a ?#進(jìn)行測(cè)試

?

總結(jié)

以上是生活随笔為你收集整理的CentOS8.3部署GlusterFS的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。