kafka-topics.sh 相关的命令
Command Usage:
create:
enable rack strategy:
kafka-topics.sh --create --topic --partitions <Integer: the number of partitions> --replication-factor <Integer: replication factor> --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka>
disable rack strategy:
kafka-topics.sh --create --topic --partitions <Integer: the number of partitions> --replication-factor <Integer: replication factor> --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka> --disable-rack-aware
delete:
kafka-topics.sh --delete --topic --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka>
alter:
kafka-topics.sh --alter --topic --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka> --config <name=value>
list:
kafka-topics.sh --list --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka>
describe:
kafka-topics.sh --describe --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka>
示例:
kafka-topics.sh --create --topic TPCLOUD004 --partitions 10 --replication-factor 2 --zookeeper whtpiodscshd01t:24002/kafka
kafka-topics.sh --list --zookeeper whtpiodscshd01t:24002/kafka
kafka-topics.sh --describe --zookeeper whtpiodscshd01t:24002/kafka
kafka-topics.sh --delete --topic TPCLOUD004 --zookeeper whtpiodscshd01t:24002/kafka
kafka-console-producer.sh 相关的命令
Command Usage:
old-producer:
kafka-console-producer.sh --broker-list <IP1:PORT, IP2:PORT,…> --topic --old-producer --sync
new-producer:
kafka-console-producer.sh --broker-list <IP1:PORT, IP2:PORT,…> --topic --producer.config
示例:
kafka-console-producer.sh --broker-list 10.22.33.10:21007,10.22.33.11:21007,10.22.33.12:21007 --topic test
kafka-console-consumer.sh 相关的命令
Command Usage:
old-consumer:
kafka-console-consumer.sh --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka> --topic --from-beginning
new-consumer:
kafka-console-consumer.sh --topic --bootstrap-server <IP1:PORT, IP2:PORT,…> --consumer.config
示例:
kafka-console-consumer.sh
–topic rt_flink
–bootstrap-server 10.22.33.10:21007,10.22.33.11:21007,10.22.33.12:21007
–from-beginning
kafka-consumer-groups.sh 相关的命令
Command Usage:
list:
kafka-consumer-groups.sh --list --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka>
kafka-consumer-groups.sh --list --bootstrap-server <IP1:PORT, IP2:PORT,…> --command-config
describe:
kafka-consumer-groups.sh --describe --zookeeper <ZK_IP1:ZK_PORT,ZK_IP2:ZK_PORT,…/kafka> --group
kafka-consumer-groups.sh --describe --bootstrap-server <IP1:PORT, IP2:PORT,…> --group --command-config
示例:
kafka-consumer-groups.sh --zookeeper whtpiodscshd01t:24002/kafka --list
kafka-consumer-groups.sh --describe --zookeeper whtpiodscshd01t:24002/kafka --group example-group1