1
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 3 years have passed since last update.

AmazonLinux2 の EC2 からサクッと MSK の kafka topic を作ったりする方法

Posted at

kafkacat とか kafka-topic.sh などの kafka-tools をインストールするのめんどいので、Docker でやるアプローチ

MSK で kafka cluster の describe を得る

aws kafka describe-cluster --cluster-arn {{arn:aws:kafka:X:X:cluster/analytical-msk/X}}

kafka-topic.sh で topic を create する

sudo docker run wurstmeister/kafka:2.12-2.4.1 /opt/kafka/bin/kafka-topics.sh --create --zookeeper "{{z1,z2,z3}}" --topic test --partitions 1 --replication-factor 1

MSK で bootstrap-brokers を get する

aws kafka get-bootstrap-brokers --cluster-arn {{arn:aws:kafka:X:X:cluster/analytical-msk/X}}

kafkacat で topic の list をする

sudo docker run -it --network=host edenhill/kafkacat:1.5.0 -b {{BROKER_HOST}} -L
1
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
1
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?