Home  >  Article  >  Database  >  HDFS NFS网关操作实战

HDFS NFS网关操作实战

WBOY
WBOYOriginal
2016-06-07 16:41:161398browse

续上一篇译文,集群运行在test[1-4],设置nfsserver的用户组是root,host为test1(同namenode)。版本为CDH5.2.1(Hadoop 2.5.0)。 vim /etc/hadoop/conf/core-site.xmlproperty namehadoop.proxyuser.root.groups/name valueroot/value/propertyproperty name

续上一篇译文,集群运行在test[1-4],设置nfsserver的用户组是root,host为test1(同namenode)。版本为CDH5.2.1(Hadoop 2.5.0)。

vim /etc/hadoop/conf/core-site.xml
<property>
  <name>hadoop.proxyuser.root.groups</name>
  <value>root</value>
</property>
<property>
  <name>hadoop.proxyuser.root.hosts</name>
  <value>test1</value>
</property>
#只允许所有用户只读:
<property>
  <name>nfs.exports.allowed.hosts</name>
  <value>* ro</value>
</property>
#停止原生的服务
service nfs stop
service rpcbind stop
#启动NFS服务
nohup hdfs portmap &
...
14/12/24 09:45:13 INFO portmap.Portmap: Portmap server started at tcp:///0.0.0.0:111, udp:///0.0.0.0:111
su - hdfs
hdfs nfs3
#查看服务状态
rpcinfo -p test1
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100005    1   udp   4242  mountd
    100005    2   udp   4242  mountd
    100005    3   udp   4242  mountd
    100005    1   tcp   4242  mountd
    100005    2   tcp   4242  mountd
    100005    3   tcp   4242  mountd
    100003    3   tcp   2049  nfs
#查看export目录
showmount -e test1
Export list for test1:
/ *
#挂载目录
mkdir /mnt/hdfs
mount.nfs test1:/ /mnt/hdfs -o nolock
hdfs dfs -appendToFile - /user/hive/hello.txt
hello
cat /mnt/hdfs/user/hive/hello.txt
hello
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn