我在RocketMQ和Tair里面都遇到这个问题就是找不到主机,IP 可是hostname命令正常,hosts文件都改了
本地网卡信息:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1308 (1.2 KiB) TX bytes:1308 (1.2 KiB)
wlan0 Link encap:Ethernet HWaddr 24:0A:64:2B:3F:43
inet addr:192.168.1.107 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::260a:64ff:fe2b:3f43/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:130083 errors:0 dropped:0 overruns:0 frame:0
TX packets:87555 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:176934698 (168.7 MiB) TX bytes:8626995 (8.2 MiB)
RocketMQ中nohup.out文件内容:
java.lang.ExceptionInInitializerError
at com.alibaba.rocketmq.namesrv.NamesrvStartup.main0(NamesrvStartup.java:125)
at com.alibaba.rocketmq.namesrv.NamesrvStartup.main(NamesrvStartup.java:70)
Caused by: java.lang.RuntimeException: InetAddress java.net.InetAddress.getLocalHost() throws UnknownHostException
at com.alibaba.rocketmq.common.MixAll.localhost(MixAll.java:458)
at com.alibaba.rocketmq.common.MixAll.<clinit>(MixAll.java:82)
... 2 more
Caused by: java.net.UnknownHostException: bajinshengPC2: bajinshengPC2: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1475)
at com.alibaba.rocketmq.common.MixAll.localhost(MixAll.java:454)
... 3 more
Caused by: java.net.UnknownHostException: bajinshengPC2: 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)
... 4 more
java.lang.ExceptionInInitializerError
at com.alibaba.rocketmq.namesrv.NamesrvStartup.main0(NamesrvStartup.java:125)
at com.alibaba.rocketmq.namesrv.NamesrvStartup.main(NamesrvStartup.java:70)
Caused by: java.lang.RuntimeException: InetAddress java.net.InetAddress.getLocalHost() throws UnknownHostException
at com.alibaba.rocketmq.common.MixAll.localhost(MixAll.java:458)
at com.alibaba.rocketmq.common.MixAll.<clinit>(MixAll.java:82)
... 2 more
Caused by: java.net.UnknownHostException: bajinshengPC2: bajinshengPC2: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1475)
at com.alibaba.rocketmq.common.MixAll.localhost(MixAll.java:454)
... 3 more
Caused by: java.net.UnknownHostException: bajinshengPC2: 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)
... 4 more
java.lang.ExceptionInInitializerError
at com.alibaba.rocketmq.namesrv.NamesrvStartup.main0(NamesrvStartup.java:125)
at com.alibaba.rocketmq.namesrv.NamesrvStartup.main(NamesrvStartup.java:70)
Caused by: java.lang.RuntimeException: InetAddress java.net.InetAddress.getLocalHost() throws UnknownHostException
at com.alibaba.rocketmq.common.MixAll.localhost(MixAll.java:458)
at com.alibaba.rocketmq.common.MixAll.<clinit>(MixAll.java:82)
... 2 more
Caused by: java.net.UnknownHostException: rocketmq-master: rocketmq-master: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1475)
at com.alibaba.rocketmq.common.MixAll.localhost(MixAll.java:454)
... 3 more
Caused by: java.net.UnknownHostException: rocketmq-master: 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)
... 4 more
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。