为何无法启动zookeeper客户端脚本,报错如下?

诠释这低调 发布于 2016/04/29 22:08
阅读 1K+
收藏 0
[root@novalocal tomcat8]# cd ../
[root@novalocal local]# cd zookeeper/bin/
[root@novalocal bin]# ./zkCli.sh -server zookeeper:2181
Connecting to zookeeper:2181
2016-04-29 22:05:42,365 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT
2016-04-29 22:05:42,369 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=novalocal
2016-04-29 22:05:42,369 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.8.0_77
2016-04-29 22:05:42,371 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2016-04-29 22:05:42,371 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/usr/local/java/jdk1.8.0_77/jre
2016-04-29 22:05:42,371 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/usr/local/zookeeper/bin/../build/classes:/usr/local/zookeeper/bin/../build/lib/*.jar:/usr/local/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/bin/../zookeeper-3.4.6.jar:/usr/local/zookeeper/bin/../src/java/lib/*.jar:/usr/local/zookeeper/bin/../conf:.:/usr/local/java/jdk1.8.0_77/lib/dt.jar:/usr/local/java/jdk1.8.0_77/lib/tools.jar:/usr/local/java/jdk1.8.0_77/jre/lib
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=<NA>
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=3.10.0-229.14.1.el7.x86_64
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=root
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/root
2016-04-29 22:05:42,372 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/usr/local/zookeeper/bin
2016-04-29 22:05:42,373 [myid:] - INFO  [main:ZooKeeper@438] - Initiating client connection, connectString=zookeeper:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@799f7e29
Exception in thread "main" java.net.UnknownHostException: zookeeper: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61)
at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
at org.apache.zookeeper.ZooKeeperMain.connectToZK(ZooKeeperMain.java:273)
at org.apache.zookeeper.ZooKeeperMain.<init>(ZooKeeperMain.java:288)
at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:281)
[root@novalocal bin]# 
加载中
0
张亦俊
张亦俊
unknown host,不是dns炸了就是你的hosts文件不对,当然还有可能是server挂了
0
Feng_Yu
Feng_Yu

解析不了zookeeper这个域名。如果你希望能解析这个域名,请自己写hosts。


返回顶部
顶部