首页 > 其他 > 详细

rocketmq启动broker报错解决

时间:2021-04-14 10:12:39      阅读:22      评论:0      收藏:0      [点我收藏+]

nameserv启动成功

Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and wil

l likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a f
uture release.
Java HotSpot(TM) 64-Bit Server VM warning: MaxNewSize (262144k) is equal to or greater than the entire heap (262144k).
A new max generation size of 262080k will be used.
The Name Server boot success. serializeType=JSON

但是在启动broker的时候却报如下错误

09:52:26.079 [main] ERROR RocketmqCommon - Failed to obtain the host name

java.net.UnknownHostException: iZ2zeimcfkiefeubgwx3whZ: iZ2zeimcfkiefeubgwx3whZ: unknown error
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505) ~[na:1.8.0_65]
        at org.apache.rocketmq.common.BrokerConfig.localHostName(BrokerConfig.java:202) [rocketmq
        at org.apache.rocketmq.common.BrokerConfig.<init>(BrokerConfig.java:39) [rocketmq-common-4.2.0.jar:4.2.0]
        at org.apache.rocketmq.broker.BrokerStartup.createBrokerController(BrokerStartup.java:101) [rocketmq-broker-4.2.
0.jar:4.2.0]
        at org.apache.rocketmq.broker.BrokerStartup.main(BrokerStartup.java:56) [rocketmq-broker-4.2.0.jar:4.2.0]
Caused by: java.net.UnknownHostException: iZ2zeimcfkiefeubgwx3whZ: unknown error
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_65]
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[na:1.8.0_65]
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[na:1.8.0_65]
        at java.net.InetAddress.getLocalHost(InetAddress.java:1500) ~[na:1.8.0_65]
        ... 4 common frames omitted

解决办法如下:

 

这是由于启动的时候找不到自己的主机名对应的ip地址而造成的,只需要让在/etc/hosts中添加如上配置,就可以了。
————————————————
版权声明:本文为CSDN博主「zhx_5359」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zhx_5359/article/details/80748025

rocketmq启动broker报错解决

原文:https://www.cnblogs.com/zeenzhou/p/14656082.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!