GPFS由IBM开发的集群文件系统
这个集群文件系统在Linux下已经销声匿迹很久了,常玩AIX的同学想必对这个文件系统很是熟悉了。
笔者只是最近有兴趣来测试一下,不过让人心碎的是IBM却不对外开放下载了,只有它的update包对外开放下载。
唉,功夫不服有心人,笔者实在是太聪明了,最终解决了此问题,成功的安装了最新的GPFS文件系统。
笔者在gg中寻她千万处,却没想到在乱草茂盛的沟和中。
在http://www.ira.inaf.it/centrocal/centrocal/tecnica/GPFS/ira-soft/rpm/gpfs.base-3.2.0找到了它的元神!!!
有救了,下边继续!
yum -y install make perl rsh ld-linux.so libm.so.6 libc.so.6 ksh libstdc++.so.5 rsh-server rpcbind xinetd libaio cpp gcc-c++ gcc nfs-utils kernel-headers kernel-devel compat-libstdc++ glibc-devel libXp.so.6 imake rpm-build rpm-build
GPFS软件需求
gpfs.base gpfs.msg.en_US gpfs.docs gpfs.gp
2.2软件安装软件安装软件安装软件安装 使用rpm –ivh将以上需求安装包在每个节点上装齐
2.2.1在每个节点上在每个节点上在每个节点上在每个节点上安装安装安装安装GPFS软件包软件包软件包软件包
2.2.1.1Tar -zxcvf解压gpfs-3.1.0-6.x86_64.update.tar.gz生成 gpfs.base gpfs.msg.en_US gpfs.docs gpfs.gp
2.2.1.2使用rpm安装软件包 rpm -ivh gpfs.msg.en_US-3.1.0-6.noarch.rpm rpm -ivh gpfs.docs-3.1.0-6.noarch.rpm rpm -ivh gpfs.gpl-3.1.0-6.noarch.rpm rpm -ivh ---noscripts gpfs.base-3.1.0-6.x86_64.update.rpm
2.2.1.3使用 rpm -qa|grep gpfs检查GPFS软件安装情况 gpfs.base-3.1.0-6 gpfs.msg.en_US-3.1.0-6 gpfs.docs-3.1.0-6 gpfs.gpl-3.1.0-6 2.2.2、、、、gpfs软件编译软件编译软件编译软件编译
2.2.2.1、在每个节点中准备portability layer build #echo 'Red Hat Enterprise Linux Server release 5.3 (Tikanga)' > /etc/redhat-release cd /usr/lpp/mmfs/src export SHARKCLONEROOT=/usr/lpp/mmfs/src rm config/site.mcr make Autoconfig
2.2.2.2、在每个节点上检查配置文件值与系统环境是否正确
grep ^LINUX_DISTRIBUTION config/site.mcr grep 'define LINUX_DISTRIBUTION_LEVEL' config/site.mcr grep 'define LINUX_KERNEL_VERSION' config/site.mcr 注意:"2061899" 意思是l "2.6.18-128.1.10.el5" 2.2.2.3、在每个节点上编译 make clean make World make InstallImages 2.2.3、、、、在每个节点上编译在每个节点上编译在每个节点上编译在每个节点上编译.bashrc文件文件文件文件,,,,建立建立建立建立GPFS命令环境命令环境命令环境命令环境变量变量变量变量 On each node, edit the PATH,
从http://www.ira.inaf.it/centrocal/centrocal/tecnica/GPFS/ira-soft/rpm/gpfs.base-3.2.0获得3.2的gpfs的包
然后安装一下几个
[root@os-1 gpfs]# cd /usr/src/
[root@os-1 src]# cd gpfs/
[root@os-1 gpfs]# ls
GPFS-3.5.0.8-x86_64-Linux.tar.gz gpfs.docs-3.2.0-0.noarch.rpm gpfs.msg.en_US-3.2.0-0.noarch.rpm
gpfs.base-3.2.0-0.x86_64.rpm gpfs.gpl-3.2.0-0.noarch.rpm
[root@os-1 gpfs]# rpm -ivh gpfs.base-3.2.0-0.x86_64.rpm
Preparing... ########################################### [100%]
1:gpfs.base ########################################### [100%]
[root@os-1 gpfs]# rpm -ivh gpfs.docs-3.2.0-0.noarch.rpm
Preparing... ########################################### [100%]
1:gpfs.docs ########################################### [100%]
[root@os-1 gpfs]# rpm -ivh gpfs.gpl-3.2.0-0.noarch.rpm
Preparing... ########################################### [100%]
1:gpfs.gpl ########################################### [100%]
[root@os-1 gpfs]# rpm -ivh gpfs.msg.en_US-3.2.0-0.noarch.rpm
Preparing... ########################################### [100%]
1:gpfs.msg.en_US ########################################### [100%]
然后再从IBM获得升级包
http://delivery04.dhe.ibm.com/sar/CMA/OSA/03mkk/0/GPFS-3.5.0.8-x86_64-Linux.tar.gz
安装(顺利升级成3.5)
[root@os-1 gpfs]# tar -zxvf GPFS-3.5.0.8-x86_64-Linux.tar.gz
[root@os-1 gpfs]# rpm -Uvh gpfs.base-3.5.0-8.x86_64.update.rpm
Preparing... ########################################### [100%]
1:gpfs.base ########################################### [100%]
[root@os-1 gpfs]# rpm -Uvh gpfs.docs-3.5.0-8.noarch.rpm
Preparing... ########################################### [100%]
1:gpfs.docs ########################################### [100%]
[root@os-1 gpfs]# rpm -Uvh gpfs.gpl-3.5.0-8.noarch.rpm
Preparing... ########################################### [100%]
1:gpfs.gpl ########################################### [100%]
[root@os-1 gpfs]# rpm -Uvh gpfs.msg.en_US-3.5.0-8.noarch.rpm
Preparing... ########################################### [100%]
1:gpfs.msg.en_US ########################################### [100%]
编译 gpfs 源代码
echo "Red Hat Enterprise Linux Server release 6.2 (Santiago)" > /etc/redhat-release
cd /usr/lpp/mmfs/src && make Autoconfig && make World && make InstallImages && make rpm
[root@os-1 src]# rpm -ivh /root/rpmbuild/RPMS/x86_64/gpfs.gplbin-2.6.32-358.el6.x86_64-3.5.0-8.x86_64.rpm
Preparing... ########################################### [100%]
1:gpfs.gplbin-2.6.32-358.########################################### [100%]
配置ssh无密码访问
ssh-keygen -t rsa -b 2048 && cd ~/.ssh/(每个节点)
选任意某个节点:
ssh os-10 cat ~/.ssh/id_rsa.pub >>authorized_keys
然后将这个节点的
authorized_keys和known_hosts分发给每个节点
创建这个文件,并分发
[root@os-M src]# cat ~/.rhosts
os-1 root
os-2 root
os-3 root
os-4 root
os-5 root
os-6 root
os-7 root
os-8 root
os-9 root
os-10 root
os-M root
[root@os-M src]# ssh os-M chmod 600 /root/.rhosts
创建一下文件,并分发
[root@os-M src]# cat /etc/hosts.equiv
os-1
os-2
os-3
os-4
os-5
os-6
os-7
os-8
os-9
os-10
os-M
[root@os-M src]# ssh os-10 chmod 600 /etc/hosts.equiv
然后在/etc/securetty文件后边加:
rsh
rexec
rlogin
保存后分发
查看rsh有没有安装成功
[root@os-M src]# rpm -qa|grep rsh
rsh-server-0.17-60.el6.x86_64
rsh-0.17-60.el6.x86_64
[root@os-M src]# ls /etc/xinetd.d/
chargen-dgram daytime-dgram discard-dgram echo-dgram rexec rsh time-dgram
chargen-stream daytime-stream discard-stream echo-stream rlogin tcpmux-server time-stream
修改/etc/xinetd.d/rsh
[root@os-M src]# cat /etc/xinetd.d/rsh
# default: on
# description: The rshd server is the server for the rcmd(3) routine and, \
# consequently, for the rsh(1) program. The server provides \
# remote execution facilities with authentication based on \
# privileged port numbers from trusted hosts.
service shell
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rshd
disable = no #将此处的yes改成no
}
然后分发到各个节点
如上修改将yes改成NO 然后分发/etc/xinetd.d/rexec /etc/xinetd.d/rlogin
修改如下,并分发文件,文件位于/etc/pam.d/
[root@os-M pam.d]# cat rsh
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rsh" must be
# listed in /etc/securetty.
auth required pam_nologin.so
#auth required pam_securetty.so #注释掉
auth required pam_env.so
auth required pam_rhosts.so
account include password-auth
session optional pam_keyinit.so force revoke
session required pam_loginuid.so
session include password-auth
[root@os-M pam.d]# cat rlogin
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rlogin" must be
# listed in /etc/securetty.
auth required pam_nologin.so
#auth required pam_securetty.so #注释掉
auth required pam_env.so
auth sufficient pam_rhosts.so
auth include password-auth
account include password-auth
password include password-auth
session optional pam_keyinit.so force revoke
session required pam_loginuid.so
session include password-auth
[root@os-M pam.d]# cat rexec
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rexec" must be
# listed in /etc/securetty.
auth required pam_nologin.so
#auth required pam_securetty.so #注释掉
auth required pam_env.so
auth include password-auth
account include password-auth
session optional pam_keyinit.so force revoke
session required pam_loginuid.so
session include password-auth
然后启动依赖服务(每个节点执行)
ssh os-$aaa chkconfig --level 235 rlogin on && ssh os-$aaa chkconfig --level 235 rsh on && ssh os-$aaa chkconfig --level 235 rexec on && ssh os-$aaa chkconfig --level 235 iptables off && ssh os-$aaa chkconfig --level 235 rpcbind on && ssh os-$aaa chkconfig --level 235 nfs on && ssh os-$aaa service rpcbind restart && service nfs restart
GPFS 配置部分
export PATH=$PATH:/usr/lpp/mmfs/bin && echo "export PATH=$PATH:/usr/lpp/mmfs/bin" >> /etc/profile
创建各个节点的共享目录mkdir /home/gpfs
创建集群配置文件
vi /tmp/gpfsprofile
os-1:quorum-manager
os-2:quorum-manager
os-3:quorum-manager
os-4:quorum-manager
os-5:quorum-manager
os-6:quorum-manager
os-7:quorum-manager
os-8:quorum-manager
os-9:quorum-manager
os-10:quorum-manager
os-M:quorum-manager
将此文件分发到各个节点上,然后启动服务
[root@os-M pam.d]# mmcrcluster -N /tmp/gpfsprofile -p os-M -s os-1
2013年 03月 29日 星期五 18:16:09 CST: mmcrcluster: Processing node os-1
2013年 03月 29日 星期五 18:16:12 CST: mmcrcluster: Processing node os-2
2013年 03月 29日 星期五 18:16:15 CST: mmcrcluster: Processing node os-3
2013年 03月 29日 星期五 18:16:18 CST: mmcrcluster: Processing node os-4
2013年 03月 29日 星期五 18:16:20 CST: mmcrcluster: Processing node os-5
2013年 03月 29日 星期五 18:16:24 CST: mmcrcluster: Processing node os-6
2013年 03月 29日 星期五 18:16:27 CST: mmcrcluster: Processing node os-7
2013年 03月 29日 星期五 18:16:29 CST: mmcrcluster: Processing node os-8
2013年 03月 29日 星期五 18:16:32 CST: mmcrcluster: Processing node os-9
2013年 03月 29日 星期五 18:16:35 CST: mmcrcluster: Processing node os-10
2013年 03月 29日 星期五 18:16:38 CST: mmcrcluster: Processing node os-M
mmcrcluster: Attention: The number of quorum nodes exceeds the suggested maximum (7).
mmcrcluster: Command successfully completed
mmcrcluster: Warning: Not all nodes have proper GPFS license designations.
Use the mmchlicense command to designate licenses as needed.
mmcrcluster: Propagating the cluster configuration data to all
affected nodes. This is an asynchronous process.
接受许可协议
[root@os-M pam.d]# mmchlicense server --accept -N os-1,os-2,os-3,os-4,os-5,os-6,os-7,os-8,os-9,os-10,os-M
The following nodes will be designated as possessing GPFS server licenses:
os-1
os-2
os-3
os-4
os-5
os-6
os-7
os-8
os-9
os-10
os-M
mmchlicense: Command successfully completed
mmchlicense: Propagating the cluster configuration data to all
affected nodes. This is an asynchronous process.
生成NSD盘
[root@os-M pam.d]# cat /proc/partitions
major minor #blocks name
8 0 78125000 sda
8 1 512000 sda1
8 2 77611008 sda2
253 0 52428800 dm-0
253 1 4063232 dm-1
253 2 21114880 dm-2
[root@os-M pam.d]# vi /tmp/nsdprofile
[root@os-M pam.d]# cat /tmp/nsdprofile
sda:::dataAndMetadata::
[root@os-M pam.d]# cat /tmp/nsdprofile
# sda:::dataAndMetadata::
gpfs1nsd:::dataAndMetadata:-1::system
启动集群
[root@os-M pam.d]# mmstartup -a
2013年 03月 29日 星期五 18:26:47 CST: mmstartup: Starting GPFS ...
查看集群状态
[root@os-M pam.d]# mmgetstate -a
Node number Node name GPFS state
------------------------------------------
1 os-1 arbitrating
2 os-2 arbitrating
3 os-3 down
4 os-4 down
5 os-5 arbitrating
6 os-6 down
7 os-7 down
8 os-8 down
9 os-9 down
10 os-10 arbitrating
11 os-M arbitrating
###############################
本文属笔者原创
作者:john
转载请注明出处