Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zookeeper + Kafka - Unable to create data directory

I´m using zookeeper 3.4.8 in single node and try to use kafka.

When I run this command:

zookeeper-server-start.sh /usr/local/kafka_2.9.2-0.8.2.2    /config/zookeeper.properties

I get the below error:

[2016-02-22 17:32:41,661] ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain)
java.io.IOException: Unable to create data directory /var/zookeeper/version-2
    at org.apache.zookeeper.server.persistence.FileTxnSnapLog.<init>(FileTxnSnapLog.java:85)
    at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:104)
    at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:86)
    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)

Any advice?

like image 713
SirGustave Avatar asked Feb 22 '16 19:02

SirGustave


2 Answers

I faced the same issue, and this works with

sudo bin/zookeeper-server-start.sh config/zookeeper.properties

like image 148
Ahmad Alhilal Avatar answered Oct 21 '22 22:10

Ahmad Alhilal


For window's machine

Solved : Use double slashes inside the path while defining the dataDir path

dataDir=E:\\tools\\zookeeperdata\\data

like image 36
Mohit Singh Avatar answered Oct 21 '22 23:10

Mohit Singh