{"id":39676561,"url":"https://github.com/wupeaking/kafkainfo","last_synced_at":"2026-01-18T09:47:08.926Z","repository":{"id":57594681,"uuid":"88133334","full_name":"wupeaking/kafkainfo","owner":"wupeaking","description":"a simple client tools getting kafka info","archived":false,"fork":false,"pushed_at":"2019-11-11T11:58:56.000Z","size":5705,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-20T14:28:32.132Z","etag":null,"topics":["information","kafka","tools"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wupeaking.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-13T06:39:30.000Z","updated_at":"2023-01-29T17:51:16.000Z","dependencies_parsed_at":"2022-09-19T10:42:34.059Z","dependency_job_id":null,"html_url":"https://github.com/wupeaking/kafkainfo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wupeaking/kafkainfo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wupeaking%2Fkafkainfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wupeaking%2Fkafkainfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wupeaking%2Fkafkainfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wupeaking%2Fkafkainfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wupeaking","download_url":"https://codeload.github.com/wupeaking/kafkainfo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wupeaking%2Fkafkainfo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["information","kafka","tools"],"created_at":"2026-01-18T09:47:08.808Z","updated_at":"2026-01-18T09:47:08.904Z","avatar_url":"https://github.com/wupeaking.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## kafkainfo 是一个用于调试kafka的命令行工具\n\n[![Travis](https://travis-ci.org/wupeaking/kafkainfo.svg?branch=master)](https://travis-ci.org/wupeaking/kafkainfo)\n[![GoDoc](https://godoc.org/github.com/wupeaking/kafkainfo?status.svg)](https://godoc.org/github.com/wupeaking/kafkainfo)\n[![codecov.io](https://codecov.io/gh/wupeaking/kafkainfo/coverage.svg?branch=master)](https://codecov.io/gh/wupeaking/kafkainfo?branch=master)\n\n## 安装\n\n\n\u003e 源码build\n\n```shell\n\n# clone\nexport GOPATH=`pwd`\nmkdir -p  $GOPATH/src/github.com/wupeaking \u0026\u0026 cd $GOPATH/src/github.com/wupeaking\ngit clone git@github.com:wupeaking/kafkainfo.git \u0026\u0026 cd kafkainfo\n\n# build\ngo build -o kafkainfo main.go\n\n```\n\n\u003e 直接下载二进制执行文件\n\n```shell\n# Linux 64bit\ncurl -o kafkainfo -L https://github.com/wupeaking/kafkainfo/releases/download/v0.0.1/kafkainfo-linux64\n\n# mac\ncurl -o kafkainfo -L https://github.com/wupeaking/kafkainfo/releases/download/v0.0.1/kafkainfo-mac\n```\n\n\n## 命令\n\n\n\u003e 查看所有子命令\n\n```shell\n➜  kafkainfo git:(master) ✗ ./kafkainfo -h\nNAME:\n   kafkainfo - kafkainfo是一个简单的调试kafka的命令行工具\n\nUSAGE:\n   kafkainfo [global options] command [command options] [arguments...]\n\nVERSION:\n   0.0.1\n\nCOMMANDS:\n     topics      kafka的topic信息\n     partitions  kafka的指定topic的分区\n     brokers     kafka的指定所有brokers\n     produce     向kafka生成若干消息\n     consum      消费kafka消息\n     uishow      在shell上图形化显示kafka概述信息\n     help, h     Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --help, -h     show help\n   --version, -v  print the version\n```\n\n\n\u003e topics相关命令\n\n```shell\n\n# 列出所有的主题\n➜  kafkainfo git:(master) ✗ ./kafkainfo topics  --addr 172.24.4.168:9092  list\nINFO[0000] 所有的topics: [__consumer_offsets xxoo goclient beats]\n\n# 某个主题的某个分区的leader信息\n➜  kafkainfo git:(master) ✗ ./kafkainfo topics  --addr 172.24.4.168:9092   -t beats -p 0 leader\nINFO[0000] topic:beats part:0 addr: 172.24.4.168:9092 id:1001\n```\n\n\n\u003e partitions命令\n\n```shell\n# 列出某个topic的所有分区\n➜  kafkainfo git:(master) ✗ ./kafkainfo partitions --addr 172.24.4.168:9092 -t beats\nINFO[0000] beats的分区情况: [0 1 2]\n```\n\n\u003e brokers命令\n\n```shell\n\n# 列出kafka的所有集群\n➜  kafkainfo git:(master) ✗ ./kafkainfo brokers --addr 172.24.4.168:9092\nINFO[0000] id: 0x131cac0 addr: 172.24.4.168:9092         index:=0\nINFO[0000] id: 0x131cac0 addr: 172.24.6.144:9092         index:=1\nINFO[0000] id: 0x131cac0 addr: 172.24.6.185:9092         index:=2\n```\n\n\u003e produce与consum 命令\n\n```shell\n\n➜  kafkainfo git:(master) ✗ ./kafkainfo produce -h\nNAME:\n   kafkainfo produce - 向kafka生成若干消息\n\nUSAGE:\n   kafkainfo produce [command options] [arguments...]\n\nOPTIONS:\n   --addr value, --ip value   kafka集群的任意一个地址\n   -t value, --topic value    指定topic\n   -m value, --message value  消息内容\n   -c value, --count value    生产几份消息 (default: 0)\n\n➜  kafkainfo git:(master) ✗ ./kafkainfo consum -h\nNAME:\n   kafkainfo consum - 消费kafka消息\n\nUSAGE:\n   kafkainfo consum [command options] [arguments...]\n\nOPTIONS:\n   --addr value, --ip value  kafka集群的任意一个地址\n   -t value, --topic value   指定topic\n   -c value, --count value   消费几份消息 (default: 0)\n   -f, --forerver            一直消费 直到按下Ctrl-C\n```\n![produce-consum](./doc/producs-consum.png)\n\n\n### ui显示\n\n\n\u003e ./kafkainfo uishow --addr 172.24.4.168:9092\n\n![uishow](./doc/uishow.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwupeaking%2Fkafkainfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwupeaking%2Fkafkainfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwupeaking%2Fkafkainfo/lists"}