# :-: cat-home
### 1.cat-home所在的运行服务器上配置如下内容
~~~
mkdir /data/applogs/cat
mkdir /data/appdatas/cat
~~~
### 2.在此目录创建 client.xml , server.xml , datasources.xml
client.xml ------------------ 用于自定义应用上报CAT服务器(cat-home)的链接
server.xml ----------------- 用于CAT服务端(cat-home)配置
datasources.xml --------- CAT服务端数据库配置及 自定义应用数据库配置
测试发现 client.xml 如果没有也可以运行cat-home,
即client是部署在要监控的应用的/data/applogs/cat下的
**clinet.xml**
~~~
<?xml version="1.0" encoding="utf-8"?>
<config mode="client">
<servers>
// 客户端要上报的服务器
<server ip="127.0.0.1" port="2280" http-port="8080" />
</servers>
</config>
~~~
**server.xml**
cat-home部署的服务器相关内容
~~~
<?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>
// 默认Application Context 为 :cat ,所以需要
<console default-domain="Cat" show-cat-domain="true">
<remote-servers>127.0.0.1:8080</remote-servers>
</console>
</config>
~~~
**datasources.xml**
github下载的cat工程下script文件中appxxx.sql
同时还可以配置要监控的应用的数据库
~~~
<?xml version="1.0" encoding="utf-8"?>
<data-sources>
<data-source id="cat">
<maximum-pool-size>3</maximum-pool-size>
<connection-timeout>1s</connection-timeout>
<idle-timeout>10m</idle-timeout>
<statement-cache-size>1000</statement-cache-size>
<properties>
<driver>com.mysql.jdbc.Driver</driver>
<url><![CDATA[jdbc:mysql://127.0.0.1:3306/cat]]></url>
<user>root</user>
<password>123</password>
<connectionProperties>
<![CDATA[useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&socketTimeout=120000]]>
</connectionProperties>
</properties>
</data-source>
</data-sources>
~~~
`<data-source id="cat">
` 中 `id = "cat" `表示cat-home连接的数据库名称为cat