CAT是点评开源的监控系统,可以统计到粒度非常细,而且也支持hadoop,可以应对企业应用。
CAT底层使用的是MySQL,需要预先初始化数据库,而且还附带了几个配置文件,总之并不是一个war包就可以启动的。
为了本地快速调试和集成,还是Docker化一下吧。为了简单起见就只准备一个单机模式的镜像。
首先是准备几个xml文件,因为是单机模式,就全部只想要127.0.0.1了。
<?xml version="1.0" encoding="utf-8"?>
<config mode="client" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="config.xsd" xmlns="">
<servers>
<server ip="127.0.0.1" port="2280" http-port="8080"/>
</servers>
</config>
<?xml version="1.0" encoding="utf-8"?>
<config local-mode="false" hdfs-machine="false" job-machine="true" alert-machine="false">
<storage local-base-dir="/data/appdatas/cat/bucket/" max-hdfs-storage-time="15" local-report-storage-time="7"
local-logivew-storage-time="7">
</storage>
<console default-domain="Cat" show-cat-domain="true">
<remote-servers>127.0.0.1:8080</remote-servers>
</console>
</config>
最关键的就是数据库的准备了,CAT仓库准备了一个SQL文件。我的操作是在连接数据库的时候先检查数据库是否有表,没有就先建表。之后再替换datasource配置中的文件信息…







