hadoop fs命令显示的是本地文件系统而不是hdfs

kr98yfug  于 2021-06-03  发布在  Hadoop
关注(0)|答案(3)|浏览(785)

我在几台笔记本电脑中安装了hadoop以形成hadoop集群。首先,我们以伪分布式模式安装,除了一个以外,其他所有的一切都是完美的(即,所有的服务都在运行,当我使用 hadoop fs 它显示了 hdfs ). 在后面提到的笔记本电脑(有问题的那台)中 ``hadoop fs -ls命令显示本地目录的信息,而不是hdfs,命令也是如此-cat,-mkdir,-put. 我会做错什么? 任何帮助都将不胜感激 这是我的core-site.xml` ```

gupuwyp2

gupuwyp21#

我也有同样的问题,我必须确保 fs.default.name 的值包含尾部 / 要引用路径组件:

<property>
 <name>fs.default.name</name>
 <value>hdfs://localhost:54310/</value>
 <description>.</description>
</property>
c7rzv4ha

c7rzv4ha2#

如果 fs.default.namecore-site.xml 指向 hdfs://localhost:54310/ 带或不带尾随 / 即使您有相同的问题,那么您可能会看到错误的配置文件。在我的例子中,它是cloudera的cdh4,请检查符号链接: ls -l /etc/hadoop/conf**/etc/hadoop/conf -> /etc/alternatives/hadoop-conf ls -l /etc/alternatives/hadoop-conf**/etc/alternatives/hadoop-conf -> /etc/hadoop/conf.cloudera.yarn1 之前我使用了mrv1并迁移到了mrv2(yarn),升级后sym链接被破坏为: ls -l /etc/hadoop/conf**/etc/hadoop/conf -> /etc/alternatives/hadoop-conf ls -l /etc/alternatives/hadoop-conf**/etc/alternatives/hadoop-conf -> /etc/hadoop/conf.cloudera.mapreduce1 ls -l /etc/hadoop/conf.cloudera.mapreduce1 ls: cannot access /etc/hadoop/conf.cloudera.mapreduce1: No such file or directory Also, update-alternatives was run to have high priority for /etc/hadoop/conf.cloudera.mapreduce1 path as: alternatives --display hadoop-conf hadoop-conf - status is manual. link currently points to /etc/hadoop/conf.cloudera.mapreduce1 /etc/hadoop/conf.cloudera.hdfs1 - priority 90 /etc/hadoop/conf.cloudera.mapreduce1 - priority 92 /etc/hadoop/conf.empty - priority 10 /etc/hadoop/conf.cloudera.yarn1 - priority 91 Current best' version is /etc/hadoop/conf.cloudera.mapreduce1. To remove old link which has highest priority do:update-alternatives --remove hadoop-conf /etc/hadoop/conf.cloudera.mapreduce1 rm -f /etc/alternatives/hadoop-conf ln -s /etc/hadoop/conf.cloudera.yarn1 /etc/alternatives/hadoop-conf`

yfwxisqw

yfwxisqw3#

检查一下 fs.default.namecore-site.xml 指向ex中的正确数据节点:

<property>
     <name>fs.default.name</name>
     <value>hdfs://target-namenode:54310</value>
</property>

相关问题