开发者社区> 问答> 正文

hostname问题

我在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

展开
收起
纸房子 2016-06-11 17:22:32 6238 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载