Exercise #3: Using Replication

In this lab we will configure a file system for replication.

Objectives:

Requirements:

  1. Complete Exercise 1: Installing the cluster
  2. List of available devices

/dev/sd__
/dev/sd__
/dev/sd__
/dev/sd__

Step 1: Enabling Replication

 
  1. The max replication factor should have been set in Lab 1. Use the mmlsfs command to verify the file system is enabled for replication. A file system is enabled for replication when the maximum number of data and metadata replicas is set to 2.
  2. If these parameters are not set to 2 you will need to recreate the file system. To recreate the file system
    a. Umount the file system
    b. Delete the file system
    c. Create the file system and specify -M 2 and -R 2
    mmcrfs /gpfs fs1 -F pooldesc.txt -B 64k -M 2 -R 2

    Where pooldesc.txt is the disk descriptor file from Lab 1

 

Step 2: Change the failure group on the NSDs

 
  1. View the current failure group settings using the mmdf command
    mmlsdisk fs1

    The failure group should be set to a value of -1

  2. Change the failure group to 1 for nsd1 and nsd3 and to 2 for nsd2 and nsd4 using the mmchdisk command.
    mmchdisk fs1 change -d "nsd1:::dataAndMetadata:1:::"
    mmchdisk fs1 change -d "nsd2:::dataAndMetadata:2:::"
    mmchdisk fs1 change -d "nsd3:::dataOnly:1:::"
    mmchdisk fs1 change -d "nsd4:::dataOnly:2:::"
  3. Verify the changes using the mmdf command
    mmlsdisk fs1

    Notice that data was not written because the default replication level is still set to 1. Now that there are two failure groups you can see how to change the replication status of a file.

 

Step 3: Replicate a file

 

Replication status can bet set at the file level. In this step we will replicate the data and metadata of a single file in the file system.

  1. Create a file in the GPFS file system, /gpfs, called bigfile10
    dd if=/dev/zero of=/gpfs/fileset1/bigfile10 bs=64k count=1000
  2. Use the mmlsattr command to check the replication status of the file bigfile10
    # mmlsattr /gpfs/fileset1/bigfile10
    replication factors
    metadata(max) data(max) file [flags]
    ------------- --------- ---------------
    1 (  2)    1 (  2)   /gpfs/fileset1/bigfile10
  3. Change the file replication status of bigfile10 so that it is replicated in two failure groups using the mmchattr command.
    mmchattr -m 2 -r 2 /gpfs/fileset1/bigfile10

    Notice that this command take a few moments to execute, as you change the replication status of a file the data is copied before the command completes unless you use the "-I defer" option.

  4. Again use the mmlsattr command to check the replication status of the file bigfile10
    mmlsattr /gpfs/fileset1/bigfile10

    Did you see a change in the replication status of the file?

 

Step 4: Replicate all data in the file system

 

If desired you can replicate all of the data in the file system. In this step we will change the default replication status for the whole file system.

  1. Create a file in fileset1 called bigfile11
    dd if=/dev/zero of=/gpfs/fileset1/bigfile11 bs=64k count=1000
  2. Use the mmlsattr command to check the replication status of the file bigfile11
    mmlsattr /gpfs/fileset1/bigfile11
  3. Using the mmchfs command change the default replicaton status for fs1.
    mmchfs fs1 -m 2 -r 2
  4. Use the mmlsattr command to check the replication status of the file bigfile11
    mmlsattr /gpfs/fileset1/bigfile11

    Has the replication status of bigfile11 changed? _________________

  5. The replication status of a file does not change until mmrestripefs is run or a new file is created. To test this create a new file called bigfile12
    dd if=/dev/zero of=/gpfs/fileset1/bigfile12 bs=64k count=1000
  6. Use the mmlsattr command to check the replication status of the file bigfile10
    mmlsattr /gpfs/fileset1/bigfile12

    Is the file replicated?

  7. You can replicate the existing files in the file system using the mmrestripefs command
    mmrestripefs fs1 -R