Sono nuovo nell'utilizzo di Zookeeper e sto provando ad apprenderlo usando il libro Zookeeper. Ora per avviare il server in modalità standalone viene fornito in book in modo da utilizzare il comando bin/zkServer.sh start
.main: ZooKeeperServerMain @ 54 - Argomenti non validi, in uscita in modo anomalo
Sto usando Windows in modo ho eseguito il comando come bin/zkServer.cmd start
ed ora ottengo un errore strano:
D:\zoo\zookeeper-3.4.6>bin\zkServer.cmd start
D:\zoo\zookeeper-3.4.6>java "-Dzookeeper.log.dir=D:\zoo\zookeeper-3.4.6\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "D:\zoo\zookeeper-3.4.6\bin\..\build\classes;D:\zoo\zookeeper-3.4.6\bin\..\b
ild\lib\*;D:\zoo\zookeeper-3.4.6\bin\..\*;D:\zoo\zookeeper-3.4.6\bin\..\lib\*;D:\zoo\zookeeper-3.4.6\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "D:\zoo\zookeeper-3.4.6\bin\..\conf
zoo.cfg" start
2014-04-04 21:00:06,573 [myid:] - INFO [main:[email protected]] - autopurge.snapRetainCount set to 3
2014-04-04 21:00:06,576 [myid:] - INFO [main:[email protected]] - autopurge.purgeInterval set to 0
2014-04-04 21:00:06,576 [myid:] - INFO [main:[email protected]] - Purge task is not scheduled.
2014-04-04 21:00:06,577 [myid:] - WARN [main:[email protected]] - Either no config or no quorum defined in config, running in standalone mode
2014-04-04 21:00:06,626 [myid:] - ERROR [main:[email protected]] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "D:\zoo\zookeeper-3.4.6\bin\..\conf\zoo.cfg"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)
at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:60)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:83)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:52)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
2014-04-04 21:00:06,629 [myid:] - INFO [main:[email protected]] - Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
D:\zoo\zookeeper-3.4.6>endlocal
favore qualcuno può aiutare a capire perché sto ottenendo questo errore? I comandi sono stati modificati rispetto a quelli menzionati in questo libro Zookeeper?
Dopo aver esaminato questo post SO zookeeper not starting, sono in grado di eseguire il zookeeper omettendo l'input start
per il comando. È il modo corretto di avviare un server in modalità standalone?
Ecco il mio file di configurazione per zookeeper:
# 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=/tmp/zookeeper
dataDir=D:\dataDir
# the port at which the clients will connect
clientPort=2181
# 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
Grazie Nipun, anche io sto cercando di arrestare il server utilizzando 'bin \ zkServer.cmd stop' anche allora anche io sto ottenendo lo stesso errore. Puoi dirmi come fermare il server? usa 'Ctrl + C' o c'è un altro comando da usare? – Chaitanya
Penso che ora sia solo il modo o uccidere il processo dal task manager. Con Zookeeper 3.4.5 tutti questi comandi di avvio/arresto dovrebbero funzionare. Un altro modo è utilizzare i comandi di amministrazione. Fondamentalmente è necessario connettersi al server Zookeeper ed emettere i comandi "kill". È possibile utilizzare un client telnet per lo stesso. –