topic列表查询
/opt/idss/kafka/bin/kafka-topics.sh --zookeeper 10.10.17.31:2181 --list
查看某个topic的具体内容
/opt/idss/kafka/bin/kafka-console-consumer.sh --bootstrap-server 10.10.17.31:9092 --topic event_nta --from-beginning
查询消费组列表
pt/idss/kafka/bin/kafka-consumer-groups.sh --bootstrap-server 10.10.17.31:9092 --list
查询某个消费组详细信息
/opt/idss/kafka/bin/kafka-consumer-groups.sh --bootstrap-server 10.10.17.31:9092 --group metadata-group --describe
创建一个test的topic
/opt/idss/kafka/bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --replication-factor 1 --partitions 2 --topic test
删除test的topic
/opt/idss/kafka/bin/kafka-topics.sh --zookeeper 127.0.0.1:2181 --delete --topic test
注:一般情况下出于安全角度考虑,kafka的地址一般都用本地回环地址,禁止外联,当然如果使用本地实际地址的话,有一款很好用的kafka客户端工具可以进行页面查询操作
offsetexplorer
---------------------------------------------------------------------------------------------------------------------------------
查看es节点健康信息
curl -XGET http://127.0.0.1:9200/_cluster/health?pretty
查看具体报错信息
curl -XGET http://10.88.104.233:9200/_cluster/allocation/explain?pretty
查看es所有索引
curl -GET 'http://127.0.0.1:9200/_cat/indices?v'
查看某个索引的数据
curl -GET 'http://127.0.0.1:9200/netlog_2021-12-31-04/_search'
删除某个索引数据
curl -XDELETE 'http://127.0.0.1:9200/logstash-2013.03.*'
注:因为es安装后默认的分片值是1000,可能会出现分片值不够大影响数据入库,这种情况下使用以下方法永久解决
curl -XPUT http://localhost:9200/_cluster/settings -u elastic:password -H "Content-Type: application/json" -d '{"persistent":{"cluster":{"max_shards_per_node":10000}}}'