bin/kafka-topics.sh 主题的删除操作 和查看

[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ 
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ bin/kafka-topics.sh  

Option                                  Description                            
------                                  -----------                            
--alter                                 Alter the number of partitions,        
                                          replica assignment, and/or           
                                          configuration for the topic.         
--config <name=value>                   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                              
                                        index.interval.bytes                  
                                        max.message.bytes                     
                                        min.cleanable.dirty.ratio             
                                        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.        
--create                                Create a new topic.                    
--delete                                Delete a topic                         
--delete-config <name>                  A topic configuration override to be   
                                          removed for an existing topic (see   
                                          the list of configurations under the 
                                          --config option).                    
--describe                              List details for the given topics.     
--help                                  Print usage information.               
--list                                  List all available topics.             
--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                     
--replica-assignment                    A list of manual partition-to-broker   
  <broker_id_for_part1_replica1 :         assignments for the topic being      
  broker_id_for_part1_replica2 ,          created or altered.                  
  broker_id_for_part2_replica1 :                                               
  broker_id_for_part2_replica2 , ...>                                          
--replication-factor <Integer:          The replication factor for each        
  replication factor>                     partition in the topic being created.
--topic <topic>                         The topic to be create, alter or       
                                          describe. Can also accept a regular  
                                          expression except for --create option
--topics-with-overrides                 if set when describing topics, only    
                                          show topics that have overridden     
                                          configs                              
--unavailable-partitions                if set when describing topics, only    
                                          show partitions whose leader is not  
                                          available                            
--under-replicated-partitions           if set when describing topics, only    
                                          show under replicated partitions     
--zookeeper <urls>                      REQUIRED: The connection string for    
                                          the zookeeper connection in the form 
                                          host:port. Multiple URLS can be      
                                          given to allow fail-over.            
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ bin/kafka-topics.sh  --delete --topic test  --zookeeper centoshostnameKL1:2181,centoshostnameKL2:2181,centoshostnameKL3:2181
Topic test is marked for deletion.
Note: This will have no impact if delete.topic.enable is not set to true.
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ bin/kafka-topics.sh --list  --zookeeper centoshostnameKL1:2181,centoshostnameKL2:2181,centoshostnameKL3:2181
default-flume-topic
itcast
kafkaTopic
test1
test2
wangshumin8888
wangshumintop
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ bin/kafka-topics.sh  --delete --topic itcast  --zookeeper centoshostnameKL1:2181,centoshostnameKL2:2181,centoshostnameKL3:2181
Topic itcast is marked for deletion.
Note: This will have no impact if delete.topic.enable is not set to true.
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ bin/kafka-topics.sh  --delete --topic wangshumin8888  --zookeeper centoshostnameKL1:2181,centoshostnameKL2:2181,centoshostnameKL3:2181
Topic wangshumin8888 is marked for deletion.
Note: This will have no impact if delete.topic.enable is not set to true.
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ bin/kafka-topics.sh  --delete --topic wangshumintop  --zookeeper centoshostnameKL1:2181,centoshostnameKL2:2181,centoshostnameKL3:2181
Topic wangshumintop is marked for deletion.
Note: This will have no impact if delete.topic.enable is not set to true.
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ ll
总用量 60
drwxr-xr-x. 3 wangshumin wangshumin  4096 1月  26 12:34 bin
drwxr-xr-x. 2 wangshumin wangshumin  4096 3月  23 22:15 config
-rw-rw-r--. 1 wangshumin wangshumin 20144 1月  23 11:32 history
drwxrwxr-x. 5 wangshumin wangshumin  4096 4月  29 14:15 kafka-logs
drwxr-xr-x. 2 wangshumin wangshumin  4096 1月  23 08:43 libs
-rw-r--r--. 1 wangshumin wangshumin 11358 2月  12 2016 LICENSE
drwxrwxr-x. 2 wangshumin wangshumin  4096 4月  29 14:13 logs
-rw-r--r--. 1 wangshumin wangshumin   162 2月  12 2016 NOTICE
drwxr-xr-x. 2 wangshumin wangshumin  4096 2月  12 2016 site-docs
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ bin/kafka-topics.sh --list  --zookeeper centoshostnameKL1:2181,centoshostnameKL2:2181,centoshostnameKL3:2181
default-flume-topic
kafkaTopic
test1
test2
[wangshumin@centoshostnameKL1 kafka_2.11-0.9.0.1]$ 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值