Disk configuration
Namenode
RAID1 is recommended for the namenode’s disks, to protect against corruption of its metadata.
DataNodes
- JBOD(No RAID) is recommended.
- One disk for the operation system specifically, others for Hadoop data storage.
- Partition looks like following.
- Partition the remaining Data Storage disks.
- Create Partition
fdisk /dev/sdb - Press
nto create a new partition. - One partition table for each disk. Using the
defaultin the remaining options. - Press
wto write table to disk. - Format the disk.
mkfs -t ext4 /dev/sdb1 - Repeat the above steps for other Data Storage Disk.
- Create Partition
- Mounting disk with
noatimeandnodiratime. As Hadoop (HDFS) manages the metadata (inode) of its filesystem with NameNode, any access time information kept by Hadoop is independent of the atimeattribute of individual blocks. So, the access timestamps in DataNode's local filesystem makes no sense here.- Create the mount points
mkdir -p /mnt/d0/data mkdir -p /mnt/d1/data - Appending the following rules to the file
/etc/fstab./dev/sdb1 /mnt/d0/data ext4 defaults,noatime,nodiratime 0 0 /dev/sdc1 /mnt/d1/data ext4 defaults,noatime,nodiratime 0 0 - Mounting the disk.
mount /dev/sdb1 mount /dev/sdc1
- Create the mount points
- Reduce the reserved blocks on the disks
Note: Do not reduce the reserved blocks on the disks hosting the operating system.tune2fs -m 1 /dev/sdb1 tune2fs -m 1 /dev/sdc1
Configure hdfs-site.xml
Note: assume the
ssh key has been distributed to the Datanodes- Creating folders to presist HDFS data
mkdir /mnt/d0/data/dfs mkdir /mnt/d1/data/dfs - Changing the owner to
hdfschown hdfs:hdfs -R /mnt/d0/data/dfs chown hdfs:hdfs -R /mnt/d1/data/dfs - Add the following property
hadoop@master1$ vi $HADOOP_HOME/conf/hdfs-site.xml <property> <name>dfs.datanode.data.dir</name> <value>/mnt/d0/data/dfs,/mnt/d1/data/dfs,...,/mnt/dn/data/dfs</value> </property> - Redo the previous step on all the Datanodes.
- Restarting
HDFS, onNamenodehost
Note: To do this step, it required thehdfs@namenode$ $HADOOP_HOME/bin/stop-dfs.sh hdfs@namenode$ $HADOOP_HOME/bin/start-dfs.shsshkey has been distributed across the Clusters.
Conigure mapred-site.xml
- Creating the folder for MapReuce to cache intermediate data.
mkdir /mnt/d0/data/mapred mkdir /mnt/d1/data/mapred - Changing the owner to
hdfschown mapred:hadoop -R /mnt/d0/data/mapred chown mapred:hadoop -R /mnt/d1/data/mapred - Add the following property
hadoop@master1$ vi $HADOOP_HOME/conf/hdfs-site.xml <property> <name>dfs.datanode.data.dir</name> <value>/mnt/d0/data/mapred,/mnt/d1/data/mapred,...,/mnt/dn/data/mapred</value> </property> - Redo the previous step on all the Datanodes.
- MapReduce restart.


沒有留言:
張貼留言