陈辉
作者陈辉·2012-11-11 21:37
研发工程师·IBM

DB2 pureScale 常用命令总结系列(一)GPFS命令

字数 9710阅读 7872评论 8赞 1
DB2 pureScale在原有DB2的基础上融入了新的部分,分别是(1)GPFS, (2)TSA, (3)CF, (4)uDAPL(IB),我把最近解决PMR过程中总结的相关命令记录了下来,准备写一个系列。每一部分写一篇,再加一篇DB2通用命令,共五篇。此为第一篇 GPFS。欢迎大家多提宝贵意见!

GPFS的命令一般在该目录下:/usr/lpp/mmfs/bin:
1.查看GPFS 集群状态
purescale141:/usr/lpp/mmfs/bin # ./mmlscluster

GPFS cluster information
========================
  GPFS cluster name:         db2cluster_20120710105156.site
  GPFS cluster id:           683261321688094924
  GPFS UID domain:           db2cluster_20120710105156.site
  Remote shell command:      /usr/bin/ssh
  Remote file copy command:  /usr/bin/scp

GPFS cluster configuration servers:
-----------------------------------
  Primary server:    purescale141.site
  Secondary server:  (none)

 Node  Daemon node name            IP address       Admin node name             Designation   
-----------------------------------------------------------------------------------------------
   1   purescale141.site           9.123.110.141    purescale141.site           quorum-manager
  
2.删除gpfs domain
purescale141:/usr/lpp/mmfs/bin # /db2/bin/db2cluster -cfs -delete -domain db2cluster_20120710105156.site


3.启动GPFS cluster
./db2cluster -cfs -start

4.查看cluster node情况
/usr/lpp/mmfs/bin:
mmlsnode

5.查看各个node的状态
/usr/lpp/mmfs/bin:
mmgetstate –a

6.增加节点
首先将suse2的sdb添加为GPFS的另一个node,命令如下:
suse1:/usr/lpp/mmfs/bin/ mmaddnode –N suse2:quorum-manager

/usr/lpp/mmfs/bin/mmaddnode -N purescale140:quorum-manager

7.修改集群设置
完成后将 suse2 注册成为Secondary Server,命令如下:
mmchcluster -s suse2.site


/usr/lpp/mmfs/bin/mmchcluster -s purescale140.site
//-s 代表设置为SecondaryServer???
Usage: mmchcluster {[-p PrimaryServer] [-s SecondaryServer]}
           or
       mmchcluster -p LATEST
           or
       mmchcluster {[-r RemoteShellCommand] [-R RemoteFileCopyCommand]}
           or
       mmchcluster -C ClusterName
      
      
      
8.解决license的问题
/db2/bin/db2cluster -cfs -add -license


9.关闭所有GPFS节点
mmshudown –a

10.启动所有GPFS节点
mmstartup -a

11.删除secondary节点
mmchcluster –s ""
mmchnode –N –nonquorum suse2.site
mmdelnode suse2.site

12.强制删除primay节点
mmdelnode -f

13.查看GPFS节点与状态命令
suse1:/usr/lpp/mmfs/bin/下mmlscluster
mmlsnode
mmgetstate –a


14.确认GPFS的安装情况,已有版本,和安装文件中的新版本
root@coralpib269:/devinst/db2_v98fp5/aix64/s120605/ese_dsf/db2/aix/gpfs> db2ckgpfs -v install
3.3.0.14

root@coralpib269:/devinst/db2_v98fp5/aix64/s120605/ese_dsf/db2/aix/gpfs> db2ckgpfs -v media
3.4.0.13

15.把GPFS的资源设为维护模式(maintenance mode)
在任一台主机运行如下命令:
-----------------------------------------------------------------------------------------
DB2DIR/bin/db2cluster -cfs -enter -maintenance -all

只需做一遍
root@coralpib269:/opt/IBM/db2/V9.8_SB28978/bin> db2cluster -cfs -enter -maintenance -all
The shared file system has sucessfully entered maintenance mode.

如果GPFS的资源被置为维护模式,则安装完成后需要将模式还原为正常状态。在运行下面的命令之前,需要保证SA MP的资源已经还原为正常模式,在集群中任一台主机,运行如下命令:
DB2DIR/bin/db2cluster -cfs -exit -maintenance -all

root@coralpib269:/opt/IBM/db2/V9.8fp5/bin> db2cluster -cfs -exit -maintenance -all
The shared file system successfully exited from maintenance mode.

16.提交对GPFS的更改
DB2集群管理员必须提交对DB2集群的更改操作,并使他们生效。在任意一台主机,运行如下命令:
DB2DIR/bin/db2cluster -cfs -commit
cd /opt/IBM/db2/V9.8fp5/bin
root@coralpib269:/opt/IBM/db2/V9.8fp5/bin> db2cluster -cfs -commit
The shared file system cluster has been successfully updated to version '3.4.0.13'.

17.正常卸载GPFS
    Manually cleaning a DB2 managed clustered file system
    This topic guides you through the required steps to manually clean a DB2? managed clustered file system.
   
    About this task:
    Using the db2idrop -g command to remove the DB2 pureScale? Feature from your environment removes the GPFS? cluster on all hosts
    except for the host on which the db2idrop command was run.
    Use this procedure to remove the GPFS file system and cluster on the remaining host.
    All data on the GPFS file system will be lost.
    After the db2idrop command has completed, the GPFS cluster will be left over on installation-initiating host (IIH) only.
    Manual clean up is only required on the host acting as the IIH.

Procedure

    --17.1 List existing GPFS file systems using the following command:
                -DB2DIR/bin/db2cluster -cfs -list -filesystem
                 
                 where DB2DIR represents the installation location of your DB2 copy.
                 The output of this command should be similar to the following:
                 
                 FILE SYSTEM NAME    MOUNT_POINT
                 ----------------    -----------
                 db2fs1            /db2sd_20091027220651

    --17.2 Stop the entire GPFS cluster:
                -db2cluster -cfs -stop -all

    --17.3 Set the GPFS quorum type from tiebreaker to majority:
                -db2cluster -cfs -set -tiebreaker -majority

    --17.4 Start the GPFS cluster:
                -db2cluster -cfs -start -all

    --17.5 To ensure there is no data on the file system before deleting it, mount the file system:
                -mount  /db2sd_20091027220651

    --17.6 Delete the GPFS file system:
                -db2cluster -cfs -delete -filesystem db2fs1

                The output of this command should be similar to the following:
                The file system 'db2fs1' has been successfully deleted.
                All cluster configurations have been completed successfully.

    --17.7 List the GPFS domain name:
                -db2cluster -cfs -list -domain

                 The output of this command should be similar to the following:
                 Domain Name: db2cluster_20091027220622.ca.ibm.com

    --17.8 Stop the GPFS cluster:
                -db2cluster -cfs -stop -all

    --17.9 Delete the GPFS cluster:
                -db2cluster -cfs -delete -domain db2cluster_20091027220622.ca.ibm.com
                 
                 The output of this command should be similar to the following:
                 Deleting the domain db2cluster_20091027220622.in.ibm.com from
                 the cluster was successful.

    --17.10 After removing GPFS cluster and file systems, delete the GPFS_CLUSTER and DEFAULT_INSTPROF variable records in the Global Registry.
                -db2greg -delvarrec service=GPFS_CLUSTER,variable=NAME,installpath=-
                -db2greg -delvarrec service=DEFAULT_INSTPROF,variable=DEFAULT,installpath=-

18. 强力卸载GPFS
  --18.1 tiebreaker
                -db2cluster -cfs -set -tiebreaker -majority
    --18.2 unmount
    --18.3 del fs
                -db2cluster -cfs -delete -filesystem db2fs1
                -//该命令中会检查fs中是否存在文件,所以之前要mount一下。
    --18.4 delete domain
                -db2cluster -cfs -delete -domain db2cluster_20091027220622.ca.ibm.com

(GPFS发现了新的命令,我会随时更新)

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

1

添加新评论8 条评论

mephistomephisto存储架构师VMware
2022-09-30 17:03
谢谢楼主分享
cwhcwh数据库管理员cwh
2016-02-25 13:58
tkanks
infosphereinfosphere软件实施顾问keyvalues
2014-12-10 21:56
赞!
ly3721ly3721数据库管理员旅游
2014-12-10 17:27
大神请问我在虚拟机redhat6.5上装db2 purescale,GPFS建立后输入mmgetstate –a 第二台机子状态永远是arbitration,无论用任何办法都会这样,请大神赐教该如何把arbitration的状态变成active,谢谢
taian_8011taian_8011软件开发工程师ibm
2013-05-12 15:42
这个是系统层面的还是db层的命令??
uc804uc804数据库运维工程师企业
2013-01-25 10:58
verygood
freebilefreebile数据库运维工程师金融行业
2012-12-31 15:50
thanks
zhmwangzhmwangPDOceanBase
2012-11-25 08:31
Very good, Thank you
Ctrl+Enter 发表

作者其他文章

X社区推广