linux 环境下 zookeeper服务启动成功,打开客户端查看时报错:拒绝链接

2017年03月29日 11:16:30
[root@izfvsms0q482wbz conf]# sh /lamp/zookeeper-3.3.6/bin/zkCli.sh
Connecting to localhost:2181
2017-03-29 10:59:17,174 - INFO  [main:Environment@97] - Client environment:zookeeper.version=3.3.6-1366786, built on 07/29/2012 06:22 GMT
2017-03-29 10:59:17,311 - INFO  [main:Environment@97] - Client environment:host.name=izfvsms0q482wbz
2017-03-29 10:59:17,318 - INFO  [main:Environment@97] - Client environment:java.version=1.8.0_111
2017-03-29 10:59:17,331 - INFO  [main:Environment@97] - Client environment:java.vendor=Oracle Corporation
2017-03-29 10:59:17,338 - INFO  [main:Environment@97] - Client environment:java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre
2017-03-29 10:59:17,345 - INFO  [main:Environment@97] - Client environment:java.class.path=/lamp/zookeeper-3.3.6/bin/../build/classes:/lamp/zookeeper-3.3.6/bin/../build/lib/*.jar:/lamp/zookeeper-3.3.6/bin/../zookeeper-3.3.6.jar:/lamp/zookeeper-3.3.6/bin/../lib/log4j-1.2.15.jar:/lamp/zookeeper-3.3.6/bin/../lib/jline-0.9.94.jar:/lamp/zookeeper-3.3.6/bin/../src/java/lib/*.jar:/lamp/zookeeper-3.3.6/bin/../conf:
2017-03-29 10:59:17,351 - INFO  [main:Environment@97] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2017-03-29 10:59:17,368 - INFO  [main:Environment@97] - Client environment:java.io.tmpdir=/tmp
2017-03-29 10:59:17,380 - INFO  [main:Environment@97] - Client environment:java.compiler=<NA>
2017-03-29 10:59:17,387 - INFO  [main:Environment@97] - Client environment:os.name=Linux
2017-03-29 10:59:17,396 - INFO  [main:Environment@97] - Client environment:os.arch=amd64
2017-03-29 10:59:17,402 - INFO  [main:Environment@97] - Client environment:os.version=3.10.0-514.2.2.el7.x86_64
2017-03-29 10:59:17,411 - INFO  [main:Environment@97] - Client environment:user.name=root
2017-03-29 10:59:17,422 - INFO  [main:Environment@97] - Client environment:user.home=/root
2017-03-29 10:59:17,434 - INFO  [main:Environment@97] - Client environment:user.dir=/lamp/zookeeper-3.3.6/conf
2017-03-29 10:59:17,518 - INFO  [main:ZooKeeper@379] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@20ad9418
Welcome to ZooKeeper!
2017-03-29 10:59:18,303 - INFO  [main-SendThread():ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
JLine support is enabled
2017-03-29 10:59:21,111 - WARN  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1185] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: 拒绝连接
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
[zk: localhost:2181(CONNECTING) 0] 2017-03-29 10:59:22,495 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server localhost/127.0.0.1:2181
2017-03-29 10:59:22,497 - WARN  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1185] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: 拒绝连接
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)

        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)


最后发现更改系统hosts即可

将127.0.0.1一行注释掉



[root@izfvsms0q482wbz conf]# sh /lamp/zookeeper-3.3.6/bin/zkServer.sh restart
JMX enabled by default
Using config: /lamp/zookeeper-3.3.6/bin/../conf/zoo.cfg
JMX enabled by default
Using config: /lamp/zookeeper-3.3.6/bin/../conf/zoo.cfg
Stopping zookeeper ... no zookeeper to stop (could not find file /tmp/zookeeper/data/zookeeper_server.pid)
JMX enabled by default
Using config: /lamp/zookeeper-3.3.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@izfvsms0q482wbz conf]# sh /lamp/zookeeper-3.3.6/bin/zkCli.sh
Connecting to localhost:2181
2017-03-29 11:11:41,528 - INFO  [main:Environment@97] - Client environment:zookeeper.version=3.3.6-1366786, built on 07/29/2012 06:22 GMT
2017-03-29 11:11:41,696 - INFO  [main:Environment@97] - Client environment:host.name=izfvsms0q482wbz
2017-03-29 11:11:41,714 - INFO  [main:Environment@97] - Client environment:java.version=1.8.0_111
2017-03-29 11:11:41,721 - INFO  [main:Environment@97] - Client environment:java.vendor=Oracle Corporation
2017-03-29 11:11:41,734 - INFO  [main:Environment@97] - Client environment:java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre
2017-03-29 11:11:41,749 - INFO  [main:Environment@97] - Client environment:java.class.path=/lamp/zookeeper-3.3.6/bin/../build/classes:/lamp/zookeeper-3.3.6/bin/../build/lib/*.jar:/lamp/zookeeper-3.3.6/bin/../zookeeper-3.3.6.jar:/lamp/zookeeper-3.3.6/bin/../lib/log4j-1.2.15.jar:/lamp/zookeeper-3.3.6/bin/../lib/jline-0.9.94.jar:/lamp/zookeeper-3.3.6/bin/../src/java/lib/*.jar:/lamp/zookeeper-3.3.6/bin/../conf:
2017-03-29 11:11:41,765 - INFO  [main:Environment@97] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2017-03-29 11:11:41,779 - INFO  [main:Environment@97] - Client environment:java.io.tmpdir=/tmp
2017-03-29 11:11:41,795 - INFO  [main:Environment@97] - Client environment:java.compiler=<NA>
2017-03-29 11:11:41,802 - INFO  [main:Environment@97] - Client environment:os.name=Linux
2017-03-29 11:11:41,815 - INFO  [main:Environment@97] - Client environment:os.arch=amd64
2017-03-29 11:11:41,825 - INFO  [main:Environment@97] - Client environment:os.version=3.10.0-514.2.2.el7.x86_64
2017-03-29 11:11:41,832 - INFO  [main:Environment@97] - Client environment:user.name=root
2017-03-29 11:11:41,846 - INFO  [main:Environment@97] - Client environment:user.home=/root
2017-03-29 11:11:41,868 - INFO  [main:Environment@97] - Client environment:user.dir=/lamp/zookeeper-3.3.6/conf
2017-03-29 11:11:41,938 - INFO  [main:ZooKeeper@379] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@20ad9418
Welcome to ZooKeeper!

zookeeper 3.4.x集群在centos7下始终拒绝连接

情况是这样的: [myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@382] - Cannot open channel to 1 at election ...
  • pein_zero
  • pein_zero
  • 2016年07月07日 23:55
  • 4052

zookeeper不停的拒绝client连接

2017-08-16 15:38:19,137 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFact...
  • zhang89xiao
  • zhang89xiao
  • 2017年08月16日 16:13
  • 805

【zookeeper】zookeeper集群配置异常 Connection refused 和 myid file is missing

zookeeper集群配置错误:连接异常 拒绝连接 java.net.ConnectExcept Connection refused myid file is missing...
  • cflys
  • cflys
  • 2017年08月02日 23:08
  • 1254

测试zookeeper服务报"java.net.ConnectException: 拒绝连接..错误

报错如下: java.net.ConnectException: 拒绝连接 at sun.nio.ch.SocketChannelImpl.checkConnect(Nati...
  • qq_41070393
  • qq_41070393
  • 2017年11月15日 20:24
  • 232

Linux下安装Zookeeper

Zookeeper是一个协调服务,可以用它来作为配置维护、名字服务、分布式部署; 下面,我来分享一下在Linux下安装Zookeeper的整个步骤,让大家少走弯路。 一、Zookeeper下...
  • c233728461
  • c233728461
  • 2016年09月28日 17:53
  • 951

ZooKeeper系列之二:Zookeeper常用命令

ZooKeeper服务命令:      在准备好相应的配置之后,可以直接通过zkServer.sh 这个脚本进行服务的相关操作 1. 启动ZK服务:       sh bin/zkServer...
  • xiaolang85
  • xiaolang85
  • 2013年10月25日 15:25
  • 249543

linux下zookeeper安装与测试

linux下zookeeper安装与测试 博客分类: 企业中间件开源组件的应用企业应用面临的问题 zookeeper  一、linux下单机版zookeeper安装 (0...
  • gaoqiao1988
  • gaoqiao1988
  • 2016年07月17日 21:35
  • 2771

linux下的zookeeper启动

zookeeper的安装目录:/usr/local/zookeeper-3.4.6/bin/zkServer.sh; 配置文件路径:../conf/zoo.cfg 端口 :2181; Z...
  • superhoy
  • superhoy
  • 2017年09月05日 11:40
  • 1006

ZooKeeper系列之五:ZooKeeper的运行

我们这里所介绍的是对应 ZooKeeper系列之三:ZooKeeper的安装 模式的运行。 1)单机模式用户可以通过下面的命令来启动ZooKeeper服务:zkServer.sh start这个命...
  • shenlan211314
  • shenlan211314
  • 2011年02月15日 08:27
  • 54772

Zookeeper 及其安装配置和启动

Zookeeper 为分布式系统提供一次性的服务,管理和协调分布式系统的工作,保证系统的高有效性。为什么需要它?因为分布式系统很容易出错,特别是在处理竞争和死锁的过程中。 提供的功能包括:配置维护...
  • ClementAD
  • ClementAD
  • 2015年08月28日 19:57
  • 13034
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:linux 环境下 zookeeper服务启动成功,打开客户端查看时报错:拒绝链接
举报原因:
原因补充:

(最多只允许输入30个字)