当前位置: 首页> 文旅> 酒店 > 杭州vi设计广告公司_什么是电商视觉设计_长春seo排名公司_产品推广软件有哪些

杭州vi设计广告公司_什么是电商视觉设计_长春seo排名公司_产品推广软件有哪些

时间:2025/7/10 2:51:09来源:https://blog.csdn.net/weixin_42210904/article/details/146163909 浏览次数:0次
杭州vi设计广告公司_什么是电商视觉设计_长春seo排名公司_产品推广软件有哪些

Kafka常用指令(详细)

启停命令

前台启动

前台启动命令
./bin/kafka-server-start.sh config/server.properties

后台启动方式1

后台启动命令加上参数-daemon,窗口关闭之后kafka后台程序继续运行
./bin/kafka-server-start.sh -daemon config/server.properties

后台启动方式2

nohup ./bin/kafka-server-start.sh config/server.properties &

停止命令

./bin/kafka-server-stop.sh

Topic命令相关

创建Topic

bin/kafka-topics.sh -zookeeper localhost:2181 --create --partitions 5 --replication-factor 2 --topic test_topic
参数说明:
localhost:2181:zk的IP地址和端口号;
–partitions 5:创建主题分区数量为5;
== --replication-factor 2==:创建主题分区副本为2;
–topic topic_name:创建主题名称为topic_name。

查询Topic列表

列出指定服务器主题
./bin/kafka-topics.sh --bootstrap-server 192.168.1.1:9092 --list
列出kafka集群中的主题列表,192.168.1.1:9092,192.168.1.2:9092为多个kafka服务地址
./bin/kafka-topics.sh --bootstrap-server 192.168.1.1:9092,192.168.1.2:9092 --list

查询Topic详细信息

查询指定主题详细信息
./bin/kafka-topics.sh --bootstrap-server localhost:9092 --topic topic_name --describe
查询多个kafka的主题详细信息
./bin/kafka-topics.sh --bootstrap-server 192.168.1.1:9092,192.168.1.2:9092 --topic topic_name --describe
删除指定的Topic
./bin/kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic topic_name
修改主题的分区数,注意:分区数只能增加不能减少
./bin/kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic topic_name --partitions 3
在这里插入图片描述

Procuder命令相关

发送消息

./bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic topic_name
在这里插入图片描述
#Consumer命令相关

指定主题从最新位置开始消费

消费topic_name中的最新消息
./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic_name
消费topic_name中的所有消息,包含历史消息
./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic topic_name
消费者组消费主题信息
./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic_name --group groupId

在这里插入图片描述

关键字:杭州vi设计广告公司_什么是电商视觉设计_长春seo排名公司_产品推广软件有哪些

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: