Hadoop安装报错总结

下面为本人安装Hadoop报错的个人总结!!!
Hadoop版本:hadoop-3.1.0
官网:http://hadoop.apache.org/releases.html

报错:


 [root@server1 hadoop-3.1.0]# ./bin/hdfs namenode -format
 Exception in thread "main" java.lang.UnsupportedClassVersionError:
 org/apache/hadoop/hdfs/server/namenode/NameNode : Unsupported major.minor version 52.0
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:800)at
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
 at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

解决方法:

由于使用的版本要求 8 的版本之前使用的是 7 的版本,下载地址:
http://www.oracle.com/technetwork/java/javase/downloads/index.html(官网)
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (8 版本下载地址)

报错:


 [root@server1 hadoop-3.1.0]# ./sbin/start-dfs.sh
 Starting namenodes on [server1]
 ERROR: Attempting to operate on hdfs namenode as root
 ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.
 Starting datanodes
 ERROR: Attempting to operate on hdfs datanode as root
 ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.
 Starting secondary namenodes [server2]
 ERROR: Attempting to operate on hdfs secondarynamenode as root
 ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.
 2018-05-18 22:45:45,985 WARN util.NativeCodeLoader: Unable to load
 native-hadoop library for your platform... using builtin-java classes where applicable

解决方法:

 [root@server1 hadoop-3.1.0]# vim etc/hadoop/hadoop-env.sh
 export HDFS_NAMENODE_USER="root"
 export HDFS_DATANODE_USER="root"
 export HDFS_SECONDARYNAMENODE_USER="root"
 export YARN_RESOURCEMANAGER_USER="root"
 export YARN_NODEMANAGER_USER="root"

报错:


 [root@server1 hadoop-3.1.0]# ./sbin/start-yarn.sh
 Starting resourcemanager
 Starting nodemanagers
 localhost: ERROR: JAVA_HOME is not set and could not be found.

解决方法:

 [root@server1 hadoop-3.1.0]# vim etc/hadoop/hadoop-env.sh
 export JAVA_HOME=/usr/local/jdk1.8.0_171                    ###写对应的地址即可

你可能感兴趣的:(运维)