Skip to content

Sync every Pulsar namespace policy

What each policy change costs, and which ones are refused.

Terminal recording of kurkik pulsar sync

The recording shows kurkik pulsar sync on the demo sandbox; its data differs from this example.

What you get if you do not ask for the risky part:

$ kurkik pulsar sync a.yaml b --configs --dry-run
Sync a.yaml into b - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: namespaces shop/orders - the ones its channels live in; permissions, as x-kurkik.pulsar.server.acl declares them
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
Nothing to change.
left alone (16)
differs shop/orders auto-topic-creation --overwrite
differs shop/orders deduplication-snapshot-interval --overwrite
differs shop/orders delayed-delivery --overwrite
differs shop/orders dispatch-rate --overwrite
differs shop/orders encryption-required --overwrite
differs shop/orders inactive-topic-policies --overwrite
differs shop/orders max-producers-per-topic --overwrite
differs shop/orders max-unacked-messages-per-consumer --overwrite
cannot change shop/orders offload-policies
offload-policies on namespace shop/orders is not set by sync: offloading needs a driver and its credentials configured on the brokers, which a document never carries. Set it with pulsar-admin namespaces: (not set) here, deletion lag 3600000 ms in the document.
differs shop/orders persistence --overwrite
differs shop/orders publish-rate --overwrite
differs shop/orders schema-validation-enforce --overwrite
differs shop/orders subscribe-rate --overwrite
differs shop/orders subscription-expiration-time --overwrite
differs shop/orders subscription-types-enabled --overwrite
and 1 difference sync does not act on - servers, messages, undeclared settings; kurkik pulsar diff shows them
0 changes - 15 still differ
exit 2

Nothing changes yet. --dry-run only shows what would happen.

$ kurkik pulsar sync a.yaml b --configs --overwrite --dry-run
Sync a.yaml into b - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: namespaces shop/orders - the ones its channels live in; permissions, as x-kurkik.pulsar.server.acl declares them
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (14)
~ set shop/orders auto-topic-creation (not set) -> on, partitioned, 3 partitions
~ set shop/orders deduplication-snapshot-interval (not set) -> 120 s
~ set shop/orders delayed-delivery (not set) -> on, tick 2000 ms
~ set shop/orders dispatch-rate (not set) -> 100 msg, 1048576 bytes per 1 s
~ unset shop/orders encryption-required on -> (not set)
~ set shop/orders inactive-topic-policies (not set) -> delete after 3600 s inactive (delete_when_no_subscriptions) [destroys messages]
A topic of shop/orders inactive for 3600 s is deleted (delete_when_no_subscriptions), with what it holds.
~ set shop/orders max-producers-per-topic 20 -> 10
~ set shop/orders max-unacked-messages-per-consumer (not set) -> 1000
~ set shop/orders persistence (not set) -> ensemble 1, write quorum 1, ack quorum 1, mark-delete rate 2.0
~ set shop/orders publish-rate (not set) -> 200 msg/s, 2097152 bytes/s
~ set shop/orders schema-validation-enforce (not set) -> on
~ unset shop/orders subscribe-rate 10 per consumer per 30 s -> (not set)
~ set shop/orders subscription-expiration-time (not set) -> 30 min [destroys messages]
A subscription of shop/orders idle for 30 min is deleted, with the backlog it held for its consumers.
~ set shop/orders subscription-types-enabled (not set) -> Failover, Shared
note: Pulsar settles topic policies asynchronously: kurkik reads back for up to 30s before calling a change unconfirmed.
note: A namespace's policies reach every topic in it that sets none of its own, including topics the document does not describe.
left alone (2)
cannot change shop/orders offload-policies
offload-policies on namespace shop/orders is not set by sync: offloading needs a driver and its credentials configured on the brokers, which a document never carries. Set it with pulsar-admin namespaces: (not set) here, deletion lag 3600000 ms in the document.
and 1 difference sync does not act on - servers, messages, undeclared settings; kurkik pulsar diff shows them
applying needs: tenant admin on shop
14 changes, 2 destroy - 1 still differs
Apache Pulsar has no rehearsal: the plan above is all of it. Nothing was changed.
exit 2
$ kurkik pulsar sync a.yaml b --configs --overwrite --yes
Sync a.yaml into b - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: namespaces shop/orders - the ones its channels live in; permissions, as x-kurkik.pulsar.server.acl declares them
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (14)
~ set shop/orders auto-topic-creation (not set) -> on, partitioned, 3 partitions
~ set shop/orders deduplication-snapshot-interval (not set) -> 120 s
~ set shop/orders delayed-delivery (not set) -> on, tick 2000 ms
~ set shop/orders dispatch-rate (not set) -> 100 msg, 1048576 bytes per 1 s
~ unset shop/orders encryption-required on -> (not set)
~ set shop/orders inactive-topic-policies (not set) -> delete after 3600 s inactive (delete_when_no_subscriptions) [destroys messages]
A topic of shop/orders inactive for 3600 s is deleted (delete_when_no_subscriptions), with what it holds.
~ set shop/orders max-producers-per-topic 20 -> 10
~ set shop/orders max-unacked-messages-per-consumer (not set) -> 1000
~ set shop/orders persistence (not set) -> ensemble 1, write quorum 1, ack quorum 1, mark-delete rate 2.0
~ set shop/orders publish-rate (not set) -> 200 msg/s, 2097152 bytes/s
~ set shop/orders schema-validation-enforce (not set) -> on
~ unset shop/orders subscribe-rate 10 per consumer per 30 s -> (not set)
~ set shop/orders subscription-expiration-time (not set) -> 30 min [destroys messages]
A subscription of shop/orders idle for 30 min is deleted, with the backlog it held for its consumers.
~ set shop/orders subscription-types-enabled (not set) -> Failover, Shared
note: Pulsar settles topic policies asynchronously: kurkik reads back for up to 30s before calling a change unconfirmed.
note: A namespace's policies reach every topic in it that sets none of its own, including topics the document does not describe.
left alone (2)
cannot change shop/orders offload-policies
offload-policies on namespace shop/orders is not set by sync: offloading needs a driver and its credentials configured on the brokers, which a document never carries. Set it with pulsar-admin namespaces: (not set) here, deletion lag 3600000 ms in the document.
and 1 difference sync does not act on - servers, messages, undeclared settings; kurkik pulsar diff shows them
applying needs: tenant admin on shop
14 changes, 2 destroy - 1 still differs
applied
[+] done set shop/orders auto-topic-creation (not set) -> on, partitioned, 3 partitions
[+] done set shop/orders deduplication-snapshot-interval (not set) -> 120 s
[+] done set shop/orders delayed-delivery (not set) -> on, tick 2000 ms
[+] done set shop/orders dispatch-rate (not set) -> 100 msg, 1048576 bytes per 1 s
[+] done unset shop/orders encryption-required on -> (not set)
[+] done set shop/orders inactive-topic-policies (not set) -> delete after 3600 s inactive (delete_when_no_subscriptions)
[+] done set shop/orders max-producers-per-topic 20 -> 10
[+] done set shop/orders max-unacked-messages-per-consumer (not set) -> 1000
[+] done set shop/orders persistence (not set) -> ensemble 1, write quorum 1, ack quorum 1, mark-delete rate 2.0
[+] done set shop/orders publish-rate (not set) -> 200 msg/s, 2097152 bytes/s
[+] done set shop/orders schema-validation-enforce (not set) -> on
[+] done unset shop/orders subscribe-rate 10 per consumer per 30 s -> (not set)
[+] done set shop/orders subscription-expiration-time (not set) -> 30 min
[+] done set shop/orders subscription-types-enabled (not set) -> Failover, Shared
Applied 14 of 14 changes - 2 left alone
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 2

Written before the first change.

rollback.yaml
system: "Apache Pulsar"
target: "b (http://pulsar-b:8080)"
createdAt: "<time>"
document: "~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml"
entries:
- forAction: "set-setting:shop/orders:auto-topic-creation"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "auto-topic-creation"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:deduplication-snapshot-interval"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "deduplication-snapshot-interval"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:delayed-delivery"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "delayed-delivery"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:dispatch-rate"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "dispatch-rate"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "remove-setting:shop/orders:encryption-required"
undo: "SET_SETTING"
target: "shop/orders"
field: "encryption-required"
preState:
value: "on"
override: true
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:inactive-topic-policies"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "inactive-topic-policies"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:max-producers-per-topic"
undo: "SET_SETTING"
target: "shop/orders"
field: "max-producers-per-topic"
preState:
value: "20"
override: true
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:max-unacked-messages-per-consumer"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "max-unacked-messages-per-consumer"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:persistence"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "persistence"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:publish-rate"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "publish-rate"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:schema-validation-enforce"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "schema-validation-enforce"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "remove-setting:shop/orders:subscribe-rate"
undo: "SET_SETTING"
target: "shop/orders"
field: "subscribe-rate"
preState:
value: "10 per consumer per 30 s"
override: true
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:subscription-expiration-time"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "subscription-expiration-time"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"
- forAction: "set-setting:shop/orders:subscription-types-enabled"
undo: "REMOVE_SETTING_OVERRIDE"
target: "shop/orders"
field: "subscription-types-enabled"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "NAMESPACE"

Download rollback.yaml

$ kurkik pulsar diff a.yaml b --configs
a.yaml vs b
Namespace policies
~ shop/orders offload-policies - shop/orders sets offload-policies on a.yaml and not on b. (a.yaml: deletion lag 3600000 ms, b: (not set))
Topic policies
~ persistent://shop/orders/created offload-policies - offload-policies is in force on a.yaml and not set on b. (a.yaml: deletion lag 3600000 ms, b: (not set))
~ persistent://shop/orders/paid offload-policies - offload-policies is in force on a.yaml and not set on b. (a.yaml: deletion lag 3600000 ms, b: (not set))
Notes
- Broker settings that name a machine or a cluster were not compared: advertisedAddress, clusterName, metadataStoreUrl, statusFilePath.
- Not compared: ACLs, consumers, schemas, functions, connectors. Add --acls --consumers --schemas --functions --connectors, or --all, to compare them.
Drift: 3 changed · 0 unmanaged · 0 missing (drift) - 68 matched
exit 2
$ kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes
Revert b to b-<time>.snapshot.yaml - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: what the run being undone changed, as its rollback records it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (14)
~ unset shop/orders subscription-types-enabled Failover, Shared -> (not set)
~ unset shop/orders subscription-expiration-time 30 min -> (not set)
~ set shop/orders subscribe-rate (not set) -> 10 per consumer per 30 s
~ unset shop/orders schema-validation-enforce on -> (not set)
~ unset shop/orders publish-rate 200 msg/s, 2097152 bytes/s -> (not set)
~ unset shop/orders persistence ensemble 1, write quorum 1, ack quorum 1, mark-delete rate 2.0 -> (not set)
~ unset shop/orders max-unacked-messages-per-consumer 1000 -> (not set)
~ set shop/orders max-producers-per-topic 10 -> 20
~ unset shop/orders inactive-topic-policies delete after 3600 s inactive (delete_when_no_subscriptions) -> (not set)
~ set shop/orders encryption-required (not set) -> on
~ unset shop/orders dispatch-rate 100 msg, 1048576 bytes per 1 s -> (not set)
~ unset shop/orders delayed-delivery on, tick 2000 ms -> (not set)
~ unset shop/orders deduplication-snapshot-interval 120 s -> (not set)
~ unset shop/orders auto-topic-creation on, partitioned, 3 partitions -> (not set)
note: Pulsar settles topic policies asynchronously: kurkik reads back for up to 30s before calling a change unconfirmed.
note: A namespace's policies reach every topic in it that sets none of its own, including topics the document does not describe.
applying needs: tenant admin on shop
14 changes
applied
[+] done unset shop/orders subscription-types-enabled Failover, Shared -> (not set)
[+] done unset shop/orders subscription-expiration-time 30 min -> (not set)
[+] done set shop/orders subscribe-rate (not set) -> 10 per consumer per 30 s
[+] done unset shop/orders schema-validation-enforce on -> (not set)
[+] done unset shop/orders publish-rate 200 msg/s, 2097152 bytes/s -> (not set)
[+] done unset shop/orders persistence ensemble 1, write quorum 1, ack quorum 1, mark-delete rate 2.0 -> (not set)
[+] done unset shop/orders max-unacked-messages-per-consumer 1000 -> (not set)
[+] done set shop/orders max-producers-per-topic 10 -> 20
[+] done unset shop/orders inactive-topic-policies delete after 3600 s inactive (delete_when_no_subscriptions) -> (not set)
[+] done set shop/orders encryption-required (not set) -> on
[+] done unset shop/orders dispatch-rate 100 msg, 1048576 bytes per 1 s -> (not set)
[+] done unset shop/orders delayed-delivery on, tick 2000 ms -> (not set)
[+] done unset shop/orders deduplication-snapshot-interval 120 s -> (not set)
[+] done unset shop/orders auto-topic-creation on, partitioned, 3 partitions -> (not set)
Applied 14 of 14 changes
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 0

After the revert, compared with how it was before: Drift: 0 changed · 0 unmanaged · 0 missing (no drift) - 49 matched

source.yaml, 198 lines
asyncapi: 3.0.0
info:
title: a Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: Generated by reading Apache Pulsar of a (http://pulsar-a:8080).
servers:
standalone:
host: pulsar-a:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster standalone.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: standalone
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-a:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
auto-topic-creation: "on, partitioned, 3 partitions"
deduplication-snapshot-interval: 120 s
delayed-delivery: "on, tick 2000 ms"
dispatch-rate: "100 msg, 1048576 bytes per 1 s"
inactive-topic-policies: delete after 3600 s inactive (delete_when_no_subscriptions)
max-producers-per-topic: "10"
max-unacked-messages-per-consumer: "1000"
offload-policies: deletion lag 3600000 ms
persistence: "ensemble 1, write quorum 1, ack quorum 1, mark-delete\
\ rate 2.0"
publish-rate: "200 msg/s, 2097152 bytes/s"
schema-autoupdate: "on"
schema-validation-enforce: "on"
subscription-expiration-time: 30 min
subscription-types-enabled: "Failover, Shared"
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- standalone
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- standalone
security:
- security: NONE
tls: false
acl: []
consumers: []
producers: []
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
brokerDeleteInactiveTopicsEnabled: "false"
clusterName: standalone
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-a:6650
webServiceUrl: http://pulsar-a:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
auto-topic-creation: "on, partitioned, 3 partitions"
deduplication-snapshot-interval: 120 s
delayed-delivery: "on, tick 2000 ms"
dispatch-rate: "100 msg, 1048576 bytes per 1 s"
inactive-topic-policies: delete after 3600 s inactive (delete_when_no_subscriptions)
max-producers-per-topic: "10"
max-unacked-messages-per-consumer: "1000"
offload-policies: deletion lag 3600000 ms
partitions: 0
persistence: persistent
publish-rate: "200 msg/s, 2097152 bytes/s"
replication-clusters:
- standalone
schema-autoupdate: "on"
schema-validation-enforce: "on"
subscription-expiration-time: 30 min
subscription-types-enabled: "Failover, Shared"
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- standalone
topicConfiguration:
auto-topic-creation: "on, partitioned, 3 partitions"
deduplication-snapshot-interval: 120 s
delayed-delivery: "on, tick 2000 ms"
dispatch-rate: "100 msg, 1048576 bytes per 1 s"
inactive-topic-policies: delete after 3600 s inactive (delete_when_no_subscriptions)
max-producers-per-topic: "10"
max-unacked-messages-per-consumer: "1000"
offload-policies: deletion lag 3600000 ms
partitions: 2
persistence: persistent
publish-rate: "200 msg/s, 2097152 bytes/s"
replication-clusters:
- standalone
schema-autoupdate: "on"
schema-validation-enforce: "on"
subscription-expiration-time: 30 min
subscription-types-enabled: "Failover, Shared"
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}

Download source.yaml

target.yaml, 169 lines
asyncapi: 3.0.0
info:
title: b Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: Generated by reading Apache Pulsar of b (http://pulsar-b:8080).
servers:
standalone:
host: pulsar-b:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster standalone.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: standalone
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-b:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
encryption-required: "on"
max-producers-per-topic: "20"
schema-autoupdate: "on"
subscribe-rate: 10 per consumer per 30 s
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- standalone
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- standalone
security:
- security: NONE
tls: false
acl: []
consumers: []
producers: []
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
brokerDeleteInactiveTopicsEnabled: "false"
clusterName: standalone
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-b:6650
webServiceUrl: http://pulsar-b:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
encryption-required: "on"
max-producers-per-topic: "20"
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
subscribe-rate: 10 per consumer per 30 s
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- standalone
topicConfiguration:
encryption-required: "on"
max-producers-per-topic: "20"
partitions: 2
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
subscribe-rate: 10 per consumer per 30 s
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}

Download target.yaml

How to build this setup yourself

Clusters

Pulsar a

Terminal window
pulsar-admin --admin-url http://pulsar-a:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-a:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-a:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-a:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-max-producers-per-topic shop/orders --max-producers-per-topic 10
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-max-unacked-messages-per-consumer shop/orders --max-unacked-messages-per-topic 1000
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-deduplication-snapshot-interval shop/orders --interval 120
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-subscription-expiration-time shop/orders --time 30
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-inactive-topic-policies shop/orders --enable-delete-while-inactive --max-inactive-duration 3600s --delete-mode delete_when_no_subscriptions
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-delayed-delivery shop/orders --enable --time 2s
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-auto-topic-creation shop/orders --enable --type partitioned --num-partitions 3
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-subscription-types-enabled shop/orders --types Shared,Failover
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-schema-validation-enforce shop/orders --enable
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-persistence shop/orders --bookkeeper-ensemble 1 --bookkeeper-write-quorum 1 --bookkeeper-ack-quorum 1 --ml-mark-delete-max-rate 2.0
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-publish-rate shop/orders --msg-publish-rate 200 --byte-publish-rate 2097152
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-dispatch-rate shop/orders --msg-dispatch-rate 100 --byte-dispatch-rate 1048576 --dispatch-rate-period 1
pulsar-admin --admin-url http://pulsar-a:8080 namespaces set-offload-deletion-lag shop/orders --lag 1h

Pulsar b

Terminal window
pulsar-admin --admin-url http://pulsar-b:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-b:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-b:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-b:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-b:8080 namespaces set-max-producers-per-topic shop/orders --max-producers-per-topic 20
pulsar-admin --admin-url http://pulsar-b:8080 namespaces set-encryption-required shop/orders --enable
pulsar-admin --admin-url http://pulsar-b:8080 namespaces set-subscribe-rate shop/orders --subscribe-rate 10 --subscribe-rate-period 30

Sync

Terminal window
kurkik conn add pulsar a --admin-url http://pulsar-a:8080 --service-url pulsar://pulsar-a:6650 --client 4.0
kurkik conn add pulsar b --admin-url http://pulsar-b:8080 --service-url pulsar://pulsar-b:6650 --client 4.0
kurkik pulsar export a --this-cluster-only --acls --consumers --stdout > a.yaml # source.yaml (and b's, before: target.yaml)
kurkik pulsar sync a.yaml b --configs --dry-run # plan-without.txt
kurkik pulsar sync a.yaml b --configs --overwrite --dry-run # plan.txt (and -o json: plan.json)
kurkik pulsar sync a.yaml b --configs --overwrite --yes # apply.txt, and the reverse patch: rollback.yaml
kurkik pulsar diff a.yaml b --configs # after.txt
kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt

All flags: kurkik pulsar sync · more Apache Pulsar sync examples