Created
September 12, 2022 12:23
-
-
Save geminixiang/cdeae1531aa956b246afcee5914ebeba to your computer and use it in GitHub Desktop.
讓kafka topic partition增加
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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