监控系统简介
通过拉取在线服务日志(比如apache的access log),将日志信息(pv数据)保存到redis,并通过曲线图展示
使用组件
(1) simple_flow -- 流式计算
(2) simple_server -- 用于前端展示
(3) redis -- pv数据存储
(4) jschats -- 前端曲线展示
流程图
?
准备过程
(1)?启动 redis (在本地6379端口)
(2) 会滚动的日志文件
实现流程
(1) 下载 simple_flow : git clone?https://github.com/hongliuliao/simple_flow
(2) 执行 make && make?statistic_flow_server && make?statistic_http_server
(3) statistic_flow_server : ? ./bin/statistic_flow_server?
(4) 启动 fileagent : ./bin/fileagent localhost 3492 [日志文件]
(5) 启动?statistic_http_server: ./bin/statistic_http_server
(6) 通过浏览器访问:?http://192.168.238.140:3493/show.html?(ip请切换成对应的),效果如下图:
具体代码可以在test目录下找到
原文:http://finallygo.iteye.com/blog/2153014