您查看的文章来源于http://www.oklinux.cn
设置每台主机上到磁盘的首选路径,使其可以匹配每个 DS4500 上的设置。使用通过 HBA0 看到的奇数编号的数组,以及通过 HBA1 看到的偶数编号的数组。
第二个修改需要在对存储节点重新安装时手动执行。详细信息在 在存储服务器上定义 HBA 配置 一节中介绍。
GPFS 网络调优
将该示例中提供的几行代码添加到每个节点上的 /etc/sysctl.conf
文件中,用来对 GPFS 网络进行调优。这是通过 CSM 使用的 post-reboot 安装脚本完成的。这个脚本位于 /csminstall/csm/scripts/installpostreboot
目录中,包含以下内容:
FILE=/etc/sysctl.conf
# Adds lines to /etc/sysctl.conf for GPFS network tuning
echo "# CSM added the next 8 lines to the post installation script for
GPFS network tuning" >> $FILE
echo "# increase Linux TCP buffer limits" >> $FILE
echo "net.core.rmem_max = 8388608" >> $FILE
echo "net.core.wmem_max = 8388608" >> $FILE
echo "# increase default and maximum Linux TCP buffer sizes" >> $FILE
echo "net.ipv4.tcp_rmem = 4096 262144 8388608" >> $FILE
echo "net.ipv4.tcp_wmem = 4096 262144 8388608" >> $FILE
echo "# increase max backlog to avoid dropped packets" >> $FILE
echo "net.core.netdev_max_backlog=2500" >> $FILE
# Following lines are not related to GPFS tuning
echo "# Allow Alt-SysRq" >> $FILE
echo "kernel.sysrq = 1" >> $FILE
echo "# Increase ARP cache size" >> $FILE
echo "net.ipv4.neigh.default.gc_thresh1 = 512" >> $FILE
echo "net.ipv4.neigh.default.gc_thresh2 = 2048" >> $FILE
echo "net.ipv4.neigh.default.gc_thresh3 = 4096" >> $FILE
echo "net.ipv4.neigh.default.gc_stale_time = 240" >> $FILE
# Reset the current kernel parameters
sysctl -p /etc/sysctl.conf
|
分发 GPFS 可移植层
GPFS 可移植层(PL)是内核特有的,必须为集群中的每个操作系统级别单独创建。PL 的作用和为示例集群创建它的过程将在 生成并安装可移植层 一节中详述。CSM 使用 CFM 文件传输工具来管理 PL 二进制文件的分发。将 PL 二进制文件拷贝到管理服务器上的 /cfmroot/usr/lpp/mmfs/bin
目录中,并对文件进行命名,使它们只会分发到相关组中具有特定内核版本的节点上。例如:
/cfmroot/usr/lpp/mmfs/bin/dumpconv._<nodegroup>
/cfmroot/usr/lpp/mmfs/bin/lxtrace._<nodegroup>
/cfmroot/usr/lpp/mmfs/bin/mmfslinux._<nodegroup>
/cfmroot/usr/lpp/mmfs/bin/tracedev._<nodegroup>
|
注意在大型集群中,为了减轻 CFM 的负载,可以将这 4 个文件添加到定制 RPM 中,并使用上文介绍的 GPFS RPM 安装方法与 GPFS 一起安装。
自动将新节点添加到 GPFS 集群中
简单地安装 GPFS RPMS 和可移植层无法在新安装的节点上挂载并配置 GPFS 集群中的文件系统。在小型集群中,这可以手工进行管理。然而,扩展到更大规模的集群之后,就需要自动化完成这个步骤。这可以通过使用 CSM 的监视功能来完成:监视整个新节点的安装过程,并启动一个脚本在集群中的新节点上配置和挂载 GPFS。
清单 1 给出了一个示例脚本,可以用来配置 GPFS。您可能需要针对自己的配置对这个脚本稍加修改。清单 1 提供了一些基本内容。这个脚本会接收节点名(由 CSM 监视器传入),将其添加到 GPFS 集群中,并尝试在这个节点上启动 GPFS,这个过程会提供一点错误处理功能。
清单 1. 配置 GPFS 使用的示例脚本
#!/bin/bash
# CSM condition/response script to be used as a response to the InstallComplete
# condition. This will attempt to add the node to the GPFS cluster, dealing
# with some common failure conditions along the way. Only trivial attempts are
# made at problem resolution, advanced problems are left for manual
# intervention.
# Note requires the GPFS gpfs-nodes.list file. This file should contain a list
# of all nodes in the GPFS cluster with client/manager and
# quorum/non-quorum details suitable for passing to the mmcrcluster command.
# Output is sent to /var/log/csm/
# Returned error codes:
# 1 - GPFS is already active
# 2 - unable to read the gpfs-nodes.list file
# 3 - node name not present in the gpfs-nodes.list file
# 4 - node is a quorum node
# 5 - unable to add node to cluster (mmaddnode failed)
# 6 - unable to start GPFS on the node (mmstartup failed)
# set this to the location of your node list file
gpfs_node_list=/etc/gpfs-nodes.list
# set this to the interface GPFS is using for communication
gpfs_interface=eth1
PATH=$PATH:/usr/lpp/mmfs/bin # ensure GPFS binaries are in the PATH
log_file=/var/log/csm/`basename $0`.log # log to /var/log/csm/
touch $log_file
# Get the node short name as set by RSCT condition ENV var ERRM_RSRC_NAME
node=`echo $ERRM_RSRC_NAME | cut -d. -f1`
(
[ ! -r "$gpfs_node_list" ] && echo " ** error: cannot read GPFS
node list $gpfs_node_list" && exit 2
echo
echo "--- Starting run of `basename $0` for $node at `date`"
# Is the node a quorum node? If so exit.
quorum_status=`grep $node $gpfs_node_list | cut -d: -f2 | cut -d- -f2`
if [ -n "$quorum_status" ]; then
if [ "$quorum_status" = "quorum" ]; then
echo "** error: this is a quorum node, stopping..."
exit 4
else
node_s=`grep $node $gpfs_node_list | cut -d: -f1`
fi
else
echo "** error: could not find node $node in GPFS node list $gpfs_node_list"
exit 3
fi
# Find out if the node is already part of the cluster
if mmlscluster | grep $node >/dev/null; then
# check the node status
status=`mmgetstate -w $node | grep $node | awk '{print $3}'`
if [ "$status" = "active" ]; then
echo "** error: this node already appears to have GPFS active!"
exit 1
fi
# attempt to remove node from cluster
echo "Node $node is already defined to cluster, removing it"
# attempt to disable storage interface on node
if ssh $node $ifdown $gpfs_interface; then
mmdelnode $node
ssh $node ifup $gpfs_interface
else
echo "** error: could not ssh to $node, or ifdown $gpfs_interface failed"
fi
fi
# try to add node to GPFS cluster
if mmaddnode $node; then
echo "Successfully added $node to GPFS cluster, starting GPFS on $node"
if mmstartup -w $node; then
echo "mmstartup -w $node succeeded"
else
echo "** error: cannot start GPFS on $node, please investigate"
exit 6
fi
else
echo "** error: could not add $node to GPFS cluster"
exit 5
fi
) >>$log_file 2>&1
|