G.4 Configuring an HDFS or Oracle NoSQL Database Disk

Complete the following instructions for any disk that is not used by the operating system. See "Identifying the Function of a Disk Drive".

To configure a disk, you must partition and format it.

Note:

Replace snp1 in the following commands with the appropriate symbolic name, such as s4p1.

To format a disk for use by HDFS or Oracle NoSQL Database:

  1. Complete the steps in "Replacing a Disk Drive", if you have not done so already.

  2. Partition the drive:

    # parted /dev/disk/by-hba-slot/sn -s mklabel gpt mkpart primary ext4 0% 100%
    
  3. Format the partition for an ext4 file system:

    # mkfs -t ext4 /dev/disk/by-hba-slot/snp1
    
  4. Reset the appropriate partition label to the missing device. See Table 13-2.

    # tune2fs -c -1 -i 0 -m 0.2 -L /unn /dev/disk/by-hba-slot/snp1
    

    For example, this command resets the label for /dev/disk/by-hba-slot/s2p1 to /u03:

    # tune2fs -c -1 -i 0 -m 0.2 -L /u03 /dev/disk/by-hba-slot/s2p1
    Setting maximal mount count to -1
    Setting interval between checks to 0 seconds
    Setting reserved blocks percentage to 0.2% (976073 blocks)
    
  5. Verify that the replaced disk is recognized by the operating system:

    $ ls -l /dev/disk/by-label
    total 0
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 BDAUSB -> ../../sdn1
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 BDAUSBBOOT -> ../../sdm1
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 SWAP-sda3 -> ../../sda3
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 SWAP-sdb3 -> ../../sdb3
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 u01 -> ../../sda4
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 u02 -> ../../sdb4
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 u03 -> ../../sdc1
    lrwxrwxrwx 1 root root 10 Aug  3 01:22 u04 -> ../../sdd1
         .
         .
         .
    
  6. If the output does not list the replaced disk:

    • On Linux 6, run udevadm trigger.

    Then repeat step 5. The lsscsi command should also report the correct order of the disks.

  7. Mount the HDFS partition, entering the appropriate mount point:

    # mount /unn
    

    For example, mount /u03.

  8. If you are configuring multiple drives, then repeat the previous steps.

  9. If you previously removed a mount point in Cloudera Manager for an HDFS drive, then restore it to the list.

    1. Open a browser window to Cloudera Manager. For example:

      http://bda1node03.example.com:7180

    2. Open Cloudera Manager and log in as admin.

    3. On the Services page, click hdfs.

    4. Click the Instances subtab.

    5. In the Host column, locate the server with the replaced disk. Then click the service in the Name column, such as datanode, to open its page.

    6. Click the Configuration subtab.

    7. If the mount point is missing from the Directory field, then add it to the list.

    8. Click Save Changes.

    9. From the Actions list, choose Restart.

  10. If you previously removed a mount point from NodeManager Local Directories, then also restore it to the list using Cloudera Manager.

    1. On the Services page, click Yarn.

    2. In the Status Summary, click NodeManager.

    3. From the list, click to select the NodeManager that is on the host with the failed disk.

    4. Click the Configuration sub-tab.

    5. If the mount point is missing from the NodeManager Local Directories field, then add it to the list.

    6. Click Save Changes.

    7. From the Actions list, choose Restart.

  11. Check the configuration. See "Verifying the Disk Configuration" .