大致流程如下:
利用etcd来管理日志文件的path和topic
启动etcd,Linux命令行下执行etcd即可
etcd在etcd目录下执行
go run main.go启动kafka之前先启动zookeeper
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties &之后启动kafka
kafka-server-start /usr/local/etc/kafka/server.properties &启动logagent,在logagent目录下执行
go build main.go
./mainsh kafka-console-consumer --bootstrap-server localhost:9092 --topic web_log --from-beginning



