Reputation: 55
I am having some difficulties running zookeeper on the windows environment.
I downloaded zookeeper 3.4.6. Extracted it. Created a zoo.cfg in conf folder with details as below:
# 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
# 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
Then I tried to run the zkServer.cmd from the bin folder. But I am not sure if this runs.
How do I test if Zookeeper Server is running on Windows?
Upvotes: 5
Views: 13082
Reputation: 491
Make sure, your zookeeper server is not running in windows. Not even active in docker(if installed). If active in docker, disable docker.
Run the following command
%KAFKA_HOME%\bin\windows\zookeeper-server-stop.bat
you will get response like -
No Instance(s) Available.
Then run following command:
%KAFKA_HOME%\bin\windows\zookeeper-server-start.bat KAFKA_HOME%\etc\kafka\zookeeper.properties
Upvotes: 0
Reputation: 1682
Here is the command for windows:
C:\kafka_2.12-2.3.1>.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
C:\kafka_2.12-2.3.1>.\bin\windows\kafka-server-start.bat .\config\server-1.properties
C:\kafka_2.12-2.3.1>.\bin\windows\kafka-topics.bat --create --bootstrap-server localhost:9093 --partitions 2 --replication-factor 2 --topic user-tracking
C:\kafka_2.12-2.3.1>.\bin\windows\kafka-topics.bat --list --bootstrap-server localhost:9093
Upvotes: 1
Reputation: 169
Run zkServer.cmd from the windows command line tool as Administrator if you want to see the result, not by cliking on it will close at the end and you wont be able to see the result.
Also, you should update the dataDir to a valid Windows directory in the form C:/tmp/....
On the command line, after calling zkServer.cmd, you should be able to see different [INFO] messages on your command line, the last one being binding to port 0.0.0.0/0.0.0.0:2181.
Upvotes: 5