kafka之partition分区及副本replica升级
修改kafka的partition分区
bin/kafka-topics.sh --zookeeper datacollect-2:2181 --alter --partitions 3 --topic client-agent-1
修改kafka副本数
官网解释如下:
Increasing replication factor Increasing the replication factor of an existing partition is easy. Just specify the extra replicas in the custom reassignment json file and use it with the --execute option to increase the replication factor of the specified partitions.
For instance, the following example increases the replication factor of partition of topic foo from to . Before increasing the replication factor, the partition's only replica existed on broker 5. As part of increasing the replication factor, we will add more replicas on brokers 6 and 7. The first step is to hand craft the custom reassignment plan in a json file: > cat increase-replication-factor.json
{"version":,
"partitions":[{"topic":"foo","partition":,"replicas":[,,]}]}
准备json文件:
此文件结构没错,partition不够,需要根据实际情况完善此json文件。
{
"partitions":
[
{
"topic": "speech-3",
"partition": ,
"replicas": [,,]
},
{
"topic": "client-agent-3",
"partition": ,
"replicas": [,,]
},
{
"topic": "session-manager-3",
"partition": ,
"replicas": [,,]
},
{
"topic": "speech-2",
"partition": ,
"replicas": [,,]
},
{
"topic": "client-agent-2",
"partition": ,
"replicas": [,,]
},
{
"topic": "session-manager-2",
"partition": ,
"replicas": [,,]
},
{
"topic": "speech-1",
"partition": ,
"replicas": [,,]
},
{
"topic": "client-agent-1",
"partition": ,
"replicas": [,,]
},
{
"topic": "session-manager-1",
"partition": ,
"replicas": [,,]
}
],
"version":
}
开始执行副本升级:
bin/kafka-reassign-partitions.sh --zookeeper datacollect-: --reassignment-json-file json.json --execute
验证是否完成:
bin/kafka-reassign-partitions.sh --zookeeper datacollect-: --reassignment-json-file json.json --verify
参考:
kafka修改分区和副本数 http://blog.csdn.net/haifeng000haifeng/article/details/50914197
kafka运维--增加topic备份因子 http://blog.csdn.net/yanshu2012/article/details/53761284
kafka迁移与扩容 http://liyonghui160com.iteye.com/blog/2193430
Kafka 消息不能接收的问题 http://blog.csdn.net/lg772ef/article/details/65633359
kafka之partition分区及副本replica升级的更多相关文章
- Kafka技术内幕 读书笔记之(六) 存储层——服务端处理读写请求、分区与副本
如下图中分区到 日 志的虚线表示 : 业务逻辑层的一个分区对应物理存储层的一个日志 . 消息集到数据文件的虚线表示 : 客户端发送的消息集最终会写入日志分段对应的数据文件,存储到Kafka的消息代理节 ...
- kafka 分区和副本以及kafaka 执行流程,以及消息的高可用
1.Kafka概览 Apache下的项目Kafka(卡夫卡)是一个分布式流处理平台,它的流行是因为卡夫卡系统的设计和操作简单,能充分利用磁盘的顺序读写特性.kafka每秒钟能有百万条消息的吞吐量,因此 ...
- 详细解析kafka之kafka分区和副本
本篇主要介绍kafka的分区和副本,因为这两者是有些关联的,所以就放在一起来讲了,后面顺便会给出一些对应的配置以及具体的实现代码,以供参考~ 1.kafka分区机制 分区机制是kafka实现高吞吐的秘 ...
- 入门大数据---Kafka深入理解分区副本机制
一.Kafka集群 Kafka 使用 Zookeeper 来维护集群成员 (brokers) 的信息.每个 broker 都有一个唯一标识 broker.id,用于标识自己在集群中的身份,可以在配置文 ...
- kafka分区及副本在broker的分配
kafka分区及副本在broker的分配 部分内容參考自:http://blog.csdn.net/lizhitao/article/details/41778193 以下以一个Kafka集群中4个B ...
- 二、kafka 中央控制器、主题、分区、副本
集群和中央控制器 一个独立的Kafka服务器被称为broker.broker用来接收来自生产者的消息,为消息设置偏移量,并把消息保存到磁盘.换句话说,多个kafka实例组成kafka集群,每个实例(s ...
- Kafka Topic Partition Replica Assignment实现原理及资源隔离方案
本文共分为三个部分: Kafka Topic创建方式 Kafka Topic Partitions Assignment实现原理 Kafka资源隔离方案 1. Kafka Topic创建方式 ...
- (一)kafka修改topic分区的位置
(一)kafka修改topic分区的位置 环境:kafka_2.10-0.8.2.1 + JDK1.7.0_80 1. 查看分区topic的分区分布 $ le-kafka-topics.sh --de ...
- kafka 日常使用和数据副本模型的理解
kafka 日常使用和数据副本模型的理解 在使用Kafka过程中,有时经常需要查看一些消费者的情况.Kafka健康状况.临时查看.同步一些数据,又由于Kafka只是用来做流式存储,又没有像Mysql或 ...
随机推荐
- jqGrid删除多行数据问题
var consoleDlg = $("#delcostListDlg"); var selectedRowIds = $("#costList").jqGri ...
- Debian GNU Linux服务列表的获取、服务的关闭/开启、服务在启动时是否自己主动执行的生效/失效
/********************************************************************* * Author : Samson * Date ...
- python之函数用法round()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法round() #http://www.cnblogs.com/hongfei/p/3 ...
- s[-1]和s[len(s)-1]
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32 Type "copyr ...
- iOS仿支付宝芝麻信用仪表盘效果
概述 自定义View之高仿支付宝芝麻信用分数仪表盘动画效果 详细 代码下载:http://www.demodashi.com/demo/10654.html 仿支付宝芝麻信用仪表盘效果 一.主要思路 ...
- 转载【TP3.2】:使用PHP生成二维码
转载:在网上down了一个二维码插件PHPQRcode,整合到了ThinkPHP 3.2.3,然后写了个外部自定义函数直接调用生成二维码,根据参数不同有不同尺寸效果,整合其实挺简单,分享给大家! 今天 ...
- JavaScript中的数组与伪数组的区别
在JavaScript中,除了5种原始数据类型之外,其他所有的都是对象,包括函数(Function). 基本数据类型:String,boolean,Number,Undefined, Null 引用数 ...
- jquery api 常见 事件操作
change.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html ...
- HDUOJ------1711Number Sequence
Number Sequence Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- 【LeetCode】25. Reverse Nodes in k-Group (2 solutions)
Reverse Nodes in k-Group Given a linked list, reverse the nodes of a linked list k at a time and ret ...