CentOS8.3部署GlusterFS
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}?? ?glusterfs032.配置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-Storage3.安裝centos-release-storage-common保證gpgcheck可用
dnf install centos-release-storage-common -y4.安裝glusterfs-server
dnf install glusterfs-server -y5.格式化并掛載磁盤
mkfs.xfs -i size=512 /dev/sdb1 mkdir -p /data/brick1 echo '/dev/sdb1 /data/brick1 xfs defaults 1 2' >> /etc/fstab mount -a && mount6.啟動(dòng)glusterd并設(shè)置開機(jī)自啟動(dòng)
systemctl start glusterd systemctl enable glusterd7.配置信任關(guān)系池
在glusterfs01執(zhí)行
上面命令執(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í)行下面命令
只在其中一個(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 info9.測(cè)試glusterfs卷
在一臺(tái)節(jié)點(diǎn)執(zhí)行下面命令
在所有節(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)題。
- 上一篇: js上传图片时添加水印
- 下一篇: 取表单radio值时