【zookeeper】集群安装配置问题

zookeeper 安装配置教程,传送门
http://blog.csdn.net/shirdrn/article/details/7183503
文艺版,带有实操教程
http://zookeeper.apache.org/doc/r3.3.6/zookeeperStarted.html#Other+Optimizations

下面是搭建过程中被虐的问题:

Interrupted while waiting for message on queue

不知道什么原因导致zookeeper的dataDir(conf/zoo.cfg dataDir=/root/zookeeper-3.3.6/zk)目录下的myid中的值全部改成一样,修改成正确的值就可以。

Interrupted while waiting for message on queue
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1899)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1976)
at java.util.concurrent.ArrayBlockingQueue.poll(ArrayBlockingQueue.java:342)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$SendWorker.run(QuorumCnxManager.java:570)

WARN [WorkerSender Thread:QuorumCnxManager@384] - Cannot open channel to 3 at election address zoo3/192.168.154.133:3888 java.net.ConnectException: Connection refused

关闭防火墙

重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off 或者 /sbin/chkconfig –level 2345 iptables off

即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop

查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
禁止防火墙在系统启动时启动
/sbin/chkconfig –level 2345 iptables off
重启iptables:
/etc/init.d/iptables restart
题外话:
开放相应端口,在文件
/etc/sysconfig/iptables
在系统原始配置的:RH-Firewall-1-INPUT规则链增加类似这样的行:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 39764 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m udp -p udp –dport 39764 -j ACCEPT
如果发现原有-j REJECT一类的语句,上面两句要放在它的前面

2015-10-18 18:32:45,586 - INFO  [WorkerReceiver Thread:FastLeaderElection@496] - Notification: 2 (n.leader), 0 (n.zxid), 1 (n.round), LOOKING (n.state), 2 (n.sid), LOOKING (my state)
2015-10-18 18:32:45,587 - WARN  [WorkerSender Thread:QuorumCnxManager@384] - Cannot open channel to 3 at election address zoo3/192.168.154.133:3888
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:117)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:340)
    at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:360)
    at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:333)
    at java.lang.Thread.run(Thread.java:745)
  • 同步时间
    删除本地时间并设置时区为广州
    rm -rf /etc/localtime
    ln -s /usr/share/zoneinfo/Asia/Guangzhou /etc/localtime
    同步时间
    ntpdate time.nist.gov

你可能感兴趣的:(eclipse设置)