kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-16518; Adding standalone argument for storage

Open muralibasani opened this issue 1 year ago • 3 comments

Resolves : https://issues.apache.org/jira/browse/KAFKA-16518

Adds a new argument "standalone" to kafka-storage.sh If standalone mode, creates a checkpoint file in metadata dir ${kafkaConfig.metadataLogDir}/__cluster_metadata-0/

Committer Checklist (excluded from commit message)

  • [ ] Verify design and implementation
  • [ ] Verify test coverage and CI build status
  • [ ] Verify documentation (including upgrade notes)

muralibasani avatar Jun 13 '24 13:06 muralibasani

@jsancio Output looks like below.

./bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties -s metaPropertiesEnsemble=MetaPropertiesEnsemble(metadataLogDir=Optional.empty, dirs={/tmp/kraft-combined-logs: EMPTY}) Snapshot written to /tmp/kraft-combined-logs/__cluster_metadata-0 Formatting /tmp/kraft-combined-logs with metadata.version 3.7-IV4.

% cat /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000-0000000000.checkpoint �[� �%�%��������������* l�#�� �ﱃS�=��7 PLAINTEXT localhost#�?)��� �% �% �������������%

muralibasani avatar Jun 15 '24 21:06 muralibasani

cat /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000-0000000000.checkpoint

@muralibasani You can use bin/kafka-dump-log --cluster-metadata-decoder --files /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000-0000000000.checkpoint.

jsancio avatar Jun 17 '24 16:06 jsancio

@jsancio , updated with controller option

./bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties -q 1@localhost:9093
metaPropertiesEnsemble=MetaPropertiesEnsemble(metadataLogDir=Optional.empty, dirs={/tmp/kraft-combined-logs: EMPTY})
Formatting /tmp/kraft-combined-logs with metadata.version 3.8-IV0.
Snapshot written to /tmp/kraft-combined-logs/__cluster_metadata


muralidharbasani@Muralidhars-MacBook-Pro kafka % ./bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties -s                 
metaPropertiesEnsemble=MetaPropertiesEnsemble(metadataLogDir=Optional.empty, dirs={/tmp/kraft-combined-logs: EMPTY})
Formatting /tmp/kraft-combined-logs with metadata.version 3.8-IV0.
Snapshot written to /tmp/kraft-combined-logs/__cluster_metadata


muralidharbasani@Muralidhars-MacBook-Pro kafka % ./bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties -q 1@localhost:9093 -s
Both --standalone and --controller-quorum-voters were set. Only one of the two flags can be set.

muralibasani avatar Jul 01 '24 13:07 muralibasani

Closing this, as the StorageTool class will be refactored in a different PR.

muralibasani avatar Aug 02 '24 09:08 muralibasani

We ended up doing this in: #16669

cmccabe avatar Aug 02 '24 22:08 cmccabe