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:
-
Complete the steps in "Replacing a Disk Drive", if you have not done so already.
-
Partition the drive:
# parted /dev/disk/by-hba-slot/sn -s mklabel gpt mkpart primary ext4 0% 100%
-
Format the partition for an ext4 file system:
# mkfs -t ext4 /dev/disk/by-hba-slot/snp1
-
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)
-
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 . . .
-
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. -
-
Mount the HDFS partition, entering the appropriate mount point:
# mount /unn
For example,
mount /u03
. -
If you are configuring multiple drives, then repeat the previous steps.
-
If you previously removed a mount point in Cloudera Manager for an HDFS drive, then restore it to the list.
-
Open a browser window to Cloudera Manager. For example:
http://bda1node03.example.com:7180
-
Open Cloudera Manager and log in as
admin
. -
On the Services page, click hdfs.
-
Click the Instances subtab.
-
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.
-
Click the Configuration subtab.
-
If the mount point is missing from the Directory field, then add it to the list.
-
Click Save Changes.
-
From the Actions list, choose Restart.
-
-
If you previously removed a mount point from NodeManager Local Directories, then also restore it to the list using Cloudera Manager.
-
On the Services page, click Yarn.
-
In the Status Summary, click NodeManager.
-
From the list, click to select the NodeManager that is on the host with the failed disk.
-
Click the Configuration sub-tab.
-
If the mount point is missing from the NodeManager Local Directories field, then add it to the list.
-
Click Save Changes.
-
From the Actions list, choose Restart.
-
-
Check the configuration. See "Verifying the Disk Configuration" .