Friday, 22 March 2013

How to setup user managed GPFS cluster using db2cluster utility.


Question

1. How to setup GPFS cluster using db2cluster utility on your system.
2. How to clean the GPFS cluster manually from your system.

Answer

Creating a user managed GPFS cluster and FS using db2cluster command
  1. db2cluster -cfs -create -host <hostname1> -domain <domainname>
  2. db2cluster -cfs -add -host <hostname2> -domain <domainname>
  3. mmstartup -a
  4. db2cluster -cfs -create -filesystem <fsname> -disk <dev path> -mount <mount point>
  5. mmshutdown -a
  6. mmstartup -a
  7. Run ‘mount’ command on both the hosts in the cluster and check if the new filesystem is mounted on both machines.
    db2cluster -cfs -create -host Machine 1 -domain gpfsdomain
    db2cluster -cfs -add -host Machine 2 -domain gpfsdomain
    mmstartup -a
    db2cluster -cfs -create -filesystem gpfs1 -disk /dev/hdisk8 -mount /gpfs1
Manually cleaning a DB2 Managed Clustered File System and uninstalling GPFS
1. Unmount all GPFS file systems using the following command:
 /usr/lpp/mmfs/bin/mmumount all -a 
2. Ensure the GPFS cluster is online:
/usr/lpp/mmfs/bin/mmgetstate
      The output of this command should be similar to the following:
Node Number  Node Name    GPFS state
-----------   ----------     -----------
1        Machine 1      active
3. Find the available file system(s):
/usr/lpp/mmfs/bin/mmlsnsd
      The output of this command should be similar to the following:
File system   Disk name     NSD servers
-----------     ---------    -------------------
db2fs1         db2disk1    (directly attached)

4. Delete the file system:
/usr/lpp/mmfs/bin/mmdelfs db2fs1
    The output of this command should be similar to the following: All data on the following disks of db2fs1 will be destroyed: db2disk1 Completed deletion of file system /dev/db2fs1. mmdelfs: Propagating the cluster configuration data to all affected nodes: This is an asynchronous process.
5. Confirm that the file system has been deleted by rerunning the following command:
/usr/lpp/mmfs/bin/mmlsnsd
      The output of this command should be similar to the following:
File systemDisk nameNSD servers
​ ​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​- ​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​ ​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​ -​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​ ​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-​​​​-
(free disk)db2disk1(directly attached)
6. Stop the entire GPFS cluster:
/usr/lpp/mmfs/bin/mmshutdown -a
7. Unset tiebreaker disk if the quorum type is tiebreaker:
/usr/lpp/mmfs/bin/mmchconfig tiebreakerDisks=no 
8. Delete NSD:
/usr/lpp/mmfs/bin/mmdelnsd <disk name>
9. Verify the removal of NSD:
/usr/lpp/mmfs/bin/mmlsnsd
      The output of this command should be similar to the following:
      mmlsnsd: No disks were found.
10. Delete the GPFS cluster:
/usr/lpp/mmfs/bin/mmdelnode -a
      The output of this command should be similar to the following:
      Verifying GPFS is stopped on all affected nodes …
      mmdelnode: Propagating the cluster configuration data to all affected nodes.
    This is an asynchronous process. mmdelnode: Command successfully completed.
11. Ensure that the GPFS has been removed:
/usr/lpp/mmfs/bin/mmlscluster
      The output of this command should be similar to the following:
      mmlscluster: This node does not belong to a GPFS cluster.
    mmlscluster: Command failed. Examine previous error messages to determine cause.
12. Run the db2_deinstall -a command to uninstall the GPFS binaries along with DB2 SD and TSA binaries.

No comments:

Post a Comment