• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

goMontioringDdl: go 通过binlog实现监控ddl发送钉钉报警

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

goMontioringDdl

开源软件地址:

https://gitee.com/qieangel2013/goMontioringDdl

开源软件介绍:

goMontioringDdl 是go通过binlog实现对ddl监控发送钉钉消息

v1.0.1

1、添加对sql做优化建议效果图:

输入图片说明输入图片说明

Install

  • Install Go (1.6+) and set your GOPATH
  • go get github.com/qieangel2013/goMontioringDdl, it will print some messages in console, skip it. :-)
  • cd $GOPATH/src/github.com/qieangel2013/goMontioringDdl
  • go build main
  • ./main

How to use?

  • Create table in MySQL.
  • Config base, see the example config river.toml.
  • Config ding_webhook_url,send dinding message.
  • Set MySQL source in config file, see Source below.
  • Customize MySQL and Elasticsearch mapping rule in config file, see Rule below.
  • Start ./main and enjoy it.

Notice

  • binlog format must be row.
  • binlog row image must be full for MySQL, you may lost some field data if you update PK data in MySQL with minimal or noblob binlog row image. MariaDB only supports full row image.
  • Can not alter table format at runtime.
  • MySQL table which will be synced should have a PK(primary key), multi columns PK is allowed now, e,g, if the PKs is (a, b), we will use "a:b" as the key. The PK data will be used as "id" in Elasticsearch. And you can also config the id's constituent part with other column.
  • You should create the associated mappings in Elasticsearch first, I don't think using the default mapping is a wise decision, you must know how to search accurately.
  • mysqldump must exist in the same node with go-mysql-elasticsearch, if not, go-mysql-elasticsearch will try to sync binlog only.
  • Don't change too many rows at same time in one SQL.

Source

source config.

The format in config file is below:

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

如果你对我的辛勤劳动给予肯定,请给我捐赠,你的捐赠是我最大的动力

项目捐赠列表


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap