goMontioringDdlgo 通过binlog实现监控ddl发送钉钉报警

联合创作 · 2023-09-30 23:47

goMontioringDdl 是通过go实现对binlog的订阅实现对mysql的ddl监控报警并发送钉钉报警!


安装



  • 安装 Go (1.6+) 设置并 GOPATH

  • 使用go get github.com/qieangel2013/goMontioringDdl

  • cd $GOPATH/src/github.com/qieangel2013/goMontioringDdl

  • go build main

  • ./main


怎么使用?



  • 创建mysql表.

  • 设置配置文件 river.toml.

  • 配置 ding_webhook_url 发送钉钉消息.

  • 设置mysql的源配置.

  • Start ./main.


注意



  • binlog 的格式必须为 row.

  • binlog row image 必须为 full .



源配置.


下面是源配置:


# MySQL data source
[[source]]
schema = "test"
tables = ["*"]

# MySQL data source
[[source]]
schema = "test_1"
tables = ["*", t4]
浏览 18
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报