/var/www/yatta47.log

/var/www/yatta47.log

やったのログ置場です。スクラップみたいな短編が多いかと。

topicの作成/確認

f:id:yatta47:20200301125212p:plain

topic作成

topicの作成。パーティションを3つ、レプリケーションを1つの設定。brokerが一つしかない場合はレプリカはひとつしか設定できない。

kafka-topics --bootstrap-server broker:9092 --create --topic sample-topic --partitions 3 replication-factor 1

topic一覧

kafka-topics --bootstrap-server broker:9092 --list

topic詳細

root@cli:/# kafka-topics --bootstrap-server broker:9092 --describe --topic sample-topic
Topic: sample-topic     PartitionCount: 3       ReplicationFactor: 1    Configs:
        Topic: sample-topic     Partition: 0    Leader: 1       Replicas: 1     Isr: 1
        Topic: sample-topic     Partition: 1    Leader: 1       Replicas: 1     Isr: 1
        Topic: sample-topic     Partition: 2    Leader: 1       Replicas: 1     Isr: 1
root@cli:/#