切换主题
服务端配置说明
本节介绍通用监控系统服务端的主要配置项,帮助您快速完成部署和参数调整。所有配置均可通过 YAML 文件或环境变量灵活设置。
配置文件示例
yaml
server:
port: 9896 #服务端口
name: monitor-server #应用名称
log:
level: info
db:
uri: server_monitor:123456@tcp(127.0.0.1:3306)/server_monitor?charset=utf8mb4&parseTime=True&loc=Asia%2fShanghai #数据库连接
max-open-conns: 200 #最大连接数
max-idle-conns: 10 #最大空闲连接数
auth:
jwt-secret: "wueasy-monitor-jwt-secret" #jwt密钥
codes:
- code: "readonly"
role: "readonly" #只读权限
- code: "edit"
role: "edit" #编辑权限
monitor-codes: #监控服务授权码
- wueasy.com
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
配置项说明
server
参数名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
port | int | 是 | 9896 | 服务端口 |
name | string | 是 | monitor-server | 应用名称 |
log
参数名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
level | string | 否 | info | 日志级别(info/debug/warn/error) |
db
参数名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
uri | string | 是 | - | 数据库连接串 |
max-open-conns | int | 否 | 200 | 最大连接数 |
max-idle-conns | int | 否 | 10 | 最大空闲连接数 |
auth
参数名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
jwt-secret | string | 是 | - | JWT密钥 |
codes | array | 否 | - | 权限码配置 |
codes 子项
字段 | 类型 | 说明 |
---|---|---|
code | string | 授权码 |
role | string | 权限角色 |
monitor-codes
参数名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
monitor-codes | array | 否 | - | 监控服务授权码 |