Where Does ZooKeeper Store Data?
ZooKeeper keeps snapshots in its dataDir with myid plus zoo.cfg beside it. Keep the myid unique on every host.
Last updated
ZooKeeper stores snapshots and transaction logs in the dataDir folder from zoo.cfg. The myid file beside it identifies the host in the ensemble. Config lives in the conf directory.
Back up dataDir plus conf plus myid to move a member. Stop the service before copying live state. Keep myid unique per host or quorum breaks on restart.
Where ZooKeeper stores this, by platform
dataDir plus myid (config in conf/zoo.cfg)
Snapshots in dataDir with myid beside it. Config in conf dir. Stop service before copying; keep myid per host.
Frequently asked questions
How do I migrate ZooKeeper data?
Copy dataDir contents plus zoo.cfg and myid to matching paths with the service stopped. Snapshots plus config travel together. Restart the ensemble after restoring.
Ensemble will not start. What do I check?
Check dataDir in zoo.cfg first. Snapshots land there by default. A wrong myid breaks quorum, so verify it per host.
Notice an outdated path? Let us know.