English 中文(简体)
Hadoop dfs -ls returns list of files in my hadoop/ dir
原标题:
  • 时间:2010-03-06 19:44:23
  •  标签:
  • hadoop
  • hdfs

I ve set up a sigle-node Hadoop configuration running via cygwin under Win7. After starting Hadoop by

bin/start-all.sh
I run
bin/hadoop dfs -ls
which returns me a list of files in my hadoop directory. Then I run
bin/hadoop datanode -format
bin/hadoop namenode -format
but -ls still returns me the contents of my hadoop directory. As far as I understand it should return nothing(empty folder). What am I doing wrong?
问题回答

Did you edit the core-site.xml and mapred-site.xml under conf folder ? It seems like your hadoop cluster is in local mode.

I know this question is quite old, but directory structure in Hadoop has changed a bit (version 2.5 ) Jeroen s current version would be.

hdfs dfs -ls hdfs://localhost:9000/users/smalldata

Also Just for information - use of start-all.sh and stop-all.sh has been deprecated, instead one should use start-dfs.sh and start-yarn.sh

I had the same problem and solved it by explicitly specifying the URL to the NameNode.

To list all directories in the root of your hdfs space do the following:

./bin/hadoop dfs -ls hdfs://<ip-of-your-server>:9000/

The documentation says something about a default hdfs point in the configuration, but I cannot find it. If someone knows what they mean please enlighten us.

This is where I got the info: http://hadoop.apache.org/common/docs/r0.20.0/hdfs_shell.html#Overview

Or you could just do:

  • Run stop-all.sh.
  • Remove dfs data and name directories
  • Namenode -format
  • Run start-all.sh




相关问题
Hadoop - namenode is not starting up

I am trying to run hadoop as a root user, i executed namenode format command hadoop namenode -format when the Hadoop file system is running. After this, when i try to start the name node server, it ...

What default reducers are available in Elastic MapReduce?

I hope I m asking this in the right way. I m learning my way around Elastic MapReduce and I ve seen numerous references to the "Aggregate" reducer that can be used with "Streaming" job flows. In ...

Establishing Eclipse project environment for HadoopDB

I have checked-out a project from SourceForge named HadoopDB. It uses some class in another project named Hive. I have used Eclipse Java build path setting to link source to the Hive project root ...

Hadoop: intervals and JOIN

I m very new to Hadoop and I m currently trying to join two sources of data where the key is an interval (say [date-begin/date-end]). For example: input1: 20091001-20091002 A 20091011-20091104 ...

hadoop- determine if a file is being written to

Is there a way to determine if a file in hadoop is being written to? eg- I have a process that puts logs into hdfs. I have another process that monitors for the existence of new logs in hdfs, but I ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...

热门标签