CAT安装使用

cat安装使用

需要准备的文件及内容分别为:

  1. OS Linux or Wiondow
  2. 数据库 mysql
  3. 应用服务器 tomcat 端口号配置为:9996
  4. 准备操作系统配有占用的端口 2280

1.创建目录

前提:需要创建 /data/appdatas/cat 、 /data/applogs/cat 启动cat的用户必须有 可读 可写的权限 因为cat 日志文件和数据文件都存在在以上目录结构中

1.1 添加配置文件在 /data/appdatas/cat 目录中:

  • client.xml 客户端配置文件

    <?xml version="1.0" encoding="utf-8"?> <config mode="client" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="config.xsd"> <servers> <!-- Local mode for development --> <server ip="192.168.1.131" port="2280" http-port="9996" /> </servers> </config>
  • server.xml 服务端配置文件

    <?xml version="1.0" encoding="utf-8"?> <!-- Configuration for development environment--> <config local-mode="false" hdfs-machine="false" job-machine="true" alert-machine="true">
    1<storage local-base-dir="/data/appdatas/cat/bucket/" max-hdfs-storage-time="15" local-report-storage-time="7" local-logivew-storage-time="7"> 2 3</storage> 4 5<console default-domain="Cat" show-cat-domain="true"> 6 <remote-servers>192.168.1.131:9996</remote-servers> 7</console> 8 9<ldap ldapUrl="ldap://192.168.50.11:389/DC=dianpingoa,DC=com"/>
    </config>

配置的说明请参考 github中 Cat技术入门总结-0.1.0.doc

  • datasources.xml 数据库连接配置文件

    <?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://192.168.1.85:3306/cat]]></url> <user>root</user> <password>123abc</password> <connectionProperties><![CDATA[useUnicode=true&autoReconnect=true]]></connectionProperties> </properties> </data-source> <data-source id="app"> <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://192.168.1.85:3306/cat]]></url> <user>root</user> <password>123abc</password> <connectionProperties><![CDATA[useUnicode=true&autoReconnect=true]]></connectionProperties> </properties> </data-source> </data-sources>

2.将 cat.war放入准备好的tomcat中

将cat.war 放入tomcat 目录 webapps 下 启动 访问路径为: http://localhost:9996/cat

3.配置客户端路由校验

输入以下地址配置:http://localhost:9996/cat/s/config?op=routerConfigUpdate 修改 cat所在tomcat的ip

1<?xml version="1.0" encoding="utf-8"?> 2<router-config backup-server="127.0.0.1" backup-server-port="2280"> 3 <default-server id="192.168.1.131" weight="1.0" port="2280" enable="true"/> 4</router-config>

按照你的服务端cat运营环境配置好路径和端口

4.参考网址:

https://github.com/dianping/cat/blob/master/script/Dianping%20CAT%20%E5%AE%89%E8%A3%85%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3.md 安装说明

cat在我的测试项目中的使用

  • 监控sql: huaying-common com.huaying.common.web.plugin.cat.CatMybatisPlugins

    涉及到的配置如下: 配置文件 mybatis-config.xml 配置内容: <plugin interceptor="com.huaying.common.web.plugin.cat.CatMybatisPlugins" />

  • 监控spring mvc:huaying-common com.huaying.common.web.interceptor.CatInterceptor

    涉及到的配置如下: 配置文件 spring-mvc.xml 配置内容: mvc:interceptor <mvc:mapping path="/**"/> <bean class="com.huaying.common.web.interceptor.CatInterceptor" /> </mvc:interceptor>

  • 监控dubbo: huaying-common com.huaying.common.web.dubbo 包下边所有类

    涉及到的配置如下: 配置文件 spring-dubbox.xml 配置内容: <dubbo:consumer filter="consumerCat" /><!-- 消费端 消费者配置 --> <!-- <dubbo:provider filter="providerCat" /> --><!-- 生产端 生产者配置 -->

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )