报错详情:Caused by: java.net.UnknownHostException: ecs-4482-0002.novalocal: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1295)
at java.net.InetAddress.getLocalHost(InetAddress.java:1471)
... 38 more
问题原因:
解决方法:
首先在Linux命令行中查看hostname
[root@yun_app bin]# hostname
yun_app
在/etc/hosts中添加一行
127.0.0.1 yun_app
再用下列命令查看,出来结果即正确
[root@yun_app bin]# hostname -i
127.0.0.1
网友评论