If you want to keep clean of Zookeeper root path, it’s simplly change some default znode paramters in both broker.conf and bookkeeper.conf. But keep default znode is still recommend in case of introduce more complexities.

    The example below, I choise

    • znode ‘/pulsar-metadata-store’ to store metadata
    • znode ‘/pulsar-configuration-metadata-store’ to store geo-configuration data

    We can only change the znode before deploy.

    Modify the initialize commend which append your znode in zookeeper hierarchical URL.

    1. bin/pulsar initialize-cluster-metadata \
    2. --cluster mini \
    3. --zookeeper macmini:12181/pulsar-metadata-store \
    4. --configuration-store macmini:12181/pulsar-configuration-metadata-store \
    5. --web-service-url http://macmini:12181:18080 \
    6. --web-service-url-tls https://macmini:12181:18443 \
    7. --broker-service-url pulsar://macmini:12181:16650 \
    8. --broker-service-url-tls pulsar+ssl://macmini:12181:16651

    Modify zookeeperServersand configurationStoreServersin broker.conf.
    But do not change paramenter bookkeeperMetadataServiceUri, keep it after #. You can find more info from futeng’s Q&A.

    1. cat pulsar-1/conf/broker.conf \
    2. | grep -v "#" \
    3. | grep -E "zookeeperServers|configurationStoreServers|bookkeeperMetadataServiceUri"
    4. zookeeperServers=macmini:12181,macmini:22181,macmini:32181/pulsar-metadata-store
    5. configurationStoreServers=macmini:12181,macmini:22181,macmini:32181/pulsar-configuration-metadata-store
    6. # keep bookkeeperMetadataServiceUri start with #
    7. # do not using bookkeeperMetadataServiceUri
    8. # bookkeeperMetadataServiceUri=zk+hierarchical://macmini:12181,macmini:22181,macmini:32181/pulsar-metadata-store/ledgers

    Modify zkLedgersRootPath, normally it’s sub node of ledgersafter your metadata znode.
    Keep zkServers clean.

    1. cat conf/bookkeeper.conf | grep -v "#" \
    2. | grep -E "zkServers|zkLedgersRootPath"
    3. zkLedgersRootPath=/pulsar-metadata-store/ledgers
    4. zkServers=macmini:12181,macmini:22181,macmini:32181