Error: -copyFromLocal: java.net.UnknownHostException - hadoop

I am new at Java, Hadoop etc.
I am having a problem when trying to copy a file to HDFS.
It says: "-copyFromLocal: java.net.UnknownHostException: quickstart.cloudera (...)"
How can I solve this? It is a exercise. You can see the problem in the imagem below.
Image with the problem
Image 2 with the error
Thank you very much.

As error says you need to supply the HDFS folder path as destination. So the code should be like:
hadoop fs -copyFromLocal words.txt /HDFS/Folder/Path
Almost all errors that you get while working in Hadoop are Java errors as MapReduce was mostly written in Java. But that doesnt mean there is some Java error in it.

Related

HADOOP Error: Could not find or load main class org.apache.hadoop.fs.FsShell

I'm building a wordcounter program and I want to create a working directory in the HDFS, but when I execute hdfs dfs -mkdir wordcount or other commands from hdfs dfs command list it returns me Error: Could not find or load main class org.apache.hadoop.fs.FsShell. Google have told me that maybe it is a problem with path variable, but i checked it and it's ok. Thank you!
The error means hadoop classpath command has issues, not PATH.
And you don't need HDFS to run or learn MapReduce / Spark WordCount code. It works fine on your local filesystem as well

Hadoop MapReduce :java.io.EOFException: Premature EOF: no length prefix available

when I try the Example: WordCount v1.0 from
http://hadoop.apache.org/docs/r2.7.4/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html#Example:_WordCount_v1.0
I got the warns and Exceptions blow:
And I found that when I put some .txt files to the HDFS. I also got the EOFException. Anyone know why ?
I didn't have write permission to the destination directory. Once I got the permission, it worked fine. Error was deceiving.

How do you transfer files onto the Hadoop FS (HDFS) on WIndows cmdline without Cygwin?

I have zero experience with Hadoop, but suddenly have to use it at work with Spark on Windows. My question, which has been asked a few times here, but I never could quite get the syntax for what I need, is this. I'm trying to transfer a simple file called:
gensortText.txt which let's say is at c:\gensortText.txt
I know you can use hadoop fs -copyFromLocal. I've tried these things:
hadoop fs -copyFromLocal C:\gensortText.txt hdfs://0.0.0.0:19000
ERROR: Relative path in absolute URI.
hadoop fs -copyFromLocal C:\gensortOutText.txt \tmp\hadoop-Administrator\dfs
ERROR: copyFromLocal: `tmphadoop-Administratordfs': No such file or directory
and a number of other variations with hdfs: and using the tmp directory which all returned similar errors.
I have hadoop in c:\deploy as suggested in the Hadoop2Windows guide (which works and allowed me to run Hadoop. I can access the WebGui and all that). Hadoop has created my new HDFS at c:\temp. Please someone help me figure out how to transfer files into the system. It can even be manually if that's possible, but that doesn't seem to work as it doesn't show up in the Web GUI when I go to "Utilities->Browse the Filesystem". Nothing shows up there actually.
Can someone please help. Any information that's relevant I can provide, but I'm so new to this I don't really know what would be helpful. I think it's just my syntax for the cmdline tool. Can someone give me a concrete example of how to use hadoop -fs copyFromLocal or another simple way to do this? Sorry for my ignorance on the subject, and thanks for any help
To be able to run hadoop commands on Windows you need to have winutils installed and visible to hadoop process.

org.apache.hadoop.mapred.InvalidInputException: Input path does not exist

I have set up Apache Nutch with single node of Hadoop. When I execute the crawl command it starts the crawling. However there is an exception throwing after few minutes.
cause:org.apache.hadoop.mapred.InvalidInputException: Input path does
not exist: (please refer to the image 1)
This is the invalid path according to the exception
hdfs://localhost:54310/user/duleendra/TestCrawl/segments/drwxrwxrwx/crawl_generate
Actually there is no such path in hdfs.
How does this drwxrwxrwx come ?
In hdfs I can see the following path
hdfs://localhost:54310/user/duleendra/TestCrawl/segments/20150506222506/crawl_generate
(please refer to the image 2 as well).
Have I missed anything?
Thanks
Duleendra
I believe this is a bug in Unix based systems like OSX and FreeBsd . Nutch's crawl will not work in them. Try ubuntu.

Issue with psuedo mode configuration of Hadoop

I am trying to do pseudo mode configuration of Hadoop 2.0.4 version. Script start-dfs.sh works fine. However, start-mapred.sh fails to start the jobtracker and tasktracker. Below is the error I am getting. Seeing at error it looks like it is not able to pick the jar file. Please let me know if you have any idea of this issue. Thanks.
FATAL org.apache.hadoop.mapred.JobTracker: java.lang.NoSuchMethodError: org/apache/hadoop/mapred/JobACLsManager.<init>(Lorg/apache/hadoop/mapred/JobConf;)V
at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:2182)
at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:1895)
at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:1889)
at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:311)
at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:302)
at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:297)
at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:4820)
It seems I was using incorrect jars. So, first I replaced those. Then, I just created a new directory with hadoop conf files. Formatted the namenode. Finally it worked. :)

Resources