当前位置:网站首页>Local deployment of distributed monitoring cat server
Local deployment of distributed monitoring cat server
2022-04-22 12:21:00 【Wanmao Society】
One 、CAT brief introduction
CAT(Central Application Tracking), Meituan's comments are based on Java Developed a set of open source distributed real-time monitoring system . Meituan commented that the infrastructure department hopes to store in the infrastructure 、 High performance communication 、 Large scale online access 、 Service governance 、 Real-time monitoring 、 Container and cluster intelligent scheduling provide industry leading 、 A unified solution ,CAT At present, the product positioning of meituan reviews is the unified monitoring component of the application layer , In middleware (RPC、 database 、 cache 、MQ etc. ) It is widely used in the framework , Provide system performance index for each business line 、 health 、 Real time alarm and other services .
Two 、 Deployment environment
- Windows 7
- CAT 3.0
- Java 8
- Tomcat 8.5
- Maven 3
- MySQL 5.7
- Intranet IP:192.168.1.111
3、 ... and 、 Start deployment
1. download CAT Source code
git clone https://github.com/dianping/cat.git
2. Initialize database
stay MySQL Created in cat database , And then execute script/Cat.sql Medium SQL sentence .
3. create profile
stay Tomcat Create the disk where you are /data/appdatas/cat Folder , Then create /data/appdatas/cat/client.xml file , Write the following :
<?xml version="1.0" encoding="utf-8"?>
<config mode="client">
<servers>
<server ip="192.168.1.111" port="2280" http-port="8080"/>
</servers>
</config>
among ,192.168.1.111 Change it to your computer's intranet IP,2280 By default CAT The port where the server receives data , No modification allowed ,http-port yes Tomcat Start port , The default is 8080, It is recommended to use the default port .
To create a /data/appdatas/cat/datasources.xml file , Write the following :
<?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.111:3306/cat]]></url> <!-- Please replace with a real database URL And Port -->
<user>root</user> <!-- Please replace with the real database user name -->
<password>root</password> <!-- Please replace with the real database password -->
<connectionProperties><![CDATA[useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&socketTimeout=120000]]></connectionProperties>
</properties>
</data-source>
</data-sources>
among , What needs to be replaced is : database IP、port、 User name and password .
4.CAT Of war Deploy
Use Maven structure AT Of war:
mvn clean install -DskipTests
After a successful build , take cat-home/target/cat-alpha-3.0.0.war Rename it to cat.war, Copied to the Tomcat Of webapps Next , start-up tomcat.
5. Modify routing configuration
visit http://192.168.1.111:8080/cat/s/config?op=routerConfigUpdate, Default user name :admin Default password :admin, Modify the client routing configuration :
<?xml version="1.0" encoding="utf-8"?>
<router-config backup-server="192.168.1.111" backup-server-port="2280">
<default-server id="192.168.1.111" weight="1.0" port="2280" enable="true"/>
<network-policy id="default" title=" Default " block="false" server-group="default_group">
</network-policy>
<server-group id="default_group" title="default-group">
<group-server id="192.168.1.111"/>
</server-group>
<domain id="cat">
<group id="default">
<server id="192.168.1.111" port="2280" weight="1.0"/>
</group>
</domain>
</router-config>
Configuration instructions :
- backup-server attribute : Set to current server external IP Address , The port is fixed to 2280
- default-server attribute : Define the route address that can jump , You can set multiple .default-server Of id Property configuration routable cat-home service IP Address , The port is fixed to 2280; If you need to disable routing address , Can handle enable Set to false
- network-policy You can configure multiple different network segments here , Indicates that the network segment uses server-group Of cat node , The role of this is mainly when multiple computer rooms are deployed cat When , Can be cat It is divided into multiple sub clusters , Then multiple sub clusters handle different clients , Avoid cross line access
- domain id=cat This part is mainly customized routing , When it is found that the data volume of some projects is particularly large , Or other scenes , You can put these domain The monitoring requests of are isolated and processed separately
6. Modify the server configuration
visit http://192.168.1.111:8080/cat/s/config?op=serverConfigUpdate, Modify the server configuration :
<?xml version="1.0" encoding="utf-8"?>
<server-config>
<server id="default">
<properties>
<property name="local-mode" value="false"/>
<property name="job-machine" value="true"/>
<property name="send-machine" value="false"/>
<property name="alarm-machine" value="true"/>
<property name="hdfs-enabled" value="false"/>
<property name="remote-servers" value="192.168.1.111:8080"/>
</properties>
<storage local-base-dir="/data/appdatas/cat/bucket/" max-hdfs-storage-time="15" local-report-storage-time="2" local-logivew-storage-time="1" har-mode="true" upload-thread="5">
<hdfs id="dump" max-size="128M" server-uri="hdfs://127.0.0.1/" base-dir="/user/cat/dump"/>
<harfs id="dump" max-size="128M" server-uri="har://127.0.0.1/" base-dir="/user/cat/dump"/>
<properties>
<property name="hadoop.security.authentication" value="false"/>
<property name="dfs.namenode.kerberos.principal" value="hadoop/[email protected]"/>
<property name="dfs.cat.kerberos.principal" value="[email protected]"/>
<property name="dfs.cat.keytab.file" value="/data/appdatas/cat/cat.keytab"/>
<property name="java.security.krb5.realm" value="value1"/>
<property name="java.security.krb5.kdc" value="value2"/>
</properties>
</storage>
<consumer>
<long-config default-url-threshold="1000" default-sql-threshold="100" default-service-threshold="50">
<domain name="cat" url-threshold="500" sql-threshold="500"/>
<domain name="OpenPlatformWeb" url-threshold="100" sql-threshold="500"/>
</long-config>
</consumer>
</server>
<server id="192.168.1.111">
<properties>
<property name="job-machine" value="true"/>
<property name="send-machine" value="false"/>
<property name="alarm-machine" value="true"/>
</properties>
</server>
</server-config>
Configuration instructions : server node : Represents the configuration of a machine . If id by default, Represents the default configuration ; If id by ip, Represents the configuration of this server
- local-mode : Define whether the service is local ( Development mode ), In the production environment , Set to false, Start remote monitoring mode . The default is false;
- hdfs-machine : Define whether to enable HDFS storage , The default is false;
- job-machine : Define whether the current service is a report worker ( Start the task of generating summary report and statistical report , Only one server is needed to turn on this function ), The default is false;
- alarm-machine : Define whether the current service is an alarm ( Turn on all kinds of alarm monitoring , Only one server is needed to turn on this function ), The default is false;
- send-machine : Define whether the current service alarm is sent ( At that time, in order to solve the problem of test environment, alarm thread was started , But the last alarm doesn't notify , This configuration will be gradually removed later , Suggest alarm-machine Open for true When , This synchronization is true)
storage node : Define data storage configuration information
- local-report-storage-time : Define how long local reports are stored , Unit is ( God )
- local-logivew-storage-time : Define the local log storage time , Unit is ( God )
- local-base-dir : Define the local data store directory
- hdfs : Definition HDFS Configuration information , Easy to log in directly to the system
- server-uri : Definition HDFS Service address
- console : Define service console information
- remote-servers : Definition HTTP List of services ,( This value is taken when the remote monitor synchronously updates the server information )
- ldap : Definition LDAP Configuration information ( This can be ignored )
- ldapUrl : Definition LDAP Service address ( This can be ignored )
Restart Tomcat.
Four 、 verification
visit http://192.168.1.111:8080/cat/r, Click on “State”, You can see “CAT The server is normal ” and CAT Some basic states , Here's the picture :
Click on “Transaction”,CAT Own monitoring information , Here's the picture :
版权声明
本文为[Wanmao Society]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221200491459.html
边栏推荐
- 刷了一千道选择题,我总结了这些C语言易错点【第二弹】
- Redis新版本发布,你还认为Redis是单线程?
- MySQL 5.0安装教程图解详细教程
- redis setex和set 的区别
- LeetCode 1678、设计 Goal 解析器
- Difference between redis setex and set
- The fourth play of MySQL learning - detailed explanation of multi table query classification and case exercise source code
- NFT, gamefi, socialfi, cloud storage, dfinity, the hottest track in ecology
- [in depth understanding of tcallusdb technology] data interface description for reading the specified location in the list - [list table]
- JS [detailed explanation] closure
猜你喜欢

【并发编程054】多线程的状态及转换过程?

Electrician Lecture 2

MySQL学习第四弹——多表查询分类以及案例练习源码详解

MySQL之父:代码应该一次写成,而不是后面再改
![【深入理解TcaplusDB技术】删除列表所有数据接口说明——[List表]](/img/ed/cccd5dee09d2f0a3e6c788bd265b36.png)
【深入理解TcaplusDB技术】删除列表所有数据接口说明——[List表]

canvas系列教程01——直线、三角形、多边形、矩形、调色板

Interpretation of tamigou project | 49.5% equity transfer of Beijing Hualong pawn Co., Ltd
![[concurrent programming 050] type and description of memory barrier?](/img/2b/9035c20c45f3f33c97639341315f72.png)
[concurrent programming 050] type and description of memory barrier?

CVPR2022 | 移动端手部三维重建

刷了一千道选择题,我总结了这些C语言易错点【第二弹】
随机推荐
一种自动切换过流保护模块的热泵装置保护电路介绍(ACS758/CH704应用案例)
[in depth understanding of tcallusdb technology] scan data interface description - [list table]
ThreadLocal
MySQL 5.0 installation tutorial illustration detailed tutorial
Case 4-1.4: path in the reactor (simulation establishment and simulation path of small top reactor)
zuul使用中的一些问题
Quantitative system development and quantitative trading system app construction
Codeforces Round #783 (Div. 2)
[concurrent programming 051] implementation principle of volatile memory semantics
腾讯云域名绑定
自动化测试的生命周期是什么?
Setting policy of thread pool size
build 知:Makefile
【并发编程051】volatile 内存语义的实现原理
1086 tree traversals again (25 points)
分布式监控CAT服务端的本地部署
【深入理解TcaplusDB技术】将数据插入到列表指定位置接口说明——[List表]
离职的互联网人,都去哪儿了?
Codeforces Round #783 (Div. 2)
Difference between redis setex and set