将HDFS挂载到本地目录失败 [英] Mounting of HDFS to local directory failing

查看:94
本文介绍了将HDFS挂载到本地目录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试将hdfs挂载到ubuntu机器上的本地目录中.我正在使用hadoop-fuse-dfs软件包.

I'm currently trying to implement mounting of hdfs to a local directory on ubuntu machine. I'm using hadoop-fuse-dfs package.

因此,我正在执行以下命令

So, I'm executing this below command

ubuntu@dev:~$ hadoop-fuse-dfs dfs://localhost:8020 /mnt/hdfs

输出

INFO/var/lib/jenkins/workspace/generic-package-ubuntu64-12-04/CDH4.5.0-Packaging-Hadoop-2013-11-20_14-31-53/hadoop-2.0.0+1518-1.cdh4.5.0.p0.24〜precise/src/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_options.c:164添加FUSE arg/mnt/hdfs

INFO /var/lib/jenkins/workspace/generic-package-ubuntu64-12-04/CDH4.5.0-Packaging-Hadoop-2013-11-20_14-31-53/hadoop-2.0.0+1518-1.cdh4.5.0.p0.24~precise/src/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_options.c:164 Adding FUSE arg /mnt/hdfs

但是,当我尝试在本地访问已挂载的hdfs时,会看到错误消息(请检查附带的快照)

But, when I try to access the mounted hdfs locally, I see the error message (please check the snapshot attached)

ls: cannot access /mnt/hdfs: No such file or directory
total 4.0K
d????????? ? ?      ?         ?            ? hdfs

PS:我已经执行了以下命令,但仍然得到相同的输出.

PS : I've already executed following commands, but still I get same output.

$ sudo adduser ubuntu fuse
$ sudo addgroup ubuntu fuse

我想念什么吗?请提出一些解决方法.

Am I missing something ? Please suggest some workaround.

推荐答案

您需要使用主机名而不是localhost.我遇到了同样的问题,将localhost更改为在hosts文件中也定义的主机名后,它得到了解决.

You need to use hostname instead of localhost. I faced the same issue, after changing localhost to hostname which is also defined in hosts file, it got fixed.

hadoop-fuse-dfs dfs://{hostname}:8020 /mnt/hdfs

根据 Cloudera

在HA部署中,使用HDFS名称服务而不是NameNode URI;也就是说,请使用hdfs-site.xml中的dfs.nameservices值.

In an HA deployment, use the HDFS nameservice instead of the NameNode URI; that is, use the value of dfs.nameservices in hdfs-site.xml.

这篇关于将HDFS挂载到本地目录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆