A collection of common bugs in Hadoop

Source: Internet
Author: User
There are no special instructions below, and the environment is the Hadoop 2.2.0 under CentOS.
1. The following error occurred when executing the start-dfs.sh script in pseudo-distribution mode when launching HDFs:

VI Open libexec/hadoop-config.sh, find Java_home is not set and could isn't be found, find after in this line if [[-Z $JAVA _home]]; Then add the following statement to the front:
Export java_home=/usr/java/jdk1.7.0_45
Once saved, re-execute the start-dfs.sh script and execute JPS to see what you want to see Namenode, Datanode, etc.:


2. The following error occurred when executing the start-dfs.sh script to start Hadoop 0.20.2 HDFs:
Localhost:Error:JAVA_HOME is not set.
Localhost:Error:JAVA_HOME is not set.
VI Open conf/hadoop-env.sh, add the following statement:
Export java_home=/usr/java/jdk1.7.0_45

3. The following error occurred while uploading the local file to HDFs:
WARN HDFs. Dfsclient:datastreamer exception:org.apache.hadoop.ipc.remoteexception:java.io.ioexception:file/user/root/ INPUT01/FILE01 could only being replicated to 0 nodes, instead of 1
This is because there is no reason to add nodes, that is, you need to start Namenode, then start Datanode, and then automatically jobtracker and Tasktracker, as follows:
(1) Restart Namenode:
#hadoop-daemon.sh Start Namenode
(2) Restart Datanode
#hadoop-daemon.sh Start Datanode

------------------------------------------------The following is a problem with the Hadoop compilation runtime under the Eclipse Connection Linux under Windows----------------------------- -------------------
4. When Run on the Hadoop compiler, the following error occurred:
Exception in thread "main" Java.io.IOException:Cannot Run Program "chmod": CreateProcess error=2,?????????
The reason is that the Linux command cannot be executed, and the workaround is to install Cygwin and add the C:\cygwin64\bin path to the PATH environment variable.
It is important to note that at least the devel and shell packages need to be selected during the installation.

5. When Run on the Hadoop compiler, the following error occurred:
WARN mapred.  Jobclient:no job jar file set. User classes May is not found. See jobconf (Class) or Jobconf#setjar (String)
The reason is because Job.setjarbyclass uses the Xxx.class classloader to find the jar package that contains the class and then sets the jar package that the jar package uses for the job. However, our job jar package is packaged when the program is running, and the Xxx.class ClassLoader is Appclassloader, and we cannot change the search path after running, so using Setjarbyclass is unable to set the job jar package.
Place the jar package exported by this project under the project root and add the following settings before submitting the program:
Conf.set ("Mapred.jar", "Xxx.jar"); Where Xxx.jar is the jar file name you exported, note that the first parameter should not be spelled incorrectly.

6. When Run on the Hadoop compiler, the following error occurred:
Org.apache.hadoop.security.AccessControlException:org.apache.hadoop.security. Accesscontrolexception:permission denied:user=xxx, Access=write, inode= "Hadoop": hadoop:supergroup:rwxr-xr-x
Since eclipse uses the Hadoop plugin to submit jobs, it will default to XXX as the job to write to the HDFs file system, corresponding to the/user/xxx on HDFs, my/user/root, because XXX users do not have write access to the Hadoop directory, So the occurrence of the exception is caused. The workaround is to: Release the permissions for the Hadoop directory by two methods:
(1) Execute the following command
$ Hadoop fs-chmod 777/user/root
(2) Modifying the Hadoop configuration
Modify the configuration file for Hadoop: Conf/hdfs-core.xml, locate the configuration entry for dfs.permissions, and change the value to False, as follows:

Dfs.permissions
False

If "true", enable permission checking in HDFS.
If "false", permission checking is turned off, but all other behavior is unchanged.
Switching from one parameter value to the other does the mode, owner or group of files or directories.


After the modification, restart the Hadoop process to make it effective.
------------------------------------------------End------------------------------------------------

7. The MapReduce operation HBase appears with the following error:
Exception in thread "main" java.lang.noclassdeffounderror:org/apache/hadoop/hbase/hbaseconfiguration
Exception in thread "main" java.lang.noclassdeffounderror:org/apache/zookeeper/keeperexception
This is because Hadoop cannot find the appropriate jar package when calling the HBase package, and the solution is to copy the Zookeeper-3.3.2.jar package under the Hbase-0.90.4.jar and Lib directories under the HBase directory to hadoop/lib. Other such problems are similar.

8. The MapReduce operation HBase appears with the following error:
Org.apache.hadoop.hbase.TableNotFoundException:Cannot find row in. META. For table
This is because there is no table in HBase to insert the data into, manually creating the form in the HBase shell create ' xxx ', ' xxx '.

9, the MapReduce run job if the following error occurs:
Java.lang.RuntimeException:java.lang.ClassNotFoundException:
This is because Hadoop fails to find a class without looking in the jar and the solution is to delete all directories and files except the jar and. java files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.