Table of Contents

When you try to install Kafka standalone on a Windows machine you also need to install Zookeeper before installing Kafka.

While starting Zookeeper on Windows you face problems. below are some common problems with solutions.

Zookeeper Issues

Unable to create a data directory

Whenever you change dataDir property value as per your requirement and if there is any issue with path and permission this issue occurs.

Like if you change the dataDir property value with the below line in the zoo.cfg file which is under the config folder of zookeeper.

dataDir=C:\Users\bugfix\Downloads\zookeeper\tmp

you will get an error with the above line the solution is to add a double slash in the path like the below example.

dataDir=C:\\Users\\bugfix\\Downloads\\zookeeper\\tmp

Kafka Issues

The input line is too long

When we try to start Kafka on Windows this issue is encountered due to a long string of classpaths.

To fix this issue we need to make some changes in kafka-run-class.bat under bin/windows/kafka-run-class.bat

rem Classpath addition for release
for %%i in ("%BASE_DIR%\libs\*") do (
	call :concat "%%i"
)

change the above line of script to below one

rem Classpath addition for release
call :concat "%BASE_DIR%\libs\*;"

InconsistentClusterIdException

Usually, this problem arises when kafka logs are stored in the persistent folder and zookeeper data in the temporary, or vice-versa.

Then, after the system restarts, files that are stored in the temporary directory get cleaned and regenerated leading to the configuration mismatch.

Check below mentioned parameter to fix

log.dirs Kafka parameter in the server.properties 

dataDir zookeeper parameter in zookeeper.properties 

and ensure that both point to the same type of directory (temporary or persistent storage)

If something is wrong then after can reset inconsistent data.

i.e. remove meta.properties from log dir.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to BugFix.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.