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

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.

主站蜘蛛池模板: 聂拉木县| 五峰| 崇阳县| 金堂县| 汉寿县| 舒兰市| 安庆市| 石渠县| 清苑县| 南溪县| 逊克县| 双峰县| 东乌| 新巴尔虎左旗| 南和县| 彭山县| 定州市| 陵川县| 日照市| 格尔木市| 常德市| 吉安市| 楚雄市| 观塘区| 屏山县| 莱州市| 宜良县| 翁牛特旗| 台安县| 黑水县| 桓仁| 井研县| 苗栗县| 大同市| 施秉县| 贞丰县| 贵定县| 崇明县| 抚远县| 大关县| 石台县|