kafka在linux环境下的执行命令

#创建topic

/data/app/kafka/bin/kafka-topics.sh --create --bootstrap-server 127.0.0.1:8318 --replication-factor 1 --partitions 12 --topic yunpei-track --command-config /data/app/kafka/config/admin.conf

#新增用户,新建用户mytest

/data/app/kafka/bin/kafka-configs.sh --zookeeper 127.0.0.1:8325 --alter --add-config 'SCRAM-SHA-512=[password=ztd123]' --entity-type users --entity-name ztdadmin

#更新用户,更新mytest的密码为mytest

/data/app/kafka/bin/kafka-configs.sh --zookeeper 192.168.18.11:12181 --alter --add-config 'SCRAM-SHA-512=[password=zto419#Pw62]' --entity-type users --entity-name mytest

#读取权限,设置用户mytest的消费者权限

/data/app/kafka/bin/kafka-acls.sh --authorizer-properties zookeeper.connect=127.0.0.1:8325 --add --allow-principal User:"yunpeiread" --consumer --topic 'yunpei-track' --group '*'

#写入权限,设置用户mytest的生产者权限

/data/app/kafka/bin/kafka-acls.sh --authorizer-properties zookeeper.connect=127.0.0.1:8325 --add --allow-principal User:"ztdadmin" --producer --topic 'yunpei-track' --group '*'

#查看所有分组

bin/kafka-consumer-groups.sh --bootstrap-server 127.0.0.1:8318 --list --command-config /data/app/kafka/config/admin.conf

#查看指定分组的消费情况

./bin/kafka-consumer-groups.sh --describe --bootstrap-server 127.0.0.1:8318 --group bigdata1 --command-config /data/app/kafka/config/admin.conf

#查看所有用户权限情况

/data/app/kafka/bin/kafka-acls.sh --authorizer-properties zookeeper.connect=127.0.0.1:8325 --list

#查看所有主题

/data/app/kafka/bin/kafka-topics.sh --list --zookeeper 127.0.0.1:8325

/data/app/kafka/bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:8318 --topic test_order_tag_r2p5 --group order_tag_group_test

1、查询topic,进入kafka目录:

/data/app/kafka/bin/kafka-topics.sh --list --zookeeper 127.0.0.1:8325

2、查询topic内容:

/data/app/kafka/bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:8318 --topic bignet-order-test --from-beginning

相关推荐
Hefin_H19 小时前
Linux 多用户服务器限制单用户最大内存使用(systemd user.slice)
linux·运维·服务器
nassi_20 小时前
开发板网络配置
linux·网络·嵌入式硬件
阿巴~阿巴~20 小时前
Linux 信号的保存机制
linux·服务器·信号·信号集·信号保存
柱子子子子21 小时前
【邪修】linux (ubuntu/fedora/arch/debian) wifi hard blocked解决方法-AX210
linux·网络·ubuntu·debian
大龄Python青年21 小时前
Linux发行版Ubuntu24.04安装教程
linux·ubuntu·1024程序员节
强里秋千墙外道1 天前
【Linux】ssh升级到最新版本-以ubuntu为例
linux·运维·ssh
9ilk1 天前
【仿RabbitMQ的发布订阅式消息队列】--- 介绍
linux·笔记·分布式·后端·rabbitmq
馨谙1 天前
OpenSSH 安全配置核心概念解析
linux·服务器·网络
半桔1 天前
【IO多路转接】IO 多路复用之 select:从接口解析到服务器实战
linux·服务器·c++·github·php
ink@re1 天前
Linux iptables:四表五链 + 实用配置
linux·运维·服务器