zookeeper 集群 Cannot open channel to X at election address Error contacting service. It is probably not running.

zookeeper集群   启动

1.问题现象。 启动每一个都提示  STARTED 但是查看 status时全部节点都报错

[[email protected] bin]# sh zkServer.sh  start

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

[[email protected] bin]# sh zkServer.sh status

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg

Error contacting service. It is probably not running.

2.打印日志 看报错  全部节点都报这个错误

tail -1000f zookeeper.out

2016-04-27 01:22:50,087 [myid:1] - INFO  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:[email protected]] - Resolved hostname: node2.vvshop.cc to address: node2.vvshop.cc/54.254.152.81

2016-04-27 01:22:50,088 [myid:1] - WARN  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:[email protected]] - Cannot open channel to 3 at election address node3.vvshop.cc/52.221.223.222:3888

java.net.ConnectException: Connection refused

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)

at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)

at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)

at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)

2016-04-27 01:22:50,319 [myid:1] - INFO  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:[email protected]] - Resolved hostname: node3.vvshop.cc to address: node3.vvshop.cc/52.221.223.222

2016-04-27 01:22:50,319 [myid:1] - INFO  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:[email protected]] - Notification time out: 60000

3.网上寻求解决方案

1.http://freeman983.iteye.com/blog/2053037   log目录没有创建导致出错 并不是原因。

2.http://blog.csdn.net/qianggezhishen/article/details/49363349  (我的配置都是对的 但是仍然报错)

ZooKeeper安装使用时遇到各种奇怪问题的解决方法:

1.nohup:failed to run command ‘Java’: No such file or directory
2.Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

a.检查myid文件数字是否跟配置的能对的上

b.检查myid文件是否已经拷贝到dataDIr配置的路径里了

c.检查/etc/profile和/etc/environment 是否设置了Java和Zookeeper的路径

d.Zookeeper集群节点必须是3个以上

3.还是 歪果仁给力 stackoverflow 查到解决方案:

http://stackoverflow.com/questions/30940981/zookeeper-error-cannot-open-channel-to-x-at-election-address

例如:

server.1=0.0.0.0:2888:3888
server.2=192.168.10.10:2888:3888
server.3=192.168.2.1:2888:3888

Step 1:

Node 1:

zoo.cfg

server.1= 0.0.0.0:<port>:<port2>

server.2= <IP>:<port>:<port2>

.

.

.

server.n= <IP>:<port>:<port2>

Node 2 :

server.1= <IP>:<port>:<port2>

server.2= 0.0.0.0:<port>:<port2>

.

.

.

server.n= <IP>:<port>:<port2>

如愿看到:

[[email protected] bin]# sh zkServer.sh  status

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg

Mode: leader

[[email protected] bin]# sh zkServer.sh  status

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg

Mode: follower

[[email protected] bin]# sh zkServer.sh  status

ZooKeeper JMX enabled by default

Using config: /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg

Mode: follower

如果遇到 java.net.NoRouteToHostException: No route to host

建议关闭防火墙试试

Java.net.NoRouteToHostException:No route to host

上网查询的结论如下:

没有路由连接到本机,无法到达远程主机,

原因:防火墙干扰或中间路由器停机

(用telnet查看该机器是否正常连接,结果如下:

Trying 199.155.122.91...
telnet: connect to address 199.155.122.91: No route to host
telnet: Unable to connect to remote host: No route to host)

解决的办法是:和防火墙规则有关,关闭防火墙就可以了

关闭防火墙之后,结果如下:

Trying 199.155.122.91...
telnet: connect to address 199.155.122.91: Connection refused
telnet: Unable to connect to remote host: Connection refused

http://blog.csdn.net/chenyi8888/article/details/8552860

时间: 2024-12-27 22:45:20

zookeeper 集群 Cannot open channel to X at election address Error contacting service. It is probably not running.的相关文章

zookeeper启动时报Cannot open channel to X at election address Error contacting service. It is probably not running.

配置storm集群的时候出现如下异常: 2016-06-26 14:10:17,484 [myid:1] - WARN [SyncThread:1:[email protected]] - fsync-ing the write ahead log in SyncThread:1 took 1340ms which will adversely effect operation latency. See the ZooKeeper troubleshooting guide 2016-06-26

zookeeper错误Error contacting service. It is probably not running.

./zkServer.sh start启动成功,并且使用jps能看zookeeper的进程. ./zkServer.sh status缺报错,Error contacting service. It is probably not running. 好多地方说和防火墙有关系 我的解决办法是先看一下2181是否被占用,如果没有被占用查看8080端口是否会占用 zookeeper有一个内嵌的管理控制台是通过jetty启动,会占用8080端口 通过查看zookeeper的官方文档,发现有3种解决途径:

启动zookeeper时,jps显示有进程,但是status查看状态时就Error contacting service. It is probably not running

转自:http://www.cnblogs.com/xiaohua92/p/5460515.html#undefined 安装zookeeper时候,可以查看进程启动,但是状态显示报错:Error contacting service. It is probably not running 安装zookeeper-3.3.2的时候,启动正常没报错,但zkServer.sh status查看状态的时候却出现错误,如下: JMX enabled by defaultUsing config: /ha

zookeeper环境搭建中的几个坑[Error contacting service. It is probably not running]的分析及解决

Zookeeper简介 关于zk的介绍, zk的paxos算法, 网上已经有各位大神在写了, 本文主要写我在搭建过程中的几个极有可能遇到的坑. Zookeeper部署中的坑 坑之一 Error contacting service. It is probably not running 在配置完zookeeper集群后,三个节点,分别启动三个节点如下: [[email protected] bin]# zkServer.sh start JMX enabled by default Using

在配置zookeeper遇到Error contacting service. It is probably not running

在配置完zookeeper集群后,三个节点,分别启动三个节点如下: [[email protected] bin]# zkServer.sh startJMX enabled by defaultUsing config: /usr/local/zk/bin/../conf/zoo.cfgStarting zookeeper ... STARTED 在查看zookeeper状态时遇到 [[email protected] bin]# zkServer.sh statusJMX enabled b

安装zookeeper时候,可以查看进程启动,但是状态显示报错:Error contacting service. It is probably not running

安装zookeeper-3.3.2的时候,启动正常没报错,但zkServer.sh status查看状态的时候却出现错误,如下: JMX enabled by defaultUsing config: /hadoop/zookeeper/bin/../conf/zoo.cfgError contacting service. It is probably not running. jps查看进程,却发现进程已启动 7313  QuorumPeerMain 在网上查阅资料一共有三种解决方法: 1,

Zookeeper群起脚本启动失败及查看状态出现:Error contacting service. It is probably not running

1.问题: 群起脚本启动后查看jps没有出现:QuorumPeerMain Zookeeper正常启动但是群起脚本查状态出现:Error contacting service. It is probably not running错误 ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.4.10/bin/../conf/zoo.cfg Error contacting service. It is prob

zookeeper集群查看状态时报错Error contacting service. It is probably not running的一些坑以及解决办法

最近在搭建mq集群时候需要用到,zookeeper,可是启动的时候显示成功了,查看状态的时候却报错了: 碰到这个问题也是研究好好半天才解决,这里就总结出一个快速解决办法! 首先,必须看日志: 报错信息一般是当前目录下这个文件中,打开查看是什么原因,基本上我碰见的两种:一种是端口占用,一种是找不到路由: 还有一种就是端口占用了,netstat -znpl |grep 2181 查看一下并关闭这个进程,默认端口是2181,zoo.cfg可配置 !!!!这里提示一下,zoo_sample.cfg必须改

【zookeeper】 zookeeper 集群搭建

集群搭建环境: 发行版:CentOS-6.6 64bit 内核:2.6.32-504.el6.x86_64 CPU:intel-i7 3.6G 内存:2G 集群搭建步骤: 1. 确保机器安装了jdk [[email protected] ~]# java -version openjdk version "1.8.0_51" OpenJDK Runtime Environment (build 1.8.0_51-b16) OpenJDK 64-Bit Server VM (build