Skip to content

Sync Kafka topic and broker configs between clusters

Bring retention, broker settings and group settings in line, plan first.

Terminal recording of kurkik kafka sync

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

Shown here: one broker. Other broker setups are further down.

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

$ kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (4)
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
~ set every broker log.cleaner.threads (default) -> 2
~ set every broker message.max.bytes (default) -> 2097152
~ set group billing consumer.heartbeat.interval.ms (default) -> 6000
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
left alone (8)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
and 3 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER_CONFIGS on TOPIC orders.created; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP billing
4 changes, 1 destroy
rehearsal
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done set every broker log.cleaner.threads (default) -> 2
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group billing consumer.heartbeat.interval.ms (default) -> 6000
The cluster would accept every request it was shown. Nothing was changed.
exit 2
$ kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --yes
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (4)
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
~ set every broker log.cleaner.threads (default) -> 2
~ set every broker message.max.bytes (default) -> 2097152
~ set group billing consumer.heartbeat.interval.ms (default) -> 6000
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
left alone (8)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
and 3 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER_CONFIGS on TOPIC orders.created; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP billing
4 changes, 1 destroy
applied
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done set every broker log.cleaner.threads (default) -> 2
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group billing consumer.heartbeat.interval.ms (default) -> 6000
Applied 4 of 4 changes - 8 left alone
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 0

Written before the first change.

rollback.yaml
system: "Apache Kafka"
target: "MkU3OEVBNTcwNTJENDM2Qk"
createdAt: "<time>"
document: "~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml"
entries:
- forAction: "set-setting:orders.created:retention.ms"
undo: "SET_SETTING"
target: "orders.created"
field: "retention.ms"
preState:
value: "604800000"
override: true
- forAction: "set-setting:cluster:log.cleaner.threads"
undo: "REMOVE_SETTING_OVERRIDE"
target: "cluster"
field: "log.cleaner.threads"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "BROKER_CONFIGURATION"
- forAction: "set-setting:cluster:message.max.bytes"
undo: "REMOVE_SETTING_OVERRIDE"
target: "cluster"
field: "message.max.bytes"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "BROKER_CONFIGURATION"
- forAction: "set-setting:billing:consumer.heartbeat.interval.ms"
undo: "REMOVE_SETTING_OVERRIDE"
target: "billing"
field: "consumer.heartbeat.interval.ms"
preState:
override: false
note: "The system had no setting of its own here, so undoing means removing one."
definition:
scope: "GROUP"

Download rollback.yaml

$ kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes
Revert b to b-<time>.snapshot.yaml - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
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 (4)
~ unset group billing consumer.heartbeat.interval.ms 6000 -> (default)
~ unset every broker message.max.bytes 2097152 -> (default)
~ unset every broker log.cleaner.threads 2 -> (default)
~ set orders.created retention.ms 86400000 -> 604800000
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER_CONFIGS on GROUP billing; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on TOPIC orders.created
4 changes
applied
[+] done unset group billing consumer.heartbeat.interval.ms 6000 -> (default)
[+] done unset every broker message.max.bytes 2097152 -> (default)
[+] done unset every broker log.cleaner.threads 2 -> (default)
[+] done set orders.created retention.ms 86400000 -> 604800000
Applied 4 of 4 changes
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik kafka 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) - 33 matched

source.yaml, 180 lines
asyncapi: 3.0.0
info:
title: a Apache Kafka API
version: 1.0.0-SNAPSHOT
description: "Generated by reading the a cluster. Cluster id: MkU3OEVBNTcwNTJENDM2Qk."
servers:
broker-1:
host: a-kafka-1:9092
protocol: kafka
protocolVersion: "4.4"
x-kurkik:
kafka:
server:
security:
- security: PLAINTEXT
securityProtocol: PLAINTEXT
acl: []
groups:
- groupId: billing
groupType: consumer
state: STABLE
clientIds:
- billing-1
topics:
- orders.created
configuration:
consumer.heartbeat.interval.ms: "6000"
brokerConfiguration:
advertised.listeners: "INTERNAL://kafka-1:19092,EXTERNAL://a-kafka-1:9092"
authorizer.class.name: org.apache.kafka.metadata.authorizer.StandardAuthorizer
broker.id: "1"
controller.listener.names: CONTROLLER
controller.quorum.voters: 1@kafka-1:9093
group.initial.rebalance.delay.ms: "0"
inter.broker.listener.name: INTERNAL
listener.security.protocol.map: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT"
listeners: "INTERNAL://0.0.0.0:19092,EXTERNAL://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093"
log.cleaner.threads: "2"
message.max.bytes: "2097152"
min.insync.replicas: "1"
node.id: "1"
offsets.topic.replication.factor: "1"
process.roles: "broker,controller"
transaction.state.log.min.isr: "1"
transaction.state.log.replication.factor: "1"
clientConfiguration:
bootstrap.servers: a-kafka-1:9092
security.protocol: PLAINTEXT
groupConfiguration: {}
producerConfiguration: {}
consumerConfiguration: {}
channels:
customers.updated:
address: customers.updated
bindings:
kafka:
bindingVersion: 0.5.0
partitions: 3
replicas: 1
topicConfiguration:
cleanup.policy:
- compact
x-kurkik:
kafka:
channel:
topic: customers.updated
partitions: 3
replicas: 1
topicConfiguration:
cleanup.policy: compact
orders.created:
address: orders.created
bindings:
kafka:
bindingVersion: 0.5.0
partitions: 3
replicas: 1
topicConfiguration:
retention.ms: 86400000
x-kurkik:
kafka:
channel:
topic: orders.created
partitions: 3
replicas: 1
topicConfiguration:
retention.ms: "86400000"
payments.settled:
address: payments.settled
bindings:
kafka:
bindingVersion: 0.5.0
partitions: 3
replicas: 1
x-kurkik:
kafka:
channel:
topic: payments.settled
partitions: 3
replicas: 1
topicConfiguration:
min.insync.replicas: "1"
retention.bytes: "10737418240"
operations:
receive_customers.updated:
action: receive
channel:
$ref: "#/channels/customers.updated"
x-kurkik:
kafka:
operation:
security: []
consumerConfiguration: {}
groupConfiguration: {}
receive_orders.created:
action: receive
channel:
$ref: "#/channels/orders.created"
bindings:
kafka:
bindingVersion: 0.5.0
groupId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- billing
clientId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- billing-1
x-kurkik:
kafka:
operation:
groupId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- billing
clientId:
$schema: http://json-schema.org/draft-07/schema#
enum:
- billing-1
security: []
consumerConfiguration: {}
groupConfiguration: {}
receive_payments.settled:
action: receive
channel:
$ref: "#/channels/payments.settled"
x-kurkik:
kafka:
operation:
security: []
consumerConfiguration: {}
groupConfiguration: {}
send_customers.updated:
action: send
channel:
$ref: "#/channels/customers.updated"
x-kurkik:
kafka:
operation:
security: []
producerConfiguration: {}
send_orders.created:
action: send
channel:
$ref: "#/channels/orders.created"
x-kurkik:
kafka:
operation:
security: []
producerConfiguration: {}
send_payments.settled:
action: send
channel:
$ref: "#/channels/payments.settled"
x-kurkik:
kafka:
operation:
security: []
producerConfiguration: {}

Download source.yaml

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 1 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 1 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 1 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type topics --entity-name orders.created --alter --add-config retention.ms=86400000
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-default --alter --add-config message.max.bytes=2097152
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-name 1 --alter --add-config log.cleaner.threads=2
kafka-console-consumer.sh --bootstrap-server a-kafka-1:9092 --group billing --consumer-property client.id=billing-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type groups --entity-name billing --alter --add-config consumer.heartbeat.interval.ms=6000

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 1 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 1 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 1 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server b-kafka-1:9092 --entity-type topics --entity-name payments.settled --alter --add-config max.message.bytes=2097152
kafka-console-consumer.sh --bootstrap-server b-kafka-1:9092 --group billing --consumer-property client.id=billing-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092
kurkik conn add kafka b --bootstrap b-kafka-1:9092
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt
Show the plan
$ kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (4)
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
~ set broker 1 log.cleaner.threads (default) -> 2
~ set every broker message.max.bytes (default) -> 2097152
~ set group billing consumer.heartbeat.interval.ms (default) -> 6000
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
left alone (12)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
and 7 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER_CONFIGS on TOPIC orders.created; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP billing
4 changes, 1 destroy
rehearsal
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done set broker 1 log.cleaner.threads (default) -> 2
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group billing consumer.heartbeat.interval.ms (default) -> 6000
The cluster would accept every request it was shown. Nothing was changed.
exit 2

Download

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 3 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 3 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type topics --entity-name orders.created --alter --add-config retention.ms=86400000
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-default --alter --add-config message.max.bytes=2097152
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-name 1 --alter --add-config log.cleaner.threads=2
kafka-console-consumer.sh --bootstrap-server a-kafka-1:9092 --group billing --consumer-property client.id=billing-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type groups --entity-name billing --alter --add-config consumer.heartbeat.interval.ms=6000

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --partitions 3 --replication-factor 3 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic customers.updated --partitions 3 --replication-factor 3 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server b-kafka-1:9092 --entity-type topics --entity-name payments.settled --alter --add-config max.message.bytes=2097152
kafka-console-consumer.sh --bootstrap-server b-kafka-1:9092 --group billing --consumer-property client.id=billing-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092
kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt
Show the plan
$ kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --dry-run
Sync a.yaml into b - Apache Kafka, cluster MkU3OEVBNTcwNTJENDM2Qk
owns: the whole cluster - the document names no x-kurkik.kafka.server.topicPrefixes; access, as x-kurkik.kafka.server.acl declares it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (4)
~ set orders.created retention.ms 604800000 -> 86400000 [destroys messages]
Kafka applies the new bound promptly, so retention.ms going from 604800000 to 86400000 deletes what no longer fits.
~ set broker 1 log.cleaner.threads (default) -> 2
~ set every broker message.max.bytes (default) -> 2097152
~ set group billing consumer.heartbeat.interval.ms (default) -> 6000
note: Group sync: Kafka holds no group without members or committed positions. A group the document describes is made by writing its own settings, which Kafka keeps by the group's id; the group itself appears only when a consumer joins it, and starts with no committed positions - its consumers begin where auto.offset.reset says. No position is ever copied from the document's cluster. A group with nothing of its own to write cannot be made at all. With --delete, empty groups the document does not describe are deleted with their positions; the rollback commits those again (Kafka then makes it a classic group until a consumer of another protocol joins).
left alone (12)
not decided customers.updated groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_customers.updated' declares no consumer group, so there is nothing a broker could confirm.
not decided payments.settled groupId
Nothing about this can be checked against the system, so sync cannot bring it into line. Operation 'receive_payments.settled' declares no consumer group, so there is nothing a broker could confirm.
not decided customers.updated action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'customers.updated', so operation 'send_customers.updated' is not checked.
not decided orders.created action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'orders.created', so operation 'send_orders.created' is not checked.
not decided payments.settled action
Nothing about this can be checked against the system, so sync cannot bring it into line. A broker cannot know who publishes to 'payments.settled', so operation 'send_payments.settled' is not checked.
and 7 differences sync does not act on - servers, messages, undeclared settings; kurkik kafka diff shows them
applying needs: DESCRIBE and DESCRIBE_CONFIGS on the topics it reads; ALTER_CONFIGS on TOPIC orders.created; ALTER_CONFIGS on CLUSTER; ALTER_CONFIGS on GROUP billing
4 changes, 1 destroy
rehearsal
[+] done set orders.created retention.ms 604800000 -> 86400000
[+] done set broker 1 log.cleaner.threads (default) -> 2
[+] done set every broker message.max.bytes (default) -> 2097152
[+] done set group billing consumer.heartbeat.interval.ms (default) -> 6000
The cluster would accept every request it was shown. Nothing was changed.
exit 2

Download

How to build this setup yourself

Brokers

Cluster a

Terminal window
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic payments.settled --replica-assignment 2,2 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server a-kafka-1:9092 --create --topic customers.updated --replica-assignment 1:3 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type topics --entity-name orders.created --alter --add-config retention.ms=86400000
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-default --alter --add-config message.max.bytes=2097152
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type brokers --entity-name 1 --alter --add-config log.cleaner.threads=2
kafka-console-consumer.sh --bootstrap-server a-kafka-1:9092 --group billing --consumer-property client.id=billing-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads
kafka-configs.sh --bootstrap-server a-kafka-1:9092 --entity-type groups --entity-name billing --alter --add-config consumer.heartbeat.interval.ms=6000

Cluster b

Terminal window
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic orders.created --partitions 3 --replication-factor 3 --config retention.ms=604800000
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic payments.settled --replica-assignment 2,2 --config min.insync.replicas=1 --config retention.bytes=10737418240
kafka-topics.sh --bootstrap-server b-kafka-1:9092 --create --topic customers.updated --replica-assignment 1:3 --config cleanup.policy=compact
kafka-configs.sh --bootstrap-server b-kafka-1:9092 --entity-type topics --entity-name payments.settled --alter --add-config max.message.bytes=2097152
kafka-console-consumer.sh --bootstrap-server b-kafka-1:9092 --group billing --consumer-property client.id=billing-1 --consumer-property group.protocol=consumer --include 'orders.created' & # stays connected while kurkik reads

Sync

Terminal window
kurkik conn add kafka a --bootstrap a-kafka-1:9092,a-kafka-2:9092,a-kafka-3:9092
kurkik conn add kafka b --bootstrap b-kafka-1:9092,b-kafka-2:9092,b-kafka-3:9092
kurkik kafka export a --acls --groups --stdout > a.yaml # source.yaml
kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --dry-run # plan.txt (and -o json: plan.json)
kurkik kafka sync a.yaml b --configs --groups --overwrite --accept-groups --yes # apply.txt, and the rollback: rollback.yaml
kurkik kafka sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt

All flags: kurkik kafka sync · more Apache Kafka sync examples