A Mount Table Configuration Example

本文介绍如何通过mountTable.xml文件配置Hadoop集群的存储系统,包括定义集群存储目录、设置链接路径及访问规则,实现高效的数据管理和访问。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Generally, users do not have to define mount tables or the core-site.xml to use the mount table. This is done by operations and the correct configuration is set on the right gateway machines as is done forcore-site.xml today.

The mount tables can be described in core-site.xml but it is better to use indirection incore-site.xml to reference a separate configuration file, say mountTable.xml. Add the following configuration element tocore-site.xml for referencing mountTable.xml:

<configuration xmlns:xi="http://www.w3.org/2001/XInclude"> 
  <xi:include href="mountTable.xml" />
</configuration> 

In the file mountTable.xml, there is a definition of the mount table "ClusterX" for the hypothetical cluster that is a federation of the three namespace volumes managed by the three namenodes

  1. nn1-clusterx.example.com:8020,
  2. nn2-clusterx.example.com:8020, and
  3. nn3-clusterx.example.com:8020.

Here /home and /tmp are in the namespace managed by namenode nn1-clusterx.example.com:8020, and projects/foo and /bar are hosted on the other namenodes of the federated cluster. The home directory base path is set to/home so that each user can access its home directory using the getHomeDirectory() method defined inFileSystem/FileContext.

<configuration>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.homedir</name>
    <value>/home</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./home</name>
    <value>hdfs://nn1-clusterx.example.com:8020/home</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./tmp</name>
    <value>hdfs://nn1-clusterx.example.com:8020/tmp</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./projects/foo</name>
    <value>hdfs://nn2-clusterx.example.com:8020/projects/foo</value>
  </property>
  <property>
    <name>fs.viewfs.mounttable.ClusterX.link./projects/bar</name>
    <value>hdfs://nn3-clusterx.example.com:8020/projects/bar</value>
  </property>
</configuration>

refer:http://hadoop.apache.org/docs/r2.4.0/hadoop-project-dist/hadoop-hdfs/ViewFs.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值