glustefs离线编译部署(version: 3.6.9)
Posted 抛物线.
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了glustefs离线编译部署(version: 3.6.9)相关的知识,希望对你有一定的参考价值。
glustefs离线编译部署(version: 3.6.9)
2021/06/17
1、环境准备(如下所有操作均需要在01,02节点上操作)
- 首先准备两台服务器,如gluster01,02节点,01节点至02节点免密,且配置hosts主机映射。
假设每台节点配置三块数据盘,如下所示:
#gluster01节点
[root@gluster01 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.90 glusterf01
192.168.10.48 glusterf02
[root@gluster01 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 478K 0 rom
vda 253:0 0 50G 0 disk
├─vda1 253:1 0 1G 0 part /boot
└─vda2 253:2 0 49G 0 part /
vdb 253:16 0 10G 0 disk
vdc 253:32 0 10G 0 disk
vdd 253:48 0 10G 0 disk
[root@gluster01 ~]#
#gluster02节点
[root@gluster02 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 478K 0 rom
vda 253:0 0 50G 0 disk
├─vda1 253:1 0 1G 0 part /boot
└─vda2 253:2 0 49G 0 part /
vdb 253:16 0 10G 0 disk
vdc 253:32 0 10G 0 disk
vdd 253:48 0 10G 0 disk
[root@gluster02 ~]#
2)准备好安装包(该服务涉及依赖较多)
#查看安装包和依赖包
[root@gluster01 gluster]# ll
total 6716
-rw-r--r-- 1 root root 6106554 Jun 17 09:57 glusterfs-3.6.9.tar.gz
-rw-r--r-- 1 root root 769095 Jun 17 09:57 userspace-rcu-master.zip
[root@gluster01 gluster]# pwd
/root/gluster
[root@gluster01 dep]# ls
acl-2.2.51-15.el7.x86_64.rpm libacl-devel-2.2.51-15.el7.x86_64.rpm libselinux-utils-2.5-15.el7.x86_64.rpm
attr-2.4.46-13.el7.x86_64.rpm libattr-2.4.46-13.el7.x86_64.rpm libsepol-devel-2.5-10.el7.x86_64.rpm
bison-3.0.4-2.el7.x86_64.rpm libattr-devel-2.4.46-13.el7.x86_64.rpm libss-1.42.9-19.el7.x86_64.rpm
cpp-4.8.5-44.el7.x86_64.rpm libcom_err-1.42.9-19.el7.x86_64.rpm libstdc++-4.8.5-44.el7.x86_64.rpm
e2fsprogs-1.42.9-19.el7.x86_64.rpm libcom_err-devel-1.42.9-19.el7.x86_64.rpm libstdc++-devel-4.8.5-44.el7.x86_64.rpm
e2fsprogs-libs-1.42.9-19.el7.x86_64.rpm libgcc-4.8.5-44.el7.x86_64.rpm libverto-devel-0.2.5-4.el7.x86_64.rpm
flex-2.5.37-6.el7.x86_64.rpm libgfortran-4.8.5-44.el7.x86_64.rpm libxml2-2.9.1-6.el7.5.x86_64.rpm
gcc-4.8.5-44.el7.x86_64.rpm libgnat-4.8.5-44.el7.x86_64.rpm libxml2-devel-2.9.1-6.el7.5.x86_64.rpm
gcc-c++-4.8.5-44.el7.x86_64.rpm libgnat-devel-4.8.5-44.el7.x86_64.rpm openssl-1.0.2k-21.el7_9.x86_64.rpm
gcc-gfortran-4.8.5-44.el7.x86_64.rpm libgomp-4.8.5-44.el7.x86_64.rpm openssl-devel-1.0.2k-21.el7_9.x86_64.rpm
gcc-gnat-4.8.5-44.el7.x86_64.rpm libkadm5-1.15.1-50.el7.x86_64.rpm openssl-libs-1.0.2k-21.el7_9.x86_64.rpm
gcc-objc-4.8.5-44.el7.x86_64.rpm libobjc-4.8.5-44.el7.x86_64.rpm pcre-devel-8.32-17.el7.x86_64.rpm
gcc-objc++-4.8.5-44.el7.x86_64.rpm libquadmath-4.8.5-44.el7.x86_64.rpm sqlite-3.7.17-8.el7_7.1.x86_64.rpm
keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm libquadmath-devel-4.8.5-44.el7.x86_64.rpm sqlite-devel-3.7.17-8.el7_7.1.x86_64.rpm
krb5-devel-1.15.1-50.el7.x86_64.rpm libselinux-2.5-15.el7.x86_64.rpm xz-devel-5.2.2-1.el7.x86_64.rpm
krb5-libs-1.15.1-50.el7.x86_64.rpm libselinux-devel-2.5-15.el7.x86_64.rpm zlib-1.2.7-19.el7_9.x86_64.rpm
libacl-2.2.51-15.el7.x86_64.rpm libselinux-python-2.5-15.el7.x86_64.rpm zlib-devel-1.2.7-19.el7_9.x86_64.rpm
#解压userspace-rcu-master.zip 编译安装
[root@gluster01 gluster]# unzip /root/gluster/userspace-rcu-master.zip -d /usr/local/
[root@gluster01 gluster]# cd /usr/local/userspace-rcu-master/
[root@gluster01 gluster]# ./bootstrap
[root@gluster01 gluster]# ./configure
[root@gluster01 gluster]# make && make install
[root@gluster01 gluster]# ldconfig
#安装依赖
[root@gluster01 dep]# rpm -ivh *.rpm --test #这里是刚刚那一堆的依赖,只要第一行达到100% 有文件冲突没关系
[root@gluster01 dep]# rpm -ivh *.rpm --force #开始冲
#源码安装glusterfs-3.6.9.tar.gz
[root@gluster01 gluster]# tar -zxvf /root/gluster/glusterfs-3.6.9.tar.gz -C /usr/local/
[root@gluster01 gluster]# cd /usr/local/glusterfs-3.6.9/
[root@gluster01 gluster]# ./configure --prefix=/usr/local/glusterfs
[root@gluster01 gluster]# make && make install
#配置环境变量
把如下两行加入到/etc/profile
export GLUSTERFS_HOME=/usr/local/glusterfs
export PATH=$PATH:$GLUSTERFS_HOME/sbin
#更新环境变量
[root@gluster01 gluster]# source /etc/profile
#启动服务
[root@gluster01 gluster]# /usr/local/glusterfs/sbin/glusterd
[root@gluster01 gluster]# gluster --version
glusterfs 3.6.9 built on Jun 17 2021 10:07:12
Repository revision: git://git.gluster.com/glusterfs.git
Copyright (c) 2006-2011 Gluster Inc. <http://www.gluster.com>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GlusterFS under the terms of the GNU General Public License.
2、开始部署准备(如下所有操作均需要在01,02节点上操作)
1). 先将数据盘格式化并挂载
#格式化
[root@gluster01 gluster]# mkfs.xfs /dev/vdb
[root@gluster01 gluster]# mkfs.xfs /dev/vdc
[root@gluster01 gluster]# mkfs.xfs /dev/vdd
#挂载
[root@gluster01 gluster]# mkdir -p /data/data-b
[root@gluster01 gluster]# mkdir -p /data/data-c
[root@gluster01 gluster]# mkdir -p /data/data-d
[root@gluster01 gluster]# mount /dev/vdb /data/data-b/
[root@gluster01 gluster]# mount /dev/vdc /data/data-c/
[root@gluster01 gluster]# mount /dev/vdd /data/data-d/
[root@gluster01 gluster]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 478K 0 rom
vda 253:0 0 50G 0 disk
├─vda1 253:1 0 1G 0 part /boot
└─vda2 253:2 0 49G 0 part /
vdb 253:16 0 10G 0 disk /data/data-b
vdc 253:32 0 10G 0 disk /data/data-c
vdd 253:48 0 10G 0 disk /data/data-d
[root@gluster01 gluster]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda2 xfs 49G 2.3G 47G 5% /
devtmpfs devtmpfs 911M 0 911M 0% /dev
tmpfs tmpfs 920M 0 920M 0% /dev/shm
tmpfs tmpfs 920M 8.4M 912M 1% /run
tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup
/dev/vda1 xfs 1021M 135M 886M 14% /boot
tmpfs tmpfs 184M 0 184M 0% /run/user/0
/dev/vdb xfs 10G 33M 10G 1% /data/data-b
/dev/vdc xfs 10G 33M 10G 1% /data/data-c
/dev/vdd xfs 10G 33M 10G 1% /data/data-d
[root@gluster01 gluster]#
3、节点存储资源汇总
[root@gluster01 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.90 glusterf01
192.168.10.48 glusterf02
[root@gluster01 ~]# gluster peer probe 192.168.10.48
peer probe: success.
[root@gluster01 ~]# gluster peer status
Number of Peers: 1
Hostname: 192.168.10.48
Uuid: a919d0c1-11ce-4923-ae9d-fb6794c00f64
State: Peer in Cluster (Connected)
[root@gluster01 ~]# gluster pool list
UUID Hostname State
a919d0c1-11ce-4923-ae9d-fb6794c00f64 192.168.10.48 Connected
91928bc7-5e8a-450a-809e-0bb3e8dacb93 localhost Connected
[root@gluster01 ~]#
4、创建测试卷(如下操作随便找个gluster节点即可)
#复制卷:
replica = brick
#条带卷 default 128k
stripe = birck
#分布式条带
brick数是stripe的倍数
#分布式复制卷
brick数量是replica的倍数
#条带式复制卷
brick数量是stripe、replica的乘积
#分布式条带复制卷
brick的数量是stripe、replica的乘积的倍数
#创建一个名为gv1的分布式复制卷 2副本 默认为分布式
[root@gluster01 ~]# gluster volume create gv1 replica 2 192.168.10.90:/data/data-b 192.168.10.48:/data/data-b 192.168.10.90:/data/data-c 192.168.10.48:/data/data-c 192.168.10.90:/data/data-d 192.168.10.48:/data/data-d force
volume create: gv1: success: please start the volume to access data
[root@gluster01 ~]#
#查看状态
[root@gluster01 ~]# gluster v info
Volume Name: gv1
Type: Distributed-Replicate # 分布式复制卷
Volume ID: 1d3f2894-c622-4845-bf3b-b5d742108a12
Status: Created
Number of Bricks: 3 x 2 = 6 # 分布式复制卷 2副本
Transport-type: tcp
Bricks:
Brick1: 192.168.10.90:/data/data-b
Brick2: 192.168.10.48:/data/data-b
Brick3: 192.168.10.90:/data/data-c
Brick4: 192.168.10.48:/data/data-c
Brick5: 192.168.10.90:/data/data-d
Brick6: 192.168.10.48:/data/data-d
#启动卷
[root@gluster01 ~]# gluster v start gv1
volume start: gv1: success
#查看各个brick的状态
[root@gluster01 ~]# gluster v status
Status of volume: gv1
Gluster process Port Online Pid
------------------------------------------------------------------------------
Brick 192.168.10.90:/data/data-b 49153 Y 10247
Brick 192.168.10.48:/data/data-b 49152 Y 19228
Brick 192.168.10.90:/data/data-c 49154 Y 10258
Brick 192.168.10.48:/data/data-c 49153 Y 19239
Brick 192.168.10.90:/data/data-d 49155 Y 10269
Brick 192.168.10.48:/data/data-d 49154 Y 19250
NFS Server on localhost N/A N N/A
Self-heal Daemon on localhost N/A N N/A
NFS Server on 192.168.10.48 N/A N N/A
Self-heal Daemon on 192.168.10.48 N/A N N/A
Task Status of Volume gv1
------------------------------------------------------------------------------
There are no active volume tasks
#挂载测试
[root@gluster01 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda2 xfs 49G 2.8G 47G 6% /
devtmpfs devtmpfs 911M 0 911M 0% /dev
tmpfs tmpfs 920M 0 920M 0% /dev/shm
tmpfs tmpfs 920M 8.5M 912M 1% /run
tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup
/dev/vda1 xfs 1021M 135M 886M 14% /boot
tmpfs tmpfs 184M 0 184M 0% /run/user/0
/dev/vdb xfs 10G 33M 10G 1% /data/data-b
/dev/vdc xfs 10G 33M 10G 1% /data/data-c
/dev/vdd xfs 10G 33M 10G 1% /data/data-d
[root@gluster01 ~]# mount.glusterfs 192.168.10.90:/gv1 /mnt/ #挂载操作,使用glusterfs专用
[root@gluster01 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda2 xfs 49G 2.8G 47G 6% /
devtmpfs devtmpfs 911M 0 911M 0% /dev
tmpfs tmpfs 920M 0 920M 0% /dev/shm
tmpfs tmpfs 920M 8.5M 912M 1% /run
tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup
/dev/vda1 xfs 1021M 135M 886M 14% /boot
tmpfs tmpfs 184M 0 184M 0% /run/user/0
/dev/vdb xfs 10G 33M 10G 1% /data/data-b
/dev/vdc xfs 10G 33M 10G 1% /data/data-c
/dev/vdd xfs 10G 33M 10G 1% /data/data-d
192.168.10.90:/gv1 fuse.glusterfs 30G 97M 30G 1% /mnt
[root@gluster01 ~]# cd /mnt/
[root@gluster01 mnt]# ls
[root@gluster01 mnt]# touch test1..10
[root@gluster01 mnt]# ls
test1 test10 test2 test3 test4 test5 test6 test7 test8 test9
#卸载后,重挂测试
[root@gluster01 ~]# umount /mnt/
[root@gluster01 ~]#
[root@gluster01 ~]#
[root@gluster01 ~]# cd /mnt/
[root@gluster01 mnt]# ls
[root@gluster01 mnt]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda2 xfs 49G 2.8G 47G 6% /
devtmpfs devtmpfs 911M 0 911M 0% /dev
tmpfs tmpfs 920M 0 920M 0% /dev/shm
tmpfs tmpfs 920M 8.6M 912M 1% /run
tmpfs tmpfs 920M 0 920M 0% /sysGlusteFS 二
使用 org.apache.hadoop/* 依赖项离线编译 sbt 的问题
18. 优雅解决The android gradle plugin version 3.0.0-alpha1 is too old, update to the latest version