zookeeper启动初始化慢,请在 /etc/hosts 文件中追加:
127.0.0.1 hb07454
::1 hb07454
hb07454,换成自己的主机名。127.0.0.1 也可以配置成内网ip地址
原因分析
zookeeper启动会获取规格的主机名,并显示到控制台,其他中间件可能也会打印这个值。
可能是mac新系统对ip6 dns解析有阻塞问题,不是必现。
堆栈如下:
"main" #1 prio=5 os_prio=31 tid=0x00007f93ea808800 nid=0xf03 runnable [0x00007000044f7000]
java.lang.Thread.State: RUNNABLE
at java.net.Inet6AddressImpl.getHostByAddr(Native Method)
at java.net.InetAddress$2.getHostByAddr(InetAddress.java:933)
at java.net.InetAddress.getHostFromNameService(InetAddress.java:618)
at java.net.InetAddress.getCanonicalHostName(InetAddress.java:589)
留言