Search code examples
solrapache-zookeepersolrcloud

Zookeeper znode not showing files in data directory


I have zookeeper znode for solr cloud . I am able to view my uploaded files using below solr commands.

Zookeeper list output:

ubuntu@ip-172-26-12-83:~/solr-7.7.2/bin$ ./solr zk ls /solr/configs/_default -z 127.0.0.1:2181,13.113.xx.xx:2181
protwords.txt
managed-schema
solrconfig.xml
synonyms.txt
stopwords.txt
lang
params.json

But when i try to check in zookeeper data directory it's not showing the above files.

Zookeeper data directory:

ubuntu@ip-172-26-12-83:~/solr-7.7.2/bin$ ls /tmp/zookeeper/
myid  version-2  zookeeper_server.pid
ubuntu@ip-172-26-12-83:~/solr-7.7.2/bin$\

Solution

  • Zookeeper does not store its contents directly on disk as files (so you wouldn't expect to find a 1:1 match with the files under the datadir). Since content stored in Zookeeper is not always regular files (and is synced across nodes), there isn't any reason for this mapping to be 1:1.

    The content is always kept in-memory, while a snapshot and a transaction log is kept on disk to restore the content if necessary.

    The Data Directory

    This directory has two files in it:

    myid - contains a single integer in human readable ASCII text that represents the server id.

    snapshot. - holds the fuzzy snapshot of a data tree.

    How often these files are created will depend on the settings for your Zookeeper installation.