Kafka命令详解(一)---topic相关
2017-06-05 11:22
148 查看
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.
相关文章推荐
- 详解MySQL插入和查询数据的相关命令及语句使用
- 常用linux网络相关命令使用和输出详解
- Linux进程管理相关命令详解
- 详解Linux系统中关机与重启相关命令的用法
- 详解MTK编译命令及相关文件
- SVN使用相关命令详解
- 【原创】Kafka topic常见命令解析
- kafka部署及实例命令 彻底删除topic
- 安装kafka及相关命令
- linux tcpdump相关之nc命令参数及用法详解
- Linux日志相关命令详解
- net user命令集合及相关命令详解
- linux下top命令详解 (性能相关以及系统性能诊断)
- adb命令详解(一)——模拟器相关命令集
- jar包相关命令详解
- 详解华为路由器配置的相关命令
- grep 命令详解及相关事例
- 详解MySQL插入和查询数据的相关命令及语句使用
- 删除kafka的topic及kafka基本命令
- GRUB的命令详解及相关站点