zookeeper、redis、kafka、nacos常用命令总结

zookeeper、redis、kafka、nacos常用命令总结

NOTE:下列文中localhost均可用IP

- 中间件
- zookeeper
- 占用端口
- 21810
- 启动命令
- cd /opt/china/zookeeper-3.4.12/bin
- ./zkServer.sh start
- 连接命令
- ./zkCli.sh -server localhost:21810
- 查看节点
- ls /dubbo/com.test.china.demo.services.IDemoService/providers
- kafka
- 占用端口
- 9095
- 问题
- Connection to node -1 could not be established. Broker may not be available.
- 解决
- vi ../config/server.properties
- listeners=PLAINTEXT://localhost:9095
- advertised.listeners=PLAINTEXT://localhost:9095
- 启动命令
- cd /opt/china/kafka_2.12-2.1.0/bin
- ./kafka-server-start.sh ../config/server.properties &
- nohup ./kafka-server-start.sh ../config/server.properties 1>/dev/null 2>&1 & 常驻内存启动
- 查看topic列表
- ./kafka-topics.sh --list --zookeeper localhost:21810
- 创建topic,1个分区
- ./kafka-topics.sh --create --zookeeper localhost:21810 --replication-factor 1 --partitions 1 --topic demo
- 查看topic
- ./kafka-topics.sh --describe --zookeeper localhost:21810 --topic demo
- 生产消息
- ./kafka-console-producer.sh --broker-list localhost:9095 --topic demo
- 消费消息
- ./kafka-console-consumer.sh --bootstrap-server localhost:9095 --topic sxhdc --partition 0 --from-beginning
- ./kafka-console-consumer.sh --bootstrap-server localhost:9095 --topic sxhdc --partition 0 --offset 5
- 查看消费者组列表
- ./kafka-consumer-groups.sh --bootstrap-server localhost:9095 --list
- 查看消费者组的消费情况
- ./kafka-consumer-groups.sh --bootstrap-server localhost:9095 --group topic_group_test --describe
- reids
- 占用端口
- 6379、6380、6381
- 集群创建
- cd /opt/china/redis-5/bin
- ./redis-cli --cluster create localhost:6379 localhost:6380 localhost:6381
- 测试
- ./redis-cli -c -p 6379 -h localhost
- ./redis-cli -c -p 6381 -h localhost
- nacos
- 占用端口
- 8848
- 启动命令
- ./startup.sh -m standalone &

posted @ 2021-11-24 18:26  南风向北  阅读(321)  评论(0编辑  收藏  举报