kafka3.10相关操作命令
时间: 2024-02-01 17:03:04 浏览: 29
以下是一些Kafka 3.10的相关操作命令:
1. 查看Kafka节点进程:
```shell
jps
```
2. 创建主题:
```shell
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic <topic_name>
```
3. 发送消息到主题:
```shell
kafka-console-producer.sh --broker-list localhost:9092 --topic <topic_name>
```
4. 从主题消费消息:
```shell
afka-console-consumer.sh --bootstrap-server localhost:9092 --topic <topic_name> --from-beginning
```
5. 查看主题列表:
```shell
kafka-topics.sh --list --zookeeper localhost:2181
```
6. 查看主题详情:
```shell
kafka-topics.sh --describe --zookeeper localhost:2181 --topic <topic_name>
```
7. 查看消费者组列表:
```shell
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
```
8. 查看消费者组详情:
```shell
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group <consumer_group_name>
```
9. 查看Kafka集群状态:
```shell
kafka-topics.sh --bootstrap-server localhost:9092 --describe
```