Hadoop格式化namenode时出错 100
core-site.xml如下:<configuration><property><name>hadoop.tmp.dir</name><value>file:/usr/...
core-site.xml如下:<configuration><property> <name>hadoop.tmp.dir</name> <value>file:/usr/local/hadoop/tmp</value> </property> <property> <name>fs.defaultFS</name> <value>hdfs://localhost:9000</value> </property></configuration>Hdfs-site.xml如下:<configuration> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>file:/usr/local/hadoop/tmp/dfs/name</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>file:/usr/local/hadoop/tmp/dfs/data</value> </property> </configuration>格式化namenode时提示错误如下,
两个配置文件core-site.xml和Hdfs.xml分别如上所示。hadoop-env.sh和yarn-env.sh也已经配置过,不知道为什么报错。 展开
两个配置文件core-site.xml和Hdfs.xml分别如上所示。hadoop-env.sh和yarn-env.sh也已经配置过,不知道为什么报错。 展开
3个回答
展开全部
运行时遇到如下问题:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hdfs/server/namenode/NameNode
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hdfs.server.namenode.NameNode
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.hdfs.server.namenode.NameNode. Program will exit.
可修改 conf/hadoop-env.sh,增加
export HADOOP_COMMON_HOME=/usr/hadoop/ (hadoop的安装目录)
并且把JAVA_HOME配置好
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hdfs/server/namenode/NameNode
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hdfs.server.namenode.NameNode
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.hdfs.server.namenode.NameNode. Program will exit.
可修改 conf/hadoop-env.sh,增加
export HADOOP_COMMON_HOME=/usr/hadoop/ (hadoop的安装目录)
并且把JAVA_HOME配置好
追问
hadoop-env.s已经配置过了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询