Kafka命令详解(一)---topic相关
来源:互联网 发布:淘宝店聚划算入口 编辑:程序博客网 时间:2024/05/21 08:52
1、create
创建一个topic
bin/kafka-topics.sh --zookeeper ip:port --create --topic backtest --partitions 3 --replication-factor 2
2、list
List all available topics.
bin/kafka-topics.sh --zookeeper ip:port --list
3、delete
Delete a topic
4、delete-config
5 topic configuration override to be removed for an existing topic (see the list of configurations under the --config option).
4、describe
List details for the given topics.
bin/kafka-topics.sh --zookeeper ip:port --describe --topic backtest
6、partitions <Integer: # of partitions>
The number of partitions for the topic being created or altered
(WARNING:If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected
partitions指定topic分区数:
分区数,控制topic将分片成多少个log。可以显示指定,如果不指定则会使用broker(server.properties)中的num.partitions配置的数量
分区数也限制了consumer的并行度,即限制了并行consumer消息的线程数不能大于分区数
分区数或者或是单台服务器上的分区数过多,会增加不可用及延迟的风险。因为多的分区数,意味着需要打开更多的文件句柄、增加点到点的延时、增加客户端的内存消耗。
7、replication-factor <Integer:replication factor>
The replication factor for each partition in the topic being created.
replication-factor指定topic每个分区的副本数
replication factor 控制消息保存在几个broker(服务器)上,一般情况下等于broker的个数。
如果没有在创建时显示指定或通过API向一个不存在的topic生产消息时会使用broker(server.properties)中的default.replication.factor配置的数量
8、topic <String: topic>
The topic to be create, alter or describe. Can also accept a regular expression except for --create option
9、zookeeper <String: urls>
REQUIRED: The connection string for the zookeeper connection in the form host:port. Multiple URLS can be given to allow fail-over.
10、alter
Alter the number of partitions,replica assignment, and/or configuration for the topic.
11、config
A topic configuration override for the topic being created or altered.The following is a list of valid
configurations:
cleanup.policy
compression.type
delete.retention.ms
file.delete.delay.ms
flush.messages
flush.ms
follower.replication.throttled.
replicas
index.interval.bytes
leader.replication.throttled.replicas
max.message.bytes
message.format.version
message.timestamp.difference.max.ms
message.timestamp.type
min.cleanable.dirty.ratio
min.compaction.lag.ms
min.insync.replicas
preallocate
retention.bytes
retention.ms
segment.bytes
segment.index.bytes
segment.jitter.ms
segment.ms
unclean.leader.election.enable
See the Kafka documentation for full details on the topic configs.
创建一个topic
bin/kafka-topics.sh --zookeeper ip:port --create --topic backtest --partitions 3 --replication-factor 2
2、list
List all available topics.
bin/kafka-topics.sh --zookeeper ip:port --list
3、delete
Delete a topic
4、delete-config
5 topic configuration override to be removed for an existing topic (see the list of configurations under the --config option).
4、describe
List details for the given topics.
bin/kafka-topics.sh --zookeeper ip:port --describe --topic backtest
6、partitions <Integer: # of partitions>
The number of partitions for the topic being created or altered
(WARNING:If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected
partitions指定topic分区数:
分区数,控制topic将分片成多少个log。可以显示指定,如果不指定则会使用broker(server.properties)中的num.partitions配置的数量
分区数也限制了consumer的并行度,即限制了并行consumer消息的线程数不能大于分区数
分区数或者或是单台服务器上的分区数过多,会增加不可用及延迟的风险。因为多的分区数,意味着需要打开更多的文件句柄、增加点到点的延时、增加客户端的内存消耗。
7、replication-factor <Integer:replication factor>
The replication factor for each partition in the topic being created.
replication-factor指定topic每个分区的副本数
replication factor 控制消息保存在几个broker(服务器)上,一般情况下等于broker的个数。
如果没有在创建时显示指定或通过API向一个不存在的topic生产消息时会使用broker(server.properties)中的default.replication.factor配置的数量
8、topic <String: topic>
The topic to be create, alter or describe. Can also accept a regular expression except for --create option
9、zookeeper <String: urls>
REQUIRED: The connection string for the zookeeper connection in the form host:port. Multiple URLS can be given to allow fail-over.
10、alter
Alter the number of partitions,replica assignment, and/or configuration for the topic.
11、config
A topic configuration override for the topic being created or altered.The following is a list of valid
configurations:
cleanup.policy
compression.type
delete.retention.ms
file.delete.delay.ms
flush.messages
flush.ms
follower.replication.throttled.
replicas
index.interval.bytes
leader.replication.throttled.replicas
max.message.bytes
message.format.version
message.timestamp.difference.max.ms
message.timestamp.type
min.cleanable.dirty.ratio
min.compaction.lag.ms
min.insync.replicas
preallocate
retention.bytes
retention.ms
segment.bytes
segment.index.bytes
segment.jitter.ms
segment.ms
unclean.leader.election.enable
See the Kafka documentation for full details on the topic configs.
阅读全文
0 0
- Kafka命令详解(一)---topic相关
- kafka topic手动删除及其他相关
- Kafka 彻底删除 topic 操作命令流程
- kafka topic
- kafka相关命令
- kafka相关命令整理
- Kafka相关命令
- kafka详解一、Kafka简介
- kafka详解一、Kafka简介
- kafka详解一、Kafka简介
- kafka部署及实例命令 彻底删除topic
- kafka-topics.sh的delete命令删除topic
- kafka-topics.sh的delete命令删除topic
- kafka 创建topic,查看topic
- Kafka 命令详解
- kafka详解一
- 安装kafka及相关命令
- kafka工具kafka-topic.sh
- Windows 10 使用计划任务
- bootstrap中使用modal加载kindeditor时弹出层文本框不能输入的问题
- ActiveMq深入学习 第一波
- Linux下的延迟函数sleep()
- Bluetooth之BluetoothSocket
- Kafka命令详解(一)---topic相关
- mongo在shell中操作命令
- 使用OpenXml向空白文档添加一个带表格线的表(转)
- Android N(API level 24.)废弃了Html.fromHtml(String)
- 友元
- java android 将 List中元素互换位置
- 谁让APP工程师产生了泡沫?
- Java_面向对象_类
- BGABanner-Android 引导、图片轮播控件