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

相关推荐
kukubuzai1 小时前
Docker Note
linux·运维·docker
Ltd Pikashu1 小时前
insmod 加载内核模块 —— sys_init_module 源码剖析
linux·kernel·insmod
hj2862511 小时前
Linux网络基础一
linux·运维
他们叫我阿冠1 小时前
Kafka的基本了解
分布式·kafka
小义_2 小时前
【Linux 1】
linux·运维·云原生·红帽
面向对象World2 小时前
Z8350 Broadcom SDIO网卡调试Ubuntu 22.04 Server版
linux·运维·ubuntu
Irissgwe2 小时前
12、多路转接 select
linux·io多路转接·select
无足鸟ICT2 小时前
【RHCA+】编辑多个文件
linux
fengyehongWorld2 小时前
Linux fd命令
linux
AIMath~3 小时前
hermes agent安装在Linux centos中
linux·运维·服务器