Creating a new replicated file system

You can create a new replicated file system that adheres to the best practice.

Before you begin

  • To perform this task, you must be a Db2® cluster services administrator.

About this task

This task explains the two methods to create a new replicated file system that adheres to the following best practice:
  • A total of three redundancy groups.
  • Equal size in redundancy group 1 and 2.
A replicated file system with all three redundancy groups is typically created by a single command. However, there exists scenario where a "replication capable" file system needs to be set up first and completed later. For instance, the disks in the second storage controller are not ready or if the tiebreaker host is not set up, but there is a business need to have a "replication capable" file system up and running. The key difference between the two approaches is that the file system set-up by the single command (Method 1) is replication-ready at the completion of the creation command. All new data on the file system is replicated automatically across the redundancy groups. However, the file system that is created in multiple steps (Method 2) requires a follow-up step to replicate data that were put into the file system before the addition of the other two redundancy groups. Since the replication of data (and potentially rebalance of data) is considered I/O intensive operation, the performance of the file system during the replication and rebalance period will likely be impacted.
Figure 1. Single-site IBM Spectrum Scale replication topology
Single-site IBM Spectrum Scale replication topology
Figure 2. Multi-site IBM Spectrum Scale replication topology
Multi-site IBM Spectrum Scale replication topology

Procedure

Use one of the following methods to create a new replicated file system:
  • Method 1
    • Using figure 1 or 2 as illustration, run the following commands to create the three replicated file systems:
      db2cluster -cfs -create -filesystem db2sd_1 -disk /dev/hdisk1 -rdncy_grp_id 1 -disk /dev/hdisk4 -rdncy_grp_id 2 -fstiebreaker /dev/hdisk7 -host TB -mount /db2sd_1
      db2cluster -cfs -create -filesystem db2datafs -disk /dev/hdisk2 -rdncy_grp_id 1 -disk /dev/hdisk5 -rdncy_grp_id 2 -fstiebreaker /dev/hdisk8 -host TB -mount /db2datafs
      db2cluster -cfs -create -filesystem db2logfs -disk /dev/hdisk3 -rdncy_grp_id 1 -disk /dev/hdisk6 -rdncy_grp_id 2 -fstiebreaker /dev/hdisk9 -host TB -mount /db2logfs                                               
      Note: Host TB is used as the name for tiebreaker host for illustration purpose. It can be a member (M5) in figure 1.
  • Method 2
    1. Using File system db2datafs from figure 1, run the following commands to create a replicated file system:
      db2cluster -cfs -create -filesystem db2datafs -disk /dev/hdisk2 -rdncy_grp_id 1 -mount /db2datafs                                                
      At the end of this step, the file system is fully functional and mounted.
    2. When the storage for redundancy group 2 and tiebreaker host are ready, they can be added to the file system in a single or separate command. This is an online operation.
      db2cluster -cfs -add -filesystem db2datafs -disk /dev/hdisk5 -rdncy_grp_id 2 -fstiebreaker /dev/hdisk8 -host TB                                            
      At the end of this step, new data that is written to this file system is replicated properly. But existing data that was written to the file system before this step remains non-replicated. The replication of those data must be triggered manually. Replication of data can be I/O intensive and the duration depends on the size of data. Therefore, it is recommended to run them at off-peak usage hours.
    3. Initiate® the replication of existing data.
      db2cluster -cfs -replicate -filesystem db2datafs
      Depending on the data placement on each disk for each file system after the previous step, IBM Spectrum Scale might mark the file system as unbalanced and if a rebalance action is recommended. Db2 captures this warning from IBM Spectrum Scale and raises an alert that can be queried through the db2instance -list command. For more information, see Rebalancing a replicated file system.