From 81e0a060c59f7d2167409bab436de115b413ef28 Mon Sep 17 00:00:00 2001 From: gaozhangmin Date: Wed, 13 Aug 2025 17:00:37 +0800 Subject: [PATCH 1/3] fix setZkTimeout --- conf/broker.conf | 6 ++++-- .../apache/pulsar/broker/BookKeeperClientFactoryImpl.java | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/broker.conf b/conf/broker.conf index c117596445dd2..ab5b0db720b93 100644 --- a/conf/broker.conf +++ b/conf/broker.conf @@ -1028,9 +1028,11 @@ maxConcurrentHttpRequests=1024 # Metadata service uri that bookkeeper is used for loading corresponding metadata driver # and resolving its metadata service location. # This value can be fetched using `bookkeeper shell whatisinstanceid` command in BookKeeper cluster. -# For example: zk+hierarchical://localhost:2181/ledgers +# For example: zk+hierarchical://localhost:2181 # The metadata service uri list can also be semicolon separated values like below: -# zk+hierarchical://zk1:2181;zk2:2181;zk3:2181/ledgers +# zk+hierarchical://zk1:2181;zk2:2181;zk3:2181 +# or +# metadata-store:zk:localhost:2181 If we set -Dbookkeeper.metadata.bookie.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataBookieDriver -Dbookkeeper.metadata.client.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataClientDriver bookkeeperMetadataServiceUri= # Authentication plugin to use when connecting to bookies diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java index 45299d9ed05d5..90615eebb3cd0 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java @@ -126,6 +126,7 @@ ClientConfiguration createBkClientConfiguration(MetadataStoreExtended store, Ser bkConf.setBusyWaitEnabled(conf.isEnableBusyWait()); bkConf.setNumWorkerThreads(conf.getBookkeeperClientNumWorkerThreads()); bkConf.setThrottleValue(conf.getBookkeeperClientThrottleValue()); + bkConf.setZkTimeout((int) conf.getMetadataStoreSessionTimeoutMillis()); bkConf.setAddEntryTimeout((int) conf.getBookkeeperClientTimeoutInSeconds()); bkConf.setReadEntryTimeout((int) conf.getBookkeeperClientTimeoutInSeconds()); bkConf.setSpeculativeReadTimeout(conf.getBookkeeperClientSpeculativeReadTimeoutInMillis()); From 43e970d4fd1a933e74dcaeb249ae41124f7167ef Mon Sep 17 00:00:00 2001 From: gaozhangmin Date: Wed, 13 Aug 2025 17:05:36 +0800 Subject: [PATCH 2/3] fix --- conf/broker.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/broker.conf b/conf/broker.conf index ab5b0db720b93..99ef5fa33299c 100644 --- a/conf/broker.conf +++ b/conf/broker.conf @@ -1028,9 +1028,9 @@ maxConcurrentHttpRequests=1024 # Metadata service uri that bookkeeper is used for loading corresponding metadata driver # and resolving its metadata service location. # This value can be fetched using `bookkeeper shell whatisinstanceid` command in BookKeeper cluster. -# For example: zk+hierarchical://localhost:2181 +# For example: zk+hierarchical://localhost:2181/ledgers # The metadata service uri list can also be semicolon separated values like below: -# zk+hierarchical://zk1:2181;zk2:2181;zk3:2181 +# zk+hierarchical://zk1:2181;zk2:2181;zk3:2181/ledgers # or # metadata-store:zk:localhost:2181 If we set -Dbookkeeper.metadata.bookie.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataBookieDriver -Dbookkeeper.metadata.client.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataClientDriver bookkeeperMetadataServiceUri= From c2b2efb5891cdd25b36bb34d5bfb0f518fb6ea57 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 27 Aug 2025 10:45:05 +0300 Subject: [PATCH 3/3] Improve bookkeeperMetadataServiceUri and metadataServiceUri documentation in broker.conf and bookkeeper.conf --- conf/bookkeeper.conf | 5 ++++- conf/broker.conf | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/conf/bookkeeper.conf b/conf/bookkeeper.conf index 4058d787e2c00..8503694cb7c21 100644 --- a/conf/bookkeeper.conf +++ b/conf/bookkeeper.conf @@ -661,10 +661,13 @@ diskCheckInterval=10000 # Examples: # - metadataServiceUri=zk+hierarchical://my-zk-1:2181/ledgers # - metadataServiceUri=etcd+hierarchical:http://my-etcd:2379 -# - metadataServiceUri=metadata-store:zk:my-zk-1:2281 +# - metadataServiceUri=metadata-store:zk:my-zk-1:2281/ledgers +# - metadataServiceUri=metadata-store:oxia://oxia-server:6648/bookkeeper # If you use metadata-store configuration, you need to configure following items in JVM option: # -Dbookkeeper.metadata.client.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataClientDriver # -Dbookkeeper.metadata.bookie.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataBookieDriver +# These are JVM options are set by default when BookKeeper components or tools are started with bin/pulsar or +# bin/bookkeeper scripts included in the the Pulsar distribution metadataServiceUri= # @Deprecated - `ledgerManagerFactoryClass` is deprecated in favor of using `metadataServiceUri` diff --git a/conf/broker.conf b/conf/broker.conf index 99ef5fa33299c..33232b9ad7542 100644 --- a/conf/broker.conf +++ b/conf/broker.conf @@ -1031,8 +1031,11 @@ maxConcurrentHttpRequests=1024 # For example: zk+hierarchical://localhost:2181/ledgers # The metadata service uri list can also be semicolon separated values like below: # zk+hierarchical://zk1:2181;zk2:2181;zk3:2181/ledgers -# or -# metadata-store:zk:localhost:2181 If we set -Dbookkeeper.metadata.bookie.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataBookieDriver -Dbookkeeper.metadata.client.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataClientDriver +# For using Pulsar's default Metadata Client Driver for BookKeeper, the URI starts with "metadata-store:". +# Examples: +# - metadata-store:zk:zk1:2181,zk2:2181,zk3:2181/ledgers +# - metadata-store:oxia://oxia-server:6648/bookkeeper +# When the value is empty, the broker will default to using broker's metadataStoreUrl config appended with "/ledgers" bookkeeperMetadataServiceUri= # Authentication plugin to use when connecting to bookies