Associating a mounted remote file system with a Mutual Failover Db2 partition

You can associate a mount point for a mounted file system with a partition on your Pacemaker-managed Mutual Failover Db2 instance by using the Db2 Cluster Manager (db2cm) utility.

Before you begin

Important: In Db2® 11.5.8 and later, Mutual Failover high availability is supported when using Pacemaker as the integrated cluster manager. In Db2 11.5.6 and later, the Pacemaker cluster manager for automated fail-over to HADR standby databases is packaged and installed with Db2. In Db2 11.5.5, Pacemaker is included and available for production environments. In Db2 11.5.4, Pacemaker is included as a technology preview only, for development, test, and proof-of-concept environments.
Important: To run the db2cm utility as the root user, ensure the DB2INSTANCE environment variable is set to the instance owner.
The following prerequisites must be met before adding the mount point for the remote file system:
  • The mount target must not be one of system directories:
    • "/"
    • "/var"
    • "/tmp"
    • "/proc"
    • "/sys"
    • "/dev"
  • The mount target must have a noauto option.
  • The mount target must have a supported filesystem type. For more information, see Recommended file systems.

About this task

On UNIX, Linux®, and AIX® operating systems, mounting a file system means making that file system available to the operating system (OS). During a mount operation, the OS performs tasks such as reading indexes or navigation data structures, and associates a directory path with the mounted file system. This directory path is called a mount point, and you add the mount point to a partition on your Pacemaker-managed Mutual Failover Db2 instance, using db2cm.

The following placeholders are used in the command statements throughout this procedure. These represent values that you can change to suit your organization:
  • <host1> is the host name for the Mutual Failover host where the Db2 partition resides.
  • <mount_point> is the name of the mount point for the mounted remote file system.
  • <partition_number> is a unique number that identifies the database partition server in the Db2 Pacemaker cluster. For more information, see dbpartitionnum.
  • <instance_name> is the name of the Db2 instance.

Procedure

  1. As the root user, add the mount point to the remote file system to your Db2 partition:
    [root@<host1> ~]# sqllib/bin/db2cm -create -mount /<mount_point> -partition <partition_number> -instance <instance_name>
  2. As the root user, verify that the resource is created successfully:
    root@<host1> ~]# sqllib/bin/db2cm -list

    The newly mounted partition appears in the Cluster Status output as db2_<instance_name>_<partition_number>-mnt_<mount_point>.

Examples

The following example shows the command syntax and output from adding a mount point db2hamf2 to a partition (0) on the Db2 instance db2inst1:
[root@host1 ~]# sqllib/bin/db2cm -create -mount /db2hamf2 -partition 0 -instance
      db2inst
Mount /db2hamf2 on instance db2inst partition 0 created successfully.
The following example shows the command syntax and output from verifying the addition of the resource db2_db2inst_0-mnt_db2hamf2 to the Db2 partition:
[root@host1 ~]# sqllib/bin/db2cm -list
      Cluster Status

Domain information:
Domain name               = db2hamfCluster
Pacemaker version         = 2.1.2-4.db2pcmk.el8
Corosync version          = 3.1.6-2.db2pcmk.el8
Current domain leader     = host1
Number of nodes           = 2
Number of resources       = 5

Node information:
Name name           State
----------------    --------
host1      Online
host2      Online

Resource Information:

Resource Name             = db2_db2inst_0
  State                         = Online
  Managed                       = true
  Resource Type                 = Partition
  Instance                      = db2inst
  Partition                     = 0
  Current Host                  = host1

Resource Name             = db2_db2inst_0-instmnt_db2hamf
  State                         = Online
  Managed                       = true
  Resource Type                 = File System
  Device                        = "/dev/sda"
  Mount Point                   = "/db2hamf"
  File System Type              = ext3
  Mount Options                 = "rw,relatime"
  Current Host                  = host1

Resource Name             = db2_db2inst_0-mnt_db2hamf2
  State                         = Online
  Managed                       = true
  Resource Type                 = File System
  Device                        = "/dev/sdb"
  Mount Point                   = "/db2hamf2"
  File System Type              = ext3
  Mount Options                 = "acl,user_xattr,noauto"
  Current Host                  = host1

Resource Name             = db2_host1_eth0
  State                         = Online
  Managed                       = true
  Resource Type                 = Network Interface
    Node                        = host1
    Interface Name              = eth0

Resource Name             = db2_host2_eth0
  State                         = Online
  Managed                       = true
  Resource Type                 = Network Interface
    Node                        = host2
    Interface Name              = eth0