我在Centos 7上配置了zookeeper。 当我试图看到它抛出下一个的状态时:
[ikerlan@server1 ~]$ /opt/zookeeper-3.4.9/bin/zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-3.4.9/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.
如果我运行zkServer.sh start-foreground
-10-06 10:26:36,550 [myid:1] - WARN [WorkerSender[myid=1]:QuorumCnxManager@400] - Cannot open channel to 2 at election address /172.16.8.242:3888
java.net.NoRouteToHostException: No existe ninguna ruta hasta el `host'
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
这是我的〜/ .bashrc:
###JAVA CONFIGURATION###
JAVA_HOME=/usr/java/jdk1.8.0_74/jre/
export PATH=$PATH:$JAVA_HOME/bin
###HADOOP CONFIGURATION###
HADOOP_PREFIX=hadoop/
export PATH=$PATH:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin
#finHadoop
###ZOOKEEPER###
export PATH=$PATH:/opt/zookeeper-3.4.9/bin
#finZookeper
zoo.cfg:
tickTime=2000
dataDir=/opt/ZooData
clientPort=2181
initLimit=5
syncLimit=2
server.1=172.16.8.241:2888:3888
server.2=172.16.8.242:2888:3888
server.3=172.16.8.243:2888:3888
/ opt / ZooData / myid已配置
[ikerlan@server1 ~]$ sudo lsof -P -iTCP -sTCP:LISTEN | grep 2181
java 14568 ikerlan 25u IPv6 53119 0t0 TCP *:2181 (LISTEN)
答案 0 :(得分:0)
一个进程已经运行并且肯定会绑定到端口2181。 检查以下命令:
$ telnet <zookeeper-server-ip> 2181 # Just to know if some process is listening on port 2181
然后你可以通过发出以下命令来检查2181正在监听哪个进程:
$lsof -P -iTCP -sTCP:LISTEN | grep 2181
答案 1 :(得分:0)
解决方案:
我已在所有群集节点中禁用了防火墙,但它运行正常。
sudo systemctl stop firewalld