GPFS centos7部署实战
准备工作(每个节点)
集群时间同步
yum install -y ntpdate
ntpdate ntp.sjtu.edu.cn
关闭不必要的服务
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
免密
root 本地和节点之间免密认证,ssh自己也要做免密的
ssh-keygen -t rsa
ssh-copy-id -i .ssh/id_rsa.pub gpfs1
ssh-copy-id -i .ssh/id_rsa.pub gpfs2
安装(每个节点)
执行自动解压安装包
./Spectrum_Scale_Advanced-4.2.3.9-x86_64-Linux-install
进入解压完的rpm包文件夹
cd /usr/lpp/mmfs/4.2.3.9/gpfs_rpms
yum安装解决依赖问题
yum install -y gpfs.base-4.2.3-9.x86_64.rpm gpfs.docs-4.2.3-9.noarch.rpm gpfs.gpl-4.2.3-9.noarch.rpm gpfs.msg.en_US-4.2.3-9.noarch.rpm gpfs.gskit-8.0.50-86.x86_64.rpm gpfs.ext-4.2.3-9.x86_64.rpm
编译前的准备(记得安装内核头文件和gcc gcc++等编译器,建议使用本地光盘yum源)
yum install kernel-headers kernel-devel -y
yum groupinstall "Development Tools" -y
编译安装(如果编译出错,请检查编译器版本和内核版本)
cd /usr/lpp/mmfs/src/
make Autoconfig && make World && make InstallImages
环境变量导入
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' >> /etc/profile
source /etc/profile
创建集群(管理节点)
编辑node描述文件 node.desc
目前认为:manager-quorum属于管理节点
gpfs_test1:manager-quorum
gpfs_test2:quorum
生成集群
mmcrcluster -A -N node.desc -p gpfs_test1 -s gpfs_test2 -r /usr/bin/ssh -R /usr/bin/scp
查看集群
mmlscluster
集群改名
mmchcluster -C simple_test
配置许可
mmchlicense server --accept -N gpfs_test1,gpfs_test2
启动集群
mmstartup -a
查看集群状态,如果状态为active则为正常
mmgetstate -a
NSD磁盘配置
编辑nsd描述文件 nsd.desc
/dev/vda2:gpfs_test1::dataAndMetadata::nsd1:system
/dev/vda2:gpfs_test2::dataAndMetadata::nsd2:system
创建nsd
mmcrnsd -F nsd.desc -v no
查看nsd状态
mmlsnsd
配置仲裁盘(摸索中)
仲裁盘作用:当定义的仲裁盘有一半的磁盘不可用时,该集群不可用。
仲裁节点和仲裁盘只能配置一种。
mmchconfig tiebreakerDisks="gpfs1nsd;gpfs2nsd;gpfs3nsd"
mmchconfig tiebreakerDisks="nsd1,nsd2,nsd3 "
但是,悲伤的问题就是会报错,好难过555
绝招,设置个default 就不报错了
mmchconfig tiebreakerDisks=DEFAULT
创建文件系统
在之前建立nsd后,nsd的描述文件会改变,如下
# /dev/vda2:gpfs_test1::dataAndMetadata::nsd1:system
nsd1:::dataAndMetadata:-1::system
# /dev/vda2:gpfs_test2::dataAndMetadata::nsd2:system
nsd2:::dataAndMetadata:-1::system
创建文件系统
mmcrfs wahaha -F nsd.desc -A yes -T /wahaha
第一个wahaha是gpfs的文件名,第二个/wahaha是文件系统的挂载点
查看文件系统的详细信息
mmlsfs all
File system attributes for /dev/wahaha:
=======================================
flag value description
------------------- ------------------------ -----------------------------------
-f 8192 Minimum fragment size in bytes
-i 4096 Inode size in bytes
-I 32768 Indirect block size in bytes
-m 1 Default number of metadata replicas
-M 2 Maximum number of metadata replicas
-r 1 Default number of data replicas
-R 2 Maximum number of data replicas
-j cluster Block allocation type
-D nfs4 File locking semantics in effect
-k all ACL semantics in effect
-n 32 Estimated number of nodes that will mount file system
-B 262144 Block size
-Q none Quotas accounting enabled
none Quotas enforced
none Default quotas enabled
--perfileset-quota No Per-fileset quota enforcement
--filesetdf No Fileset df enabled?
-V 17.09 (4.2.3.9) File system version
--create-time Tue Dec 15 10:22:59 2020 File system creation time
-z No Is DMAPI enabled?
-L 4194304 Logfile size
-E Yes Exact mtime mount option
-S No Suppress atime mount option
-K whenpossible Strict replica allocation option
--fastea Yes Fast external attributes enabled?
--encryption No Encryption enabled?
--inode-limit 65792 Maximum number of inodes
--log-replicas 0 Number of log replicas
--is4KAligned Yes is4KAligned?
--rapid-repair Yes rapidRepair enabled?
--write-cache-threshold 0 HAWC Threshold (max 65536)
--subblocks-per-full-block 32 Number of subblocks per full block
-P system Disk storage pools in file system
-d nsd1;nsd2 Disks in file system
-A yes Automatic mount option
-o none Additional mount options
-T /wahaha Default mount point
--mount-priority 0 Mount priority
挂载,挂载成功如下图
mmmount wahaha -a
维护
开机启动
echo "/usr/lpp/mmfs/bin/mmstartup -a" >> /etc/rc.local
或者
mmchconfig autoload=yes
常用命令
mmstartup
mmshutdown
mmmount
mmumount
mmlscluster
mmlsnsd
mmlsfs
mmlsconfig
参考:
https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.5/com.ibm.spectrum.scale.v5r05.doc/bl1pdg_dnoupsp.htm
https://blog.csdn.net/cici_dh/article/details/46786387
https://www.jianshu.com/p/445753a851a4
https://blog.csdn.net/weixin_33755554/article/details/90252311
来源:oschina
链接:https://my.oschina.net/u/4353003/blog/4812542