1. Download the source code https://github.com/chenqunhui/cat.git
(1) Modified several bugs of URL encode;
(2) Use ${and} to replace & in the code in the SMS alarm; it is allowed to use ${and} in the content to connect parameters to achieve the effect of &;
2. Install using the setting.xml specified in the directory:
Note: The maven version must be above 3.2.3;
cd cat
mvn clean install --settings settings.xml -DskipTests
3. Post
(1) Create the following two directories (windows environment is created in the root directory of the disk where tomcat is located)
/data/appdatas/cat
/data/applogs/cat
(2) Copy the configuration file (see attachment) to the /data/appdatas/cat directory,
a. Modify the database configuration of dataSource.xml;
b. Modify the configuration of server.xml; if there are multiple cats, set one of them to hdfs-machine="true" job-machine="true" alert-machine="true", and set all others to false;
<config local-mode="false" hdfs-machine="true" job-machine="true" alert-machine="true"> <storage local-base-dir="/data/appdatas/cat/bucket/" max-hdfs-storage-time="15" local-report-storage-time="7" local-logivew-storage-time="7"> <hdfs id="logview" max-size="128M" server-uri="hdfs://127.0.0.1:9000/user/cat" base-dir="logview"/> <hdfs id="dump" max-size="128M" server-uri="hdfs://127.0.0.1:9000/user/cat" base-dir="dump"/> <hdfs id="remote" max-size="128M" server-uri="hdfs://127.0.0.1:9000/user/cat" base-dir="remote"/> </storage> <console default-domain="Cat" show-cat-domain="true"> <remote-servers>127.0.0.1:8080</remote-servers> </console> </config>
(3) Copy cat-home/target/cat-alpha-1.4.0.war to the webapps of tomcat, rename it to cat, and start tomcat;
4: Open localhost:8080/cat/r. If the cat monitoring page is displayed normally, the configuration is successful.
5. Configure client routing
Click the "Configuration" function at the upper right, log in using catadmin/catadmin, and enter the menu on the left: Global Alarm Configuration - Client Routing.
<!-- backup-server configure the machine set to jobmachine=true, other machines are configured as default-sertver--> <router-config backup-server="10.10.1.75" backup-server-port="2280"> <default-server id="10.10.1.75" weight="1.0" port="2280" enable="true"/> </router-config>