为什么hadoop无法找到RackAareness类?

时间:2019-10-08 02:50:22

标签: java hadoop

我已经在core-site.xml中配置了net.topology.node.switch.mapping.impl属性。class的值为com.learning.rackawareness.RackAwareness。我已经将该类打包为jar并将其放在/opt/modules/hadoop-2.7.2/share/hadoop/common/lib的hadoop路径中。

然后我使用start-dfs.sh,Namenode失败。

我应该在哪里放罐子?

  

java.lang.RuntimeException:java.lang.RuntimeException:java.lang.ClassNotFoundException:找不到类com.learning.rackawareness.RackAwareness       在org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2227)       在org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager。(DatanodeManager.java:208)       在org.apache.hadoop.hdfs.server.blockmanagement.BlockManager。(BlockManager.java:268)       在org.apache.hadoop.hdfs.server.namenode.FSNamesystem。(FSNamesystem.java:737)       在org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.initialize(SecondaryNameNode.java:246)       在org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode(SecondaryNameNode.java:192)       在org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.main(SecondaryNameNode.java:671)   引起原因:java.lang.RuntimeException:java.lang.ClassNotFoundException:类> com.learning.rackawareness.RackAwareness未找到       在org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2195)       在org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2219)       ...另外6个   造成原因:java.lang.ClassNotFoundException:类> com.learning.rackawareness.RackAwareness未找到       在org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2101)       在org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2193)       ...另外7个   2019-10-07 15:23:41,958 INFO org.apache.hadoop.hdfs.server.namenode.FSNamesystem:停止针对活动状态启动的服务   2019-10-07 15:23:41,970信息org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode:SHUTDOWN_MSG:

0 个答案:

没有答案