Sto provando a impostare una singola istanza di zookeeper utilizzando la configurazione seguente, tuttavia il log di inizio indica che il zookeeper si blocca durante il tentativo di associare la porta 2181. Qualcuno per favore fammi sapere il problema qui. Grazie.Impostazione di una singola istanza Zookeeper e l'associazione non riesce
Start up Log;
2014-07-18 16:00:48,976 [myid:] - INFO [main:[email protected]] - Reading configuration from: /opt/zookeeper/bin/../conf/zoo.cfg
2014-07-18 16:00:48,980 [myid:] - ERROR [main:[email protected]] - Invalid configuration, only one server specified (ignoring)
2014-07-18 16:00:48,982 [myid:] - INFO [main:[email protected]] - autopurge.snapRetainCount set to 3
2014-07-18 16:00:48,982 [myid:] - INFO [main:[email protected]] - autopurge.purgeInterval set to 0
2014-07-18 16:00:48,983 [myid:] - INFO [main:[email protected]] - Purge task is not scheduled.
2014-07-18 16:00:48,983 [myid:] - WARN [main:[email protected]] - Either no config or no quorum defined in config, running in standalone mode
2014-07-18 16:00:48,997 [myid:] - INFO [main:[email protected]] - Reading configuration from: /opt/zookeeper/bin/../conf/zoo.cfg
2014-07-18 16:00:48,998 [myid:] - **ERROR** [main:[email protected]] - Invalid configuration, only one server specified (ignoring)
2014-07-18 16:00:48,998 [myid:] - INFO [main:[email protected]] - Starting server
2014-07-18 16:00:49,007 [myid:] - INFO [main:[email protected]] - Server environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT
2014-07-18 16:00:49,007 [myid:] - INFO [main:[email protected]] - Server environment:host.name=<NA>
2014-07-18 16:00:49,007 [myid:] - INFO [main:[email protected]] - Server environment:java.version=1.7.0_51
2014-07-18 16:00:49,007 [myid:] - INFO [main:[email protected]] - Server environment:java.vendor=Oracle Corporation
2014-07-18 16:00:49,007 [myid:] - INFO [main:[email protected]] - Server environment:java.home=/usr/java/jdk1.7.0_51/jre
2014-07-18 16:00:49,007 [myid:] - INFO [main:[email protected]] - Server environment:java.class.path=/opt/zookeeper/bin/../build/classes:/opt/zookeeper/bin/../build/lib/*.jar:/opt/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/opt/zookeeper/bin/../lib/netty-3.7.0.Final.jar:/opt/zookeeper/bin/../lib/log4j-1.2.16.jar:/opt/zookeeper/bin/../lib/jline-0.9.94.jar:/opt/zookeeper/bin/../zookeeper-3.4.6.jar:/opt/zookeeper/bin/../src/java/lib/*.jar:/opt/zookeeper/bin/../conf:
2014-07-18 16:00:49,008 [myid:] - INFO [main:[email protected]] - Server environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2014-07-18 16:00:49,010 [myid:] - INFO [main:[email protected]] - Server environment:java.io.tmpdir=/tmp
2014-07-18 16:00:49,010 [myid:] - INFO [main:[email protected]] - Server environment:java.compiler=<NA>
2014-07-18 16:00:49,010 [myid:] - INFO [main:[email protected]] - Server environment:os.name=Linux
2014-07-18 16:00:49,010 [myid:] - INFO [main:[email protected]] - Server environment:os.arch=amd64
2014-07-18 16:00:49,011 [myid:] - INFO [main:[email protected]] - Server environment:os.version=3.10.0-123.4.2.el7.x86_64
2014-07-18 16:00:49,011 [myid:] - INFO [main:[email protected]] - Server environment:user.name=root
2014-07-18 16:00:49,011 [myid:] - INFO [main:[email protected]] - Server environment:user.home=/root
2014-07-18 16:00:49,011 [myid:] - INFO [main:[email protected]] - Server environment:user.dir=/opt/zookeeper/bin
2014-07-18 16:00:49,018 [myid:] - INFO [main:[email protected]] - tickTime set to 2000
2014-07-18 16:00:49,018 [myid:] - INFO [main:[email protected]] - minSessionTimeout set to -1
2014-07-18 16:00:49,018 [myid:] - INFO [main:[email protected]] - maxSessionTimeout set to -1
2014-07-18 16:00:49,029 [myid:] - INFO [main:[email protected]] - binding to port 0.0.0.0/0.0.0.0:2181
File Zookeeper Config.
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/opt/zookeeper/data
# the port at which the clients will connect
clientPort=2181
#log directory.
dataLogDir=/opt/zookeeper/log
server.1=localhost:2888:3888
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
Ho avuto lo stesso problema quando stavo provando a configurare cluster di ZK 3 nodi sulla stessa macchina. Ho configurato la stessa porta client per tutte e tre le istanze che causa questo problema. Poi ho provato solo un nodo nodo e continuo a vedere lo stesso problema. Apparentemente, c'era un processo obsoleto che stava ascoltando sulla porta 2181 che stava causando questo problema. Puoi verificare se è così anche per te? –