kafka修改topic分区数和副本集数

kafka修改topic分区数和副本集数,第1张

kafka修改topic分区数和副本集数 修改分区数
    /usr/local/kafka/bin/kafka-topics.sh --alter --zookeeper 10.1.1.1:2181/kafka --topic hogtmoperation --partitions 5
修改副本集数
    /usr/local/kafka/bin/kafka-reassign-partitions.sh -zookeeper 10.1.1.1:2181/kafka --reassignment-json-file /root/replication.json --execute

其中/root/replication.json文件如下:

    {
        "version": 1,
        "partitions": [
            {
                "topic": "hogtmoperation",
                "partition": 0,
                "replicas": [
                    2,
                    1
                ]
            },
         {
                "topic": "hogtmoperation",
                "partition": 1,
                "replicas": [
                    3,
                    2
                ]
            },
         {
                "topic": "hogtmoperation",
                "partition": 2,
                "replicas": [
                    4,
                    3
                ]
            },
         {
                "topic": "hogtmoperation",
                "partition": 3,
                "replicas": [
                    5,
                    4
                ]
            },
         {
                "topic": "hogtmoperation",
                "partition": 4,
                "replicas": [
                    6,
                    5
                ]
            }
        ]
    }

Thu Feb 21 16:56:13 CST 2019

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/3012620.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-09-28
下一篇 2022-09-28

发表评论

登录后才能评论

评论列表(0条)

保存