文章目录
一、前言
1、硬件配置
节点类型 | 主机名 | IP地址 | 硬件配置 |
---|---|---|---|
盘阵 | / | / | 5U84 JBOD盘阵 硬盘:16TB SAS HDD x 70、800GB SAS SSD x 4 io模块:io模块 x 2(单个模块3个SAS接口)SAS线:Mini SAS HD连接线 x 4 |
服务器 | test-lustre2 | 千兆:10.1.80.12/16 万兆:172.16.21.12/24 | 4U4路服务器 CPU:Intel Gold 5120 CPU @ 2.20GHz x 4 内存:512GB 网络:1Gb x 1、10Gb x 4(bond4) SAS卡:LSI SAS 9300-8e 双口SAS卡 x 1 系统盘:1.2T SAS SSD * 2(RAID1) |
服务器 | test-lustre3 | 千兆:10.1.80.13/16 万兆:172.16.21.13/24 | 4U4路服务器 CPU:Intel Gold 5120 CPU @ 2.20GHz x 4 内存:512GB 网络:1Gb x 1、10Gb x 4(bond4) SAS卡:LSI SAS 9300-8e 双口SAS卡 x 1 系统盘:1.2T SAS SSD * 2(RAID1) |
客户端 | test-lustre1 | 千兆:10.1.80.11/16 万兆:172.16.21.11/24 | 4U4路服务器 CPU:Intel Gold 5120 CPU @ 2.20GHz x 4 内存:512GB 网络:1Gb x 1、10Gb x 4(bond4) 系统盘:1.2T SAS SSD * 2(RAID1) |
客户端 | test-lustre4 | 千兆:10.1.80.14/16 万兆:172.16.21.14/24 | 4U4路服务器 CPU:Intel Gold 5120 CPU @ 2.20GHz x 4 内存:512GB 网络:1Gb x 1、10Gb x 4(bond4) 系统盘:1.2T SAS SSD * 2(RAID1) |
2、组网拓扑
3、总体方案
本篇主要阐述Lustre软raid方案部署说明,总体配置如下:
- a、配置多路径
一台盘阵通过4根SAS线连接至两台服务器双口SAS卡,每台服务器通过multipath对所有硬盘配置主主多路径 - b、配置高可用集群
通过pacemaker配置高可用集群,建立集群节点互信 - c、配置zpool
通过zfs配置软raid,使用10块HDD组raid6(共7组,用于OST数据存储),使用4块SSD组raid10(共1组,用于MGT/MDT数据存储) - d、部署lustre
通过mkfs.lustre对lustre角色(MGT/MDT/OST)raid盘进行格式化操作 - e、配置Lustre角色高可用
通过pcs创建ocf:heartbeat:ZFS
、ocf:lustre:Lustre
资源,其中ocf:heartbeat:ZFS
用于管理zpool池导入导出,ocf:lustre:Lustre
用于管理lustre角色挂载 - f、配置Lustre状态监控
通过pcs创建ocf:lustre:healthLNET
、ocf:lustre:healthLUSTRE
监控规则,应用到所有资源上,其中ocf:lustre:healthLNET
用于监测LNet网络连接状态,ocf:lustre:healthLUSTRE
用于监测Lustre集群监控状态,当监测到某一节点异常时,将该节点资源转移到另一节点上
二、软件安装
- 安装lustre软件包
# 安装lustre软件包
yum install -y lustre lustre-iokit kmod-lustre lustre-osd-zfs-mount lustre-zfs-dkms
# 安装lustre-resource-agents软件包,为实现pacemaker可管理lustre服务,需要安装资源代理程序,安装完成后会生成/usr/lib/ocf/resource.d/lustre/目录
yum install -y lustre-resource-agents
- 安装zfs软件包
yum install -y zfs
- 安装multipath多路径软件包
yum install -y device-mapper-multipath
- 安装pacemaker高可用软件包
yum install -y pacemaker pcs
三、集群部署
1、配置多路径
-
生成配置文件
执行命令mpathconf --enable
,在/etc目录下生成配置文件multipath.conf -
修改配置文件
使用多路径主主配置,修改配置文件/etc/mulipath.conf
,添加配置信息如下
defaults {
path_selector "round-robin 0"
path_grouping_policy multibus
user_friendly_names yes
find_multipaths yes
}
devices {
device {
path_grouping_policy multibus
path_checker "tur"
path_selector "round-robin 0"
hardware_handler "1 alua"
prio "alua"
failback immediate
rr_weight "uniform"
no_path_retry queue
}
}
- 设置开机自启动
systemctl restart multipathd
systemctl enable multipathd
- 查看当前配置
当前已生成多路径主主配置,每个磁盘都有两条主路径
[root@test-lustre2 ~]# multipath -ll
mpathbp (35000c500d75452bb) dm-71 SEAGATE ,ST16000NM004J
size=15T features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 1:0:77:0 sdca 68:224 active ready running
`- 1:0:160:0 sdew 129:128 active ready running
2、配置高可用集群
- 所有集群节点配置如下,启动pcsd服务,关闭防火墙及SELinux
systemctl restart pcsd
systemctl enable pcsd
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i s#SELINUX=enforcing#SELINUX=disabled#g /etc/selinux/config
- 所有集群节点配置如下,使用集群网配置hosts文件解析
[root@test-lustre2 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.21.12 test-lustre2
172.16.21.13 test-lustre3
[root@test-lustre3 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.21.12 test-lustre2
172.16.21.13 test-lustre3
- 所有集群节点配置如下,为
hacluster
用户设置相同的密码
[root@test-lustre2 ~]# echo "123456" |passwd --stdin hacluster
[root@test-lustre3 ~]# echo "123456" |passwd --stdin hacluster
- 任一集群节点配置如下,配置集群互信,创建双机pacemaker集群(使用双心跳网络,否则容易出现脑裂),启动所有集群节点corosync和pacemaker服务
注:双机pacemaker集群时忽略节点quorum功能,禁用STONITH组件功能
[root@test-lustre2 ~]# pcs cluster auth 172.16.21.12 172.16.21.13 -u hacluster -p 123456
[root@test-lustre2 ~]# pcs cluster setup --start --name my_cluster 172.16.21.12,10.1.80.12 172.16.21.13,10.1.80.13 --force --transport udpu --token 7000
[root@test-lustre2 ~]# pcs cluster start --all
[root@test-lust