1 Star 0 Fork 11

root / goMontioringDdl

forked from qieangel2013 / goMontioringDdl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

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]

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

项目捐赠列表

空文件

简介

go 通过binlog实现监控ddl发送钉钉报警 展开 收起
Go
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/wjbjwang/goMontioringDdl.git
git@gitee.com:wjbjwang/goMontioringDdl.git
wjbjwang
goMontioringDdl
goMontioringDdl
master

搜索帮助

14c37bed 8189591 565d56ea 8189591