網(wǎng)站:www.wgstart.com
這是v3.2.2的server配置文件,在/server/config/application.yml,yml格式記得冒號后跟一個空格
server:
port: 9999
servlet:
session:
timeout: 30m
context-path: /wgcloud
#日志文件輸出路徑
logging:
path: ./log
# 數(shù)據(jù)庫 相關設置
spring:
application:
name: wgcloud-server
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/wgcloud?characterEncoding=utf-8&characterSetResults=utf8&autoReconnect=true&useSSL=false&allowMultiQueries=true
username: root
password: mysql
hikari:
validationTimeout: 3000
connectionTimeout: 60000
idleTimeout: 60000
minimumIdle: 10
maximumPoolSize: 10
maxLifeTime: 60000
connectionTestQuery: select 1
mvc:
static-path-pattern: /static/**
thymeleaf:
cache: false
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
#自定義配置參數(shù)
base:
#登陸賬號admin的密碼
admindPwd: 111111
#通信token,agent端和此保持一致
wgToken: wgcloud
#是否開啟公眾看板,yes開啟,no關閉,公眾看板頁面無需登陸
dashView: yes
#數(shù)據(jù)表監(jiān)控間隔,單位秒,默認60分鐘
dbTableTimes: 3600
#服務接口監(jiān)控間隔,單位秒,默認10分鐘
heathTimes: 600
#監(jiān)控數(shù)據(jù)保留天數(shù),默認10天
historyDataOut: 10
#節(jié)點類型,master或slave,一個集群只能有一個master和N個slave
nodeType: master
#告警配置
mail:
#告警郵件總開關,yes開啟,no關閉
allWarnMail: yes
#監(jiān)控主機內(nèi)存使用率%報警值,超過此值即發(fā)送郵件報警
memWarnVal: 98
#監(jiān)控主機cpu使用率%報警值,超過此值即發(fā)送郵件報警
cpuWarnVal: 98
#磁盤使用率%報警值,超過此值即發(fā)送郵件報警
diskWarnVal: 98
#不需要告警磁盤在此屏蔽,多個盤符用,隔開,如/boot,/dev
diskBlock: /dev
#內(nèi)存告警郵件,yes開啟,no關閉。總開關開啟后,此處設置才會生效。以下開關均遵循此規(guī)則。
memWarnMail: yes
#CPU告警郵件,yes開啟,no關閉
cpuWarnMail: yes
#磁盤使用率告警郵件,yes開啟,no關閉
diskWarnMail: yes
#主機下線告警郵件,yes開啟,no關閉
hostDownWarnMail: yes
#進程下線告警郵件,yes開啟,no關閉
appDownWarnMail: yes
#服務接口告警郵件,yes開啟,no關閉
heathWarnMail: yes
#數(shù)據(jù)源連接失敗,告警郵件,yes開啟,no關閉
dbDownWarnMail: yes
#告警腳本文件,可以為空,參考:/server/template/sendMsg.sh
warnScript:
基礎配置base
1.初次安裝只需要修改mysql連接信息就可以了。其他保持默認即可。
2.端口修改,9999可以改為自己的自定義端口,此端口是server訪問的端口
3.admindPwd,這個是admin的登陸密碼,在公網(wǎng)運行時候記得修改
4.wgToken,這個是agent和server通信的密鑰,記得保持一致
5.dashView,這個是公眾看板,游客不需要登陸就可以瀏覽
6.dbTableTimes,數(shù)據(jù)表數(shù)據(jù)監(jiān)控時間間隔,單位秒,默認60分鐘
7.heathTimes,服務接口監(jiān)控時間將,單位秒,默認60分鐘
8.historyDataOut,監(jiān)控數(shù)據(jù)的過期時間,默認10天
9.nodeType,節(jié)點類型默認是master,這是做集群用的,如果是單節(jié)點server運行此處保持默認即可。如果是集群模式運行,只能有一個master和N個slave
告警設置mail
1.allWarnMail,告警郵件總開關,此處關閉時候,所有告警指標都不會告警
2.memWarnVal,主機內(nèi)存使用率告警閾值,可以>100
3.cpuWarnVal,主機cpu使用率告警閾值,可以>100
4.diskWarnVal,磁盤使用率告警閾值
5.diskBlock,不需告警的磁盤在此屏蔽,多個盤符用,隔開,如/boot,/dev
6.memWarnMail,內(nèi)存告警是否開啟
7.cpuWarnMail,cpu告警是否開啟
8.diskWarnMail,磁盤告警是否開啟
9.hostDownWarnMail,主機下線告警是否開啟
10.appDownWarnMail,進程下線告警是否開啟
11.heathWarnMail,服務接口失敗告警是否開啟
12.dbDownWarnMail,數(shù)據(jù)源連接失敗告警是否開啟
13.warnScript,告警腳本文件,可以為空,可以在腳本中實現(xiàn)微信釘釘短信等告警,安裝包有參考參考:/server/template/sendMsg.sh,內(nèi)容如下,$1即告警內(nèi)容,告警腳本是否執(zhí)行遵從以上告警配置,如果有配置郵件,先發(fā)送郵件再執(zhí)行告警腳本,如果沒有配置郵件,直接執(zhí)行告警腳本
#!/bin/sh
content=$1
echo "warn content is : $1"
agent端口的配置文件相對簡單,在此不再描述,官網(wǎng)有詳細說明。