使用vigil 监控微服务系统包含可视化界面
1. 安装
a. rust cargo
cargo install vigil-server
b. docker
docker pull valeriansaliou/vigil:v1.3.0
2. 配置说明
使用起来需要的就是配置文件
config.cfg,配置还是比较简单的,从字面意思可以看明白了
一般内容参考如下:
# Vigil
# Microservices Status Page
# Configuration file
# Example: https://github.com/valeriansaliou/vigil/blob/master/config.cfg
[server]
log_level = "warn"
inet = "0.0.0.0:8080"
workers = 4
reporter_token = "appkey"
[assets]
path = "./res/assets/"
[branding]
page_title = "营销平台状态"
page_url = "http://101.200.137.80/"
company_name = "dalongrong"
icon_color = "#3C82E7"
icon_url = "https://avatars0.githubusercontent.com/u/2312287"
logo_color = "#3C82E7"
logo_url = "https://avatars0.githubusercontent.com/u/2312287"
website_url = "http://101.200.137.80"
support_url = "mailto:1141591465@qq.com"
custom_html = ""
[metrics]
poll_interval = 120
poll_retry = 2
poll_http_status_healthy_above = 200
poll_http_status_healthy_below = 400
poll_delay_dead = 30
poll_delay_sick = 10
push_delay_dead = 20
push_system_cpu_sick_above = 0.90
push_system_ram_sick_above = 0.90
[plugins]
[plugins.rabbitmq]
api_url = "http://127.0.0.1:15672"
auth_username = "rabbitmq-administrator"
auth_password = "RABBITMQ_ADMIN_PASSWORD"
virtualhost = "crisp"
queue_ready_healthy_below = 500
queue_nack_healthy_below = 100
[notify]
[notify.email]
from = "1141591465@qq.com"
to = "1141591465@qq.com"
smtp_host = "mail.qq.com"
smtp_port = 465
smtp_username = "1141591465@qq.com"
smtp_password = "youpassword"
smtp_encrypt = false
[probe]
[[probe.service]]
id = "api"
label = "营销平台api"
[[probe.service.node]]
id = "api"
label = "营销平台api"
mode = "poll"
replicas = [
"tcp://101.200.137.80:80",
"tcp://101.200.137.80:80"
]
[[probe.service.node]]
id = "help"
label = "核心帮助负载均衡"
mode = "poll"
replicas = ["tcp://101.200.137.80:81"]
[[probe.service.node]]
id = "api"
label = "访问api 地址"
mode = "poll"
replicas = ["http://101.200.137.80"]
[[probe.service.node]]
id = "status"
label = "爬虫状态"
mode = "poll"
replicas = ["http://101.200.137.80"]
http_body_healthy_match = "User-agent:.*"
[[probe.service]]
id = "relay"
label = "响应节点"
[[probe.service.node]]
id = "socket-client"
label = "实时im接口"
mode = "push"
rabbitmq_queue = "client"
3. 参考运行
├── Dockerfile
└── config.cfg
使用的是docker 进行的构建
Dockerfile
FROM valeriansaliou/vigil:v1.3.0
COPY config.cfg /etc/vigil.cfg
config.cfg 参考上面的配置,或者github 的源码
4. 参考界面
5. 参考资料
https://github.com/valeriansaliou/vigil
https://github.com/rongfengliang/vigildemo