zookeeper 启动报错Unable to create data directory D: mpdataDirzookeeper\version-2

报错信息如下

2019-05-04 10:27:10,382 [myid:] - INFO  [main:Environment@100] - Server environm
ent:user.dir=D:\zookeeper-3.4.6\bin
2019-05-04 10:27:10,387 [myid:] - ERROR [main:ZooKeeperServerMain@63] - Unexpect
ed exception, exiting abnormally
java.io.IOException: Unable to create data directory D: mpdataDirzookeeper\versi
on-2
        at org.apache.zookeeper.server.persistence.FileTxnSnapLog.(FileTxn
SnapLog.java:85)
        at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeep
erServerMain.java:104)
        at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooK
eeperServerMain.java:86)
        at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerM
ain.java:52)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(Qu
orumPeerMain.java:116)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain
.java:78)

解决办法:

conf\zoo.cfg

中的dataDir目录使用双反斜杠“\\”,如:

dataDir=D:\\tmp\\dataDir\\zookeeper
 

你可能感兴趣的:(zookeeper 启动报错Unable to create data directory D: mpdataDirzookeeper\version-2)