通过NFSv3挂载HDFS到本地目录 -- 2安装配置hdfs-nfs网关
4. 透过NFS访问hdfs
最重要的参考文档是这篇,来自官方
http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html
当然里面有坑,两个:
一个是需要停止系统的portmap/rpcbind服务,(也就是说,hdfs-nfs自己实现pormap和nfs server的功能)
另一个是启动Gateway服务服务的时候,要切换到相应的用户。
4.1 虚拟机环境
ip地址 为 172.30.0.129, 机器名 ip-172-30-0-129,其他未变
4.2 HDFS安装
显然,得首先安装HDFS 系统,目前HDFS 已经深度集成到 Hadoop 中了,所以,也就是安装 Hadoop (略)。
4.3 配置core-site.xml文件
在 etc/hadoop/core-site.xml 中添加以下两个节, 样板如下:
(说明: 用在你的集群中启动Gateway服务的用户名代替“nfsserver”)
<property>
<name>hadoop.proxyuser.nfsserver.groups</name>
<value>root,users-group1,users-group2</value>
<description>
The 'nfsserver' user is allowed to proxy all members of the 'users-group1' and
'users-group2' groups. Note that in most cases you will need to include the
group "root" because the user "root" (which usually belonges to "root" group) will
generally be the user that initially executes the mount on the NFS client system.
Set this to '*' to allow nfsserver user to proxy any group.
</description>
</property>
<property>
<name>hadoop.proxyuser.nfsserver.hosts</name>
<value>nfs-client-host1.com</value>
<description>
This is the host where the nfs gateway is running. Set this to '*' to allow
requests from any hosts to be proxied.
</description>
</property>
因此,我的配置文件 添加 如下:
<property>
<name>hadoop.proxyuser.nfsguest.groups</name>
<value>root,nfs-group</value>
</property>
<property>
<name>hadoop.proxyuser.nfsguest.hosts</name>
<value>ip-172-30-0-129</value>
</property>
代理用户是nfsguest,nfs组的名字是 nfs-group
4.3.1 先行配置
a. 机器名
在/etc/hosts 中添加

本文详细介绍了如何通过NFSv3将HDFS挂载到本地目录,包括安装配置HDFS-NFS网关、设置HDFS的core-site.xml和hdfs-site.xml文件、配置NFS代理用户和组、启动和验证服务,以及最终的挂载步骤。主要涉及Linux、HDFS、NFS和系统配置。
最低0.47元/天 解锁文章
758

被折叠的 条评论
为什么被折叠?



