0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

kubernetesでkafkaのtopicを削除する

Posted at

kubernetesでkafkaのtopicを削除する

やったことを忘れないようにメモ代わりです。
前提として、すでにkafkaがkubernetesのpodで動いているとして話をすすめます。

kafkaのpodに入る

$ kubectl exec -it kafka-0 -- /bin/bash

でpod上のkafkaに入れます。

topicの一覧

$ kafka-topics.sh --list --bootstrap-server kafka-0:9092

でtopicの一覧が出てくる

例:

bash-4.4# kafka-topics.sh --list --bootstrap-server kafka-0:9092
__consumer_offsets
js_eval.requests
tb_rule_engine
tb_transport.api.requests
tb_transport.api.responses.tb-http-transport-68bcd57cf8-xrt6j
tb_transport.notifications.tb-http-transport-68bcd57cf8-xrt6j

bootstrap-serverは/opt/kafka/config/producer.propertiesに記載がある。

############################# Producer Basics #############################

# list of brokers used for bootstrapping knowledge about the rest of the cluster
# format: host1:port1,host2:port2 ...
bootstrap.servers=localhost:9092

topicの削除

$ kafka-topics.sh --delete --bootstrap-server kafka-0:9092 --topic トピック名

で削除することができる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?