返回到文章

采纳

编辑于

kafka 副本和分区改怎么设置,4个kafka结点,topic有4个副本

kafka

这两种那种比较合理,我是倾向于第一种

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