Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 8467  / 2 Years ago, fri, august 5, 2022, 11:11:57

i have some java systems that i want to use hadoop in with it, but whenever i connect to localhost with this command



hadoop fs -ls /


it will always prompt that



java.net.UnknownHostException: local.localdomain: diginiqlinux.localdomain
at java.net.InetAddress.getLocalHost(InetAddress.java:1466)


edit



here is my //etc/hosts



127.0.0.1 localhost


full trace log



[root@diginiqlinux ~]# hadoop fs -ls
13/12/30 16:44:36 INFO metrics.MetricsUtil: Unable to obtain hostName
java.net.UnknownHostException: diginiqlinux.localdomain: diginiqlinux.localdomai n
at java.net.InetAddress.getLocalHost(InetAddress.java:1466)
at org.apache.hadoop.metrics.MetricsUtil.getHostName(MetricsUtil.java:91 )
at org.apache.hadoop.metrics.MetricsUtil.createRecord(MetricsUtil.java:8 0)
at org.apache.hadoop.security.UserGroupInformation$UgiMetrics.<init>(Use rGroupInformation.java:102)
at org.apache.hadoop.security.UserGroupInformation.<clinit>(UserGroupInf ormation.java:208)
at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:1757 )
at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:1750 )
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1618)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:255)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:124)
at org.apache.hadoop.fs.FsShell.init(FsShell.java:86)
at org.apache.hadoop.fs.FsShell.run(FsShell.java:1813)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at org.apache.hadoop.fs.FsShell.main(FsShell.java:1974)
Caused by: java.net.UnknownHostException: diginiqlinux.localdomain
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:128 6)
at java.net.InetAddress.getLocalHost(InetAddress.java:1462)
... 14 more
ls: Cannot access .: No such file or directory.


any solution how to connect localhost?


More From » localhost

 Answers
3

Add entry 127.0.0.1 for localhost in /etc/hosts file.



127.0.0.1 localhost

[#27759] Saturday, August 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
utilitere

Total Points: 394
Total Questions: 110
Total Answers: 114

Location: Solomon Islands
Member since Wed, Mar 29, 2023
1 Year ago
;