<@U078Y59KC3B> How can i understand the details of...
# ask-ai
s
@RunLLM How can i understand the details of znodes in zookeeper for a given topic
r
To understand the details of znodes in ZooKeeper for a given Pulsar topic, you can use the ZooKeeper shell to inspect the relevant znodes. Topic metadata, ledger information, and other details are stored in znodes under paths like
/managed-ledgers
and
/ledgers
. Use commands like
ls
and
get
in the ZooKeeper shell to list and view the contents of these znodes. For example,
bin/pulsar zookeeper-shell -server <zk_host>:2181
followed by
ls /managed-ledgers/<tenant>/<namespace>/<topic>
and
get <znode_path>
will show you the structure and data stored for the topic. The data is often serialized and may require decoding for full interpretation, especially for internal protocol buffers or compressed metadata, which is not directly human-readable without additional tooling or decoding logic. For more advanced needs, such as decompressing or decoding Pulsar's internal protocol data, you may need to use Pulsar's admin tools or write custom scripts, as direct human-readable access is not always available. This is discussed in community threads, but there is no official public API for decoding all internal metadata directly from znodes. Would you like more detail on how to interpret or decode specific znode data? Sources: - https://github.com/apache/pulsar/blob/master/pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@RunLLM where can we find the relation between bookie and zk ledgers for a given topic
r
The relation between Bookie and ZooKeeper ledgers for a given topic is managed via metadata stored in ZooKeeper. Pulsar stores topic-to-ledger mapping in ZooKeeper under
/managed-ledgers
, while actual ledger metadata (including which bookies store which fragments) is under
/ledgers
. You can inspect these znodes using the ZooKeeper shell or BookKeeper APIs to see which ledgers belong to a topic and which bookies store their data. For a given topic, check
/managed-ledgers/<tenant>/<namespace>/<topic>
in ZooKeeper to find the list of ledger IDs, then look up each ledger's metadata under
/ledgers
to see the associated bookies. More details are available in the Pulsar BookKeeper metadata documentation. Sources: - https://pulsar.apache.org/docs/3.2.x/cookbooks-bookkeepermetadata 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@RunLLM how can i get the ledgers for a give topic from bookie
r
To get the ledgers for a given topic from Bookie, first retrieve the topic's ledger IDs from ZooKeeper under
/managed-ledgers/<tenant>/<namespace>/<topic>
. Then, use BookKeeper tools or APIs to inspect those ledger IDs on the Bookie side. There is no direct Bookie command to list all ledgers for a topic; the mapping is maintained in ZooKeeper, not Bookie itself. You can use the Pulsar admin tools or ZooKeeper shell to get the ledger list, then use BookKeeper shell commands like
readledger
or
ledgermetadata
to inspect each ledger on the Bookie. Would you like more detail or example commands? Sources: - https://pulsar.apache.org/docs/3.2.x/cookbooks-bookkeepermetadata 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.