如何在hadoop中显示hdfs根目录?

时间:2017-10-11 13:36:13

标签: hadoop

我使用hadoop 2.8.1,根据一些参考(很多书和其他在线论坛)告诉我在哪里可以使用'hadoop fs -ls /'来查找hdfs文件系统根目录。但是当我键入该命令时,终端显示本地目录但不显示hdfs root。

这有什么问题,提前谢谢。

1 个答案:

答案 0 :(得分:2)

If you can execute hadoop version command and it returns correct information, it means that Hadoop was installed good.

I think there might be a problem with HDFS configuration. Try this:

  1. Locate core-site.xml file in your local file system. It should be located in /etc/hadoop/conf directory.
  2. Open core-site.xml file and locate this property:

    <property>
         <name>fs.defaultFS</name>
         <value>hdfs://<name-of-your-host>:8020</value>
         <final>true</final>
    </property>
    
  3. I suppose name parameter is wrong. You have to identify the address on which HDFS is running and update it in core-site.xml.