IBM dashDB Local 从入门到精通,第 4 部分 dashDB local MPP Linux 安装指南(11)
 
- UID
- 1066743
|

IBM dashDB Local 从入门到精通,第 4 部分 dashDB local MPP Linux 安装指南(11)
- 编译 GPFS portability layer rpm(每台机器)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| [root@i-si5oq07a src]# <strong>mv /etc/redhat-release/etc/redhat-release.original</strong><br>
[root@i-si5oq07a src]# <strong>cat/etc/redhat-release.original</strong><br>
CentOS Linux release 7.3.1611 (Core)<br>
[root@i-si5oq07a src]# <strong>echo "Red Hat Enterprise Linux Server release 7.3" > /etc/redhat-release</strong><br>
[root@i-si5oq07a src]# <strong>cat /etc/redhat-release</strong><br>
Red Hat Enterprise Linux Server release 7.3<br>
[root@i-si5oq07a src]# <strong>/usr/lpp/mmfs/bin/mmbuildgpl</strong><br>
--------------------------------------------------------<br>
mmbuildgpl: Building GPL module begins at Tue Feb 7 12:54:19 CST 2017.<br>
--------------------------------------------------------<br>
Verifying Kernel Header...<br>
... ...<br>
--------------------------------------------------------<br>
mmbuildgpl: Building GPL module completed successfully at Tue Feb 7 12:54:32 CST 2017.<br>
--------------------------------------------------------<br>
as results, it creates /usr/lpp/mmfs/src/config/env.mcr file:<br>
[root@i-8t7n6xp2 config]# <strong>more env.mcr</strong><br>
#define GPFS_ARCH_X86_64<br>
#define GPFS_LINUX<br>
LINUX_DISTRIBUTION := REDHAT_AS_LINUX<br>
#define LINUX_KERNEL_VERSION 31000514<br>
KERNEL_BUILD_DIR := /usr/src/kernels/3.10.0-514.6.1.el7.x86_64<br>
[root@i-8t7n6xp2 config]#<br>
[root@i-si5oq07a src]# <strong>cd /lib/modules/`uname -r`/extra</strong><br>
[root@i-si5oq07a extra]# <strong>ls -l</strong><br>
total 4040<br>
-rw-r--r-- 1 root root 3508824 Feb 7 12:54 mmfs26.ko<br>
-rw-r--r-- 1 root root 554336 Feb 7 12:54 mmfslinux.ko<br>
-rw-r--r-- 1 root root 68648 Feb 7 12:54 tracedev.ko
|
- 配置 GPFS(在 head 节点 i-8t7n6xp2 运行)
- 1.执行下述命令
1
| vi /root/.bashrc<br> export PATH=$PATH:/usr/lpp/mmfs/bin/
|
2.创建 nodes 文件 gpfs.nodefile
1
2
3
4
| vi gpfs.nodefile<br>
i-8t7n6xp2:quorum-manager<br>
i-oisebqqf:quorum-manager<br>
i-si5oq07a:quorum-manager
|
3.创建 GPFS cluster
我们可以使用 mmcrcluster 命令创建 GPFS cluster,如下所示,注意,一定要在防火墙中打开 22,1191 端口:
1
2
3
4
5
6
7
| [root@i-8t7n6xp2 ~]#<strong> /usr/lpp/mmfs/bin/mmcrcluster -N gpfs.nodefile -p
i-8t7n6xp2 -s i-oisebqqf -C GPFSdashDB -A -r /usr/bin/ssh -R /usr/bin/scp</strong><br>
mmcrcluster: Performing preliminary node verification ...<br>
... ...<br>
Use the mmchlicense command to designate licenses as needed.<br>
mmcrcluster: Propagating the cluster configuration data to all<br>
affected nodes. This is an asynchronous process.
|
我们可以使用 mmlscluster 命令查看创建的 GPFS 集群,如下所示:
1
2
3
4
5
6
7
8
| [root@i-8t7n6xp2 ~]#<strong>/usr/lpp/mmfs/bin/mmlscluster</strong><br>
GPFS cluster information<br>
... ...<br>
Node Daemon node name IP address Admin node name Designation<br>
-------------------------------------------------------------------<br>
1 i-8t7n6xp2 192.168.0.2 i-8t7n6xp2 quorum-manager<br>
2 i-oisebqqf 192.168.0.3 i-oisebqqf quorum-manager<br>
3 i-si5oq07a 192.168.0.4 i-si5oq07a quorum-manager<br>
|
4.为各个节点设置 license mode
1
2
3
4
5
6
7
8
9
| [root@i-8t7n6xp2 ~]# <strong>/usr/lpp/mmfs/bin/mmchlicense server --accept -N
i-8t7n6xp2</strong><br>
[root@i-8t7n6xp2 ~]# <strong>/usr/lpp/mmfs/bin/mmchlicense server --accept -N i-oisebqqf</strong><br>
[root@i-8t7n6xp2 ~]# <strong>/usr/lpp/mmfs/bin/mmchlicense server --accept -N i-si5oq07a</strong><br>
The following nodes will be designated as possessing server licenses:<br>
i-si5oq07a<br>
mmchlicense: Command successfully completed<br>
mmchlicense: Propagating the cluster configuration data to all<br>
affected nodes. This is an asynchronous process.
|
5.设置 Network Shared Disks (NSDs)
我们可以使用 fdisk -l 或 df -Th 命令查看需要创建 NSD 的磁盘设备,正如我们上边介绍的,本次示例中,我们已经在 Virtual SAN 中创建了/dev/sdc 设备,容量 200GB。
首先,我们需要创建 NSD 配置文件 gpfs.nsd,如下所示:
1
2
| vi gpfs.nsd<br>
%nsd: device=/dev/sdc nsd=mynsd usage=dataAndMetadata
|
接下来,我们通过执行 mmcrnsd 命令创建 NSD,如下所示:
1
2
3
4
| [root@i-8t7n6xp2 ~]# <strong>/usr/lpp/mmfs/bin/mmcrnsd -F gpfs.nsd -v no</strong><br>
mmcrnsd: Processing disk sdc<br>
mmcrnsd: Propagating the cluster configuration data to all<br>
affected nodes. This is an asynchronous process.
|
我们可以通过 mmlsnsd 命令查看创建的 NSD,如下所示:
1
2
3
4
| [root@i-8t7n6xp2 ~]# <strong>/usr/lpp/mmfs/bin/mmlsnsd -m</strong><br>
Disk name NSD volume ID Device Node name Remarks <br>
-------------------------------------------------------------------------<br>
mynsd C0A800025899B4B5 /dev/sdc i-8t7n6xp2 <br>
|
6.启动 GPFS cluster
1
| [root@i-8t7n6xp2 ~]#/usr/lpp/mmfs/bin/mmstartup -a
|
7.检查 GPFS cluster 状态,确认所有节点状态为 active
1
2
3
4
| echo ========================================================<br>
echo Check status of GPFS cluster peer domain<br>
echo ========================================================<br>
[root@i-8t7n6xp2~]#<strong>/usr/lpp/mmfs/bin/mmgetstate -a -L</strong>
|
8.创建 GPFS 文件系统
1
2
3
4
5
| [root@i-8t7n6xp2 ~]# <strong>/usr/lpp/mmfs/bin/mmcrfs clusterfs -F gpfs.nsd -A
yes -B 512k -T /mnt/clusterfs</strong><br><br> The following disks of clusterfs will be formatted on node i-8t7n6xp2:<br> mynsd: size
204800 MB<br> Formatting file system ...<br> ... ...<br> Completed creation of file system
/dev/clusterfs.<br> mmcrfs: Propagating the cluster configuration data to all<br> affected
nodes. This is an asynchronous process.
|
- 将 GPFS 文件系统挂接在所有节点上
1
2
3
4
5
6
7
| [root@i-8t7n6xp2 ~]# <strong>/usr/lpp/mmfs/bin/mmmount clusterfs /mnt/clusterfs
-N all</strong><br>
Tue Feb 7 19:55:24 CST 2017: mmmount: Mounting file systems ...<br>
i-8t7n6xp2: Warning: Permanently added 'i-8t7n6xp2,192.168.0.2' (ECDSA) to the list of known hosts.<br>
i-oisebqqf: Warning: Permanently added 'i-oisebqqf,192.168.0.3' (ECDSA) to the list of known hosts.<br>
i-si5oq07a: Warning: Permanently added 'i-si5oq07a,192.168.0.4' (ECDSA) to
the list of known hosts.
|
我们可以通过 mmlsmount 命令查看文件系统挂接状态
1
2
| [root@i-8t7n6xp2 ~]#<strong> /usr/lpp/mmfs/bin/mmlsmount all</strong><br>
File system clusterfs is mounted on 3 nodes.
|
1
2
| 关闭 GPFS 节点<br><strong>/usr/lpp/mmfs/bin/mmumount all -a</strong><br><strong>/usr/lpp/mmfs/bin/mmshutdown -a</strong><br>
启动 gpfs 节点<br><strong>/usr/lpp/mmfs/bin/mmstartup -a</strong><br><strong>/usr/lpp/mmfs/bin/mmgetstate -a -L</strong><br><strong>/usr/lpp/mmfs/bin/mmmount all -a</strong>
|
|
|
|
|
|
|