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

    修改分区数

    1. /usr/local/kafka/bin/kafka-topics.sh --alter --zookeeper 10.1.1.1:2181/kafka --topic hogtmoperation --partitions 5

    修改副本集数

    1. /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文件如下:

    1. {
    2.     "version": 1,
    3.     "partitions": [
    4.         {
    5.             "topic": "hogtmoperation",
    6.             "partition": 0,
    7.             "replicas": [
    8.                 2,
    9.                 1
    10.             ]
    11.         },
    12.      {
    13.             "topic": "hogtmoperation",
    14.             "partition": 1,
    15.             "replicas": [
    16.                 3,
    17.                 2
    18.             ]
    19.         },
    20.      {
    21.             "topic": "hogtmoperation",
    22.             "partition": 2,
    23.             "replicas": [
    24.                 4,
    25.                 3
    26.             ]
    27.         },
    28.      {
    29.             "topic": "hogtmoperation",
    30.             "partition": 3,
    31.             "replicas": [
    32.                 5,
    33.                 4
    34.             ]
    35.         },
    36.      {
    37.             "topic": "hogtmoperation",
    38.             "partition": 4,
    39.             "replicas": [
    40.                 6,
    41.                 5
    42.             ]
    43.         }
    44.     ]
    45. }

    Thu Feb 21 16:56:13 CST 2019

    • 本文由 发表于 2019-02-21
    • 转载请务必保留本文链接:https://linuxeye.com/465.html
    Consul集群配置 Linux

    Consul集群配置

    consul原理 上图是官网提供的一个事例系统图,图中的Server是consul服务端高可用集群,Client是consul客户端。consul客户端不保存数据,客户端将接收到的请求转发给响应的Se...
    匿名

    发表评论

    匿名网友