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

相关推荐
张某人的胡思乱想1 天前
windows远程ubuntu
linux·运维·ubuntu
QT 小鲜肉1 天前
【Linux命令大全】001.文件管理之mtoolstest命令(实操篇)
linux·运维·前端·笔记·microsoft
ocean21031 天前
Linux面试题图解
linux·运维·服务器·面试·职场和发展
winfreedoms1 天前
wsl ubuntu的基础配置
linux·ubuntu·wsl·基础配置
怎么没有名字注册了啊1 天前
Debian 纯命令行 安装 VMware Tools 完整无坑手册(含全报错解决 + 无版本号 / 无成功提示终极修复)
linux·运维·debian·vmwaretools
最后一个bug1 天前
浅显易懂的讲解MMU是如何使用4级页表把虚拟地址转化为物理地址的~
linux·服务器·开发语言·系统架构·计算机外设
Hey小孩1 天前
[个人总结] Linux设备驱动第三版:2.建立和运行模块-II
linux
debug 小菜鸟1 天前
Linux 服务器环境搭建实战:从裸机到可用生产环境(含自动化脚本)
linux·服务器·自动化
阿钱真强道1 天前
20 极物智能 knx-主机场景对接
linux·运维·服务器
海棠蚀omo1 天前
万物互联的起点:走进 Linux 网络的心脏,开启一场从零开始的底层探索之旅
linux·网络