db2cm command reference for Mutual-Failover-configured clusters
You can use the Db2® cluster manager (db2cm) utility to configure and administer a Mutual Failover Db2 instance on a Pacemaker-managed Db2 Linux cluster.
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.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.
Attention: In Db2
11.5.8 and later, Pacemaker is available for Linux cluster management on both Amazon Web Services (AWS) and Microsoft Azure.
Command syntax
Command parameters
- -create
-
- -cluster
-
Creates a new Pacemaker cluster domain with two hosts and the public Ethernet resource from scratch. The following parameters are mandatory:
- -domain domainName
- Specifies the name of the Pacemaker domain
- -host hostName
- Specifies the name of the host. The hostname provided must be the short host name.
- -publicEthernet publicEthernetDeviceName
- Specifies the name of the public network adapter on the host specified in the previous argument.
Different device names can be used on the hosts. For example,
sqllib/bin/db2cm -create -cluster -domain MyPCSDomain -host host1 -publicEthernet eth0 -host host2 -publicEthernet eth2
- -aws
- Indicates that the specified resource will be configured for an Amazon Web
Services (AWS) cloud environment.
- -primaryVIP ipv4Address
- Associates an overlay IP address with the primary role on the partition or instance specified. Ensure that you complete all prerequisite steps before running this command.
- -fence
- Configures the AWS fencing agent for clusters on AWS.
- -profile profileName
- The ‘default’ AWS profile is used to make API calls to AWS if one is not specified in the profile.
- -rtb routingTableList
- A comma-delimited list of routing tables, where each list item is an AWS route table ID that is local to the VPC.
- -partition partitionName
- The name of the database partition on the cluster.
- -instance instanceName
- The name of the Db2 instance on the cluster.
- -azure
- Indicates that the specified resource will be configured for a Microsoft
Azure cloud environment.
- –primarylbl port –partition partitionNum –instance instanceName
- Associates an Azure load balancer health probe resource with a partition and instance. The port provided must be the health probe port of the Azure load balancer. Ensure you complete all prerequisite steps before running this command.
- -fence
- Configures the Azure fencing agent for clusters on Azure. Ensure you complete all prerequisite steps before running this command.
- -public Ethernet publicEthernetDeviceName -host hostName
- Add a public Ethernet resource to the resource model with the name of the public network adapter
on a host specified. Different device name can be used on different hosts. Each host can only have
one public Ethernet resource.For example,
sqllib/bin/db2cm -create -publicEthernet eth0 -host host1 - -partition partitionNum -instance instanceName
- Creates the partition resource and adds it to the resource model of the Db2 instance.
- -mount mountPoint -partition partitionNum -instance instanceName
- Mounts a datasource on the partition within the resource model of the Db2 instance.
- -primaryVIP ipv4Address [-netmask subnet-mask] -partition partitionNum -instance instanceName
- Associates the virtual IP address with the primary role of the instance and partition specified.
The default netmask is auto-detected. The VIP must be on the same IP subnet as the associated local
IP addresses on both hosts. The optional netmask parameter can be used to override the
auto-detection. The IP address must be in IPv4 format. The optional netmask input can be in either
the CIDR or the 32 bit format..For example,
sqllib/bin/db2cm -create -primaryVIP 170.120.1.1 -netmask 21 -db employeeDB -instance db2inst1 sqllib/bin/db2cm -create -primaryVIP 170.120.1.1 -netmask 255.255.248.0 -db employeeDB -instance db2inst1 - -qdevice quorumDeviceHostName
- Creates the quorum device for the corosync cluster.For example,
sqllib/bin/db2cm -create -qdevice hostQDevice
- -delete
-
- -aws
- Indicates that the specified resource to be removed is configured for an AWS cloud environment.
- -primaryVIP
- Deletes the IP address that is associated with the primary role on the partition or instance specified.
- -fence
- The AWS fencing configuration.
- -partition partitionName
- The name of the database partition on the cluster.
- -instance instanceName
- The name of the Db2 instance on the cluster.
- -enable
-
- -all
- Enables the automation for all Pacemaker resources of all Db2 instances in the Pacemaker domain. This option reverses the results of a disable -all operation.
- -partition partitionNum -instance instanceName
- Enables automation for the specified partition .All resources associated with the partition are
also enabled. For example,
db2cm -enable -partition 0 -instance db2inst1
- -disable
-
- -all
- Disables the automation for all Pacemaker resources of all Db2 instances in the Pacemaker domain.
- -partition partitionNum -instance instanceName
- Disables automation for the specified partition. All resources associated with the partition are also disabled.
- -list
- Display the cluster configuration and status information.For example,
sqllib/bin/db2cm -list - -dump
- Export cluster information pertaining to the local host to a compressed file in the local
directory. Use this for problem determination to collect data before contacting Db2 support. A
db2cm.zip file is created under the directory where the tool is run.For example,
sqllib/bin/db2cm -dump - -export
- Backup the cluster configuration to a file that can be used with the -import
option to quickly redeploy the cluster on the same set of hosts.For example,
For more information, see Backing-up cluster configuration information.sqllib/bin/db2cm -export /tmp/backup.conf - -import
- Restore the cluster configuration from a previously saved configuration generated by the
-export option.For example,
For more information, see Restore from a saved Pacemaker cluster configuration.sqllib/bin/db2cm -import /tmp/backup.conf - -copy_resources resourceAgentsPath -host hostName
- Copies resource agent scripts from the specified path to the resources path on the specified
host.For example,
sqllib/bin/db2cm -copy_resources /tmp/20220830_Db2MutualFailover_Pacemaker_Beta1/Db2AgentScripts/ -host host1 - -help
- Print usage information for db2cm.For example,
sqllib/bin/db2cm -help - -add -dbMount databaseName -partition partitionNum -instance instanceName
- Adds mount resources of a database to an existing Mutual Failover partition.
- -remove -dbMount databaseName -partition partitionNum -instance instanceName
- Removes mount resources of a database to an existing Mutual Failover partition.
- -move -partition partitionNum -instance instanceName -host hostName
- Moves a Mutual Failover partition from the current host to the other host.
- -set –option mountMonitoring mountPoint -value <yes|no> -partition partitionNum -instance instanceName
- Turns monitoring on or off for the specified database mount.
