Skip to content

Instantly share code, notes, and snippets.

@geminixiang
Created September 12, 2022 12:23
Show Gist options
  • Save geminixiang/cdeae1531aa956b246afcee5914ebeba to your computer and use it in GitHub Desktop.
Save geminixiang/cdeae1531aa956b246afcee5914ebeba to your computer and use it in GitHub Desktop.
讓kafka topic partition增加
from kafka import KafkaAdminClient
from kafka.admin.new_partitions import NewPartitions
client = KafkaAdminClient(bootstrap_servers='0.0.0.0:19092',
api_version=(0, 11, 5))
rsp = client.create_partitions({
'YOUR-TOPIC': NewPartitions(4)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment