官术网_书友最值得收藏!

Setting up Namenode metadata location

The most critical component of Hadoop is Namenode, and it is important to safeguard the information it stores. It stores metadata, which is a combination of namespace and inode structure.

All the steps are to be performed as the hadoop user. It is expected that the user has gone through Chapter 1, Hadoop Architecture and Deployment and understands the uses and function of Namenode.

Getting ready

You are going to need a preinstalled Hadoop as discussed in Chapter 1, Hadoop Architecture and Deployment. In the following recipes, we will configure the parameters for a copy of Hadoop that is already installed.

How to do it...

  1. ssh to the Namenode, which in this case is nn1.cluster1.com.
  2. Navigate to the /opt/cluster/hadoop/etc/hadoop directory. This is the directory where we installed Hadoop in the first chapter. If the user has installed it at a different location, then navigate to this directory.
  3. Configure the dfs.namenode.name.dir parameter, which defines the location where Namenode will persist its metadata.
  4. See the following screenshot for the contents of the file:
    How to do it...
  5. It is good practice to have the /data/namenode mount point on a different disk drive, rather than from a disk on which the OS is installed.
  6. In production, there will always be more than one directory to store the metadata, as shown in the following screenshot:
    How to do it...
  7. Once the changes are made, save the file and restart the namenode daemon.
  8. We need to format the Namenode so that all the directories listed are in sync and initialized.
  9. If the user already had a running cluster, then copy the contents across the directories and do not format the Namenode, as it will result in the loss of data.

How it works...

With steps 3 to 5, the user will be able to configure the Namenode metadata store location. Usually, in production, one of the common separated lists of directories is a cross mount from the NFS server. This is done to make sure that, if the Namenode server goes down, we can still access the data by quickly mounting it on another machine.

Please start the Datanode daemons on all nodes configured to run as Datanodes. If the Datanodes were initially connected to another Namenode, then the Datanode directories specified using dfs.datanode.data.dir must be cleaned.

主站蜘蛛池模板: 任丘市| 榆林市| 巩义市| 临沂市| 平凉市| 青州市| 邻水| 彩票| 报价| 洞头县| 道孚县| 筠连县| 广东省| 沂南县| 巨野县| 金溪县| 微山县| 怀远县| 五大连池市| 远安县| 东莞市| 怀集县| 越西县| 驻马店市| 沙洋县| 正蓝旗| 工布江达县| 淳化县| 会昌县| 博湖县| 德州市| 黄龙县| 颍上县| 达尔| 齐河县| 屏山县| 罗源县| 马关县| 新干县| 岚皋县| 扬中市|