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

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.

主站蜘蛛池模板: 乐至县| 永平县| 昌平区| 郯城县| 钟山县| 连城县| 宜宾市| 葫芦岛市| 大埔区| 文水县| 明星| 碌曲县| 安顺市| 巴彦淖尔市| 玛沁县| 文安县| 大丰市| 额敏县| 涞水县| 建始县| 广丰县| 尤溪县| 乡城县| 寿阳县| 梧州市| 运城市| 青州市| 佛教| 涡阳县| 双桥区| 闽侯县| 荣成市| 宜城市| 苍溪县| 四会市| 闵行区| 江北区| 郴州市| 迭部县| 玉龙| 营口市|