kafka 扩展partition和replication-factor
问题:
1. kafka的topic 是程序自己建立,默认只建立8个partitions,1个replication-factor
目的: 扩展partitions 到9个, replicatoion-factor 3个
原因:因为kafka是三台,如果replicatoion-factor设置1的话,kafka坏掉一个会有影响
(1). 扩展partitions 到9个
Topic:Message PartitionCount:9 ReplicationFactor:1 Configs:
Topic: Message Partition: 0 Leader: 1 Replicas: 1 Isr: 1
Topic:Message Partition: 1 Leader: 2 Replicas: 2 Isr: 2
Topic: Message Partition: 2 Leader: 3 Replicas: 3 Isr: 3
Topic: Message Partition: 3 Leader: 1 Replicas: 1 Isr: 1
Topic: Message Partition: 4 Leader: 2 Replicas: 2 Isr: 2
Topic: Message Partition: 5 Leader: 3 Replicas: 3 Isr: 3
Topic: Message Partition: 6 Leader: 1 Replicas: 1 Isr: 1
Topic: Message Partition: 7 Leader: 2 Replicas: 2 Isr: 2
Topic: Message Partition: 8 Leader: 3 Replicas: 3 Isr: 3
(2)扩展ReplicationFactor 为3
vim increace-factor.json
{"version":1,
"partitions":[
{"topic":"Message","partition":0,"replicas":[1,2,3]},
{"topic":"Message","partition":1,"replicas":[1,2,3]},
{"topic":"Message","partition":2,"replicas":[1,2,3]},
{"topic":"Message","partition":3,"replicas":[1,2,3]},
{"topic":"Message","partition":4,"replicas":[1,2,3]},
{"topic":"Message","partition":5,"replicas":[1,2,3]},
{"topic":"Message","partition":6,"replicas":[1,2,3]},
{"topic":"Message","partition":7,"replicas":[1,2,3]}
{"topic":"Message","partition":8,"replicas":[1,2,3]}
]}
执行如下命令:
/kafka-reassign-partitions.sh --zookeeper kafka-zookeeper01:2181,kafka-zookeeper02:2181,kafka-zookeeper03:2181/kafka --reassignment-json-file increace-factor.json --execute
[root@java]#/kafka-topics.sh --describe --zookeeper kafka-zookeeper01:2181,kafka-zookeeper02:2181,kafka-zookeeper03:2181/kafka --topic Message
Topic:Message PartitionCount:9 ReplicationFactor:3 Configs:
Topic: Message Partition: 0 Leader: 1 Replicas: 1,2,3 Isr: 1,2,3
Topic: Message Partition: 1 Leader: 1 Replicas: 1,2,3 Isr: 2,1,3
Topic: Message Partition: 2 Leader: 1 Replicas: 1,2,3 Isr: 3,1,2
Topic: Message Partition: 3 Leader: 1 Replicas: 1,2,3 Isr: 1,2,3
Topic: Message Partition: 4 Leader: 1 Replicas: 1,2,3 Isr: 2,1,3
Topic: Message Partition: 5 Leader: 1 Replicas: 1,2,3 Isr: 3,1,2
Topic: Message Partition: 6 Leader: 1 Replicas: 1,2,3 Isr: 1,2,3
Topic: cMessage Partition: 7 Leader: 1 Replicas: 1,2,3 Isr: 2,1,3
Topic: Message Partition: 8 Leader: 1 Replicas: 1,2,3 Isr: 2,1,3
kafka 扩展partition和replication-factor的更多相关文章
- Error while executing topic command : Replication factor: 2 larger than available brokers: 0.
[root@hdp1 /mnt/software/maxwell-1.19.4]#kafka-topics.sh --zookeeper hdp1,hdp2,hdp3:2181 --create -- ...
- Apache Kafka(十)Partitions与Replication Factor 调整准则
Partitions与Replication Factor调整准则 Partition 数目与Replication Factor是在创建一个topic时非常重要的两个参数,这两个参数的取值会直接影响 ...
- kafka创建会话,报Error while executing topic command : Replication factor: 1 larger than available brokers: 0.
bin/kafka-topics.sh --create --zookeeper es1:2181 --replication-factor 1 --partitions 1 --topic top ...
- 【kafka】kafka.admin.AdminOperationException: replication factor: 1 larger than available brokers: 0
https://blog.csdn.net/bigtree_3721/article/details/78442912 I am trying to create topics in Kafka by ...
- kafka之partition分区及副本replica升级
修改kafka的partition分区 bin/kafka-topics.sh --zookeeper datacollect-2:2181 --alter --partitions 3 --topi ...
- Kafka Topic Partition Replica Assignment实现原理及资源隔离方案
本文共分为三个部分: Kafka Topic创建方式 Kafka Topic Partitions Assignment实现原理 Kafka资源隔离方案 1. Kafka Topic创建方式 ...
- replication factor
http://www.tuicool.com/articles/RJbIBj 关于Hadoop中replication factor解惑 时间 2014-06-09 08:00:50 ITeye ...
- Kafka Cached zkVersion [62] not equal to that in zookeeper, skip updating ISR (kafka.cluster.Partition) 问题分析
我司业务Kafka集群是3节点(broker分别为10,20,30),每个Topic 3 Partition,3 Repilication的配置,早上起床突然发现所有Topic的Broker节点都变为 ...
- linux 下安装 php kafka 扩展
我们使用官方推荐 php kafka 扩展 phpkafka,由于该扩展是基于 librdkafka 开发,所以我们首先需要安装 librdkafka 下载地址:http://kafka.apache ...
随机推荐
- Linux关闭端口
1. 查看哪些端口被占用 $ netstat -anp | grep 2042 tcp 0 0 192.168.56.1:2042 0.0.0.0:* LISTEN 8974/python 2. 删 ...
- TortoiseGit密钥设置
需要用到TortoiseGit的puttykey generator工具来生成既适用于github的rsa密钥也适用于TortoiseGit的ppk密钥. 1. 安装完成TortoiseGit后 ...
- C# Winform Dev控件之TileControl
tileControl 包含TileGroup TileGroup 包含 Tile Tile拖拽时代码 TilteControl的itemPress事件执行 或Tile的itemPress执行 Til ...
- 装箱与拆箱(TDB)
装箱:把值类型转换为引用类型 拆箱:把引用类型转换为值类型 只能对之前装箱的变量进行拆箱.需要强制转换.
- pytest_fixture-----conftest共享数据及不同层次共享
场景:你与其他测试工程师合作一起开发时,公共的模块要在不同文件中,要 在大家都访问到的地方. 解决:使用conftest.py 这个文件进行数据共享,并且他可以放在不同位置起 着不同的范围共享作用. ...
- Linux 父子进程实现复制文件内容到另一个文件内
1. 子进程先拷贝前一半 ,父进程一直阻塞到子进程拷贝完再拷贝后一半 /* 子进程先拷贝前一半文件,父进程先阻塞等待子进程拷贝完前一半内容, * 然后父进程在拷贝,后一半内容 * */ #includ ...
- (PASS)java中nextInt()函数
一:获取随机数的函数: package test; import java.util.Random; /** * * @ClassName: NextIntDemo * @Description: n ...
- Jmeter-【JSON Extractor】-响应结果中一级key取值
一.请求返回样式 二.取code值 三.查看结果
- 程序‘vim’已包含在下列软件包中
解决方法: 输入:sudo apt-get install ctags 输入:sudo apt-get install vim 输入:sudo ./config.sh (亲测有效)输入:vim tes ...
- PHP ftp_rmdir() 函数
定义和用法 The ftp_rmdir() 函数删除 FTP 服务器上的一个目录. 如果成功,该函数返回 TRUE.如果失败,则返回 FALSE. 语法 ftp_rmdir(ftp_connectio ...