helm install kafka bitnami/kafka
查看
kubectl exec --tty -i kafka-client --namespace default -- bash
kafka-console-consumer.sh \
--bootstrap-server kafka.default.svc.cluster.local:9092 \
--topic test \
--from-beginning
kafka-console-producer.sh \
--broker-list kafka-0.kafka-headless.default.svc.cluster.local:9092 \
--topic test
输入hello word ,测试消息通信
kafka-configs.sh --bootstrap-server 10.108.77.12:2181 --describe --entity-type topics --entity-name test
kafka-configs.sh --bootstrap-server kafka-zookeeper.default.svc.cluster.local:2181 --entity-type topics --entity-name test --alter --add-config retention.ms=10000
retention.ms=10000
设定消息过期时间为10秒,过期后消息会自动删除
kafka-topics.sh --delete --topic test --zookeeper kafka-zookeeper.default.svc.cluster.local:2181
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/100333.html原文链接: