请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

java.net.UnknownHostException: hadoop

An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.hadoop.security.authentication.util.KerberosUtil (file:/Users/andy/.m2/repository/org/apache/hadoop/hadoop-auth/2.6.0-cdh5.15.1/hadoop-auth-2.6.0-cdh5.15.1.jar) to method sun.security.krb5.Config.getInstance()
WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.security.authentication.util.KerberosUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread “main” java.lang.IllegalArgumentException: java.net.UnknownHostException: hadoop
at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:406)
at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:310)
at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:176)
at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:763)
at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:694)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:159)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2816)
at org.apache.hadoop.fs.FileSystem.access200(FileSystem.java:98)atorg.apache.hadoop.fs.FileSystem200(FileSystem.java:98) at org.apache.hadoop.fs.FileSystem200(FileSystem.java:98)atorg.apache.hadoop.fs.FileSystemCache.getInternal(FileSystem.java:2853)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2835)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:387)
at org.apache.hadoop.fs.FileSystem$1.run(FileSystem.java:176)
at org.apache.hadoop.fs.FileSystem$1.run(FileSystem.java:173)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1924)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:173)
at com.imooc.bigdata.hadoop.hdfs.HDFSApp.main(HDFSApp.java:19)
Caused by: java.net.UnknownHostException: hadoop

出现了这个报错,去etc/hosts 看了 配置的都是对的
192.168.1.121 hadoop000
127.0.0.1 localhost

正在回答 回答被采纳积分+3

2回答

黑狗1209 2021-06-15 20:42:45

同学问题解决了嘛,确定Linux配置没有问题。看下宿主机的hosts映射是否更改了。刚刚踩过的坑,已经解决。

0 回复 有任何疑惑可以回复我~
提问者 霸宋 2019-10-29 20:05:37

我 把 hadoop000改为ip地址192.168.1.121就可以了 。。很奇怪。。

0 回复 有任何疑惑可以回复我~
  • 你的hostname和IP映射的不对导致的
    回复 有任何疑惑可以回复我~ 2019-10-29 20:25:40
  • 很明显你的报错信息是不识别hadoop,也就是hadoop和ip映射有问题
    回复 有任何疑惑可以回复我~ 2019-10-29 20:26:24
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号