![Alt text](https://github.com/m358807551/images/blob/master/images/mysqlsmom/mysqlsmom_red.png?raw=true)
## 简介
一个 同步 Mysql 数据到 Elasticsearch的工具,特色是支持分析 binlog 做实时增量同步,以及支持编写自定义逻辑处理数据后再同步到 es。
纯 Python 编写,运行 mysqlsmom 的唯三要求:
* python2.7
* redis
* *Mysql* 配置 *binlog-format=row*
中文文档地址:https://mysqlsmom.readthedocs.io/en/latest/
## 快速开始
从一个全量同步开始。
### 安装
```shell
pip install mysqlsmom
```
然后指定 elasticsearch 版本(默认支持2.4),支持其它版本请运行(将5.4换成需要的elasticsearch版本)
```shell
pip install --upgrade elasticsearch==5.4
```
### 设置同步配置
创建全量同步配置文件
```shell
mom new test_mom/init_config.py -t init --force
```
此时的目录结构
```shell
└── test_mom
└── init_config.py
```
编辑同步配置
```shell
vim ./test_mom/init_config.py # 按注释提示修改配置
```
### 开始同步
```
mom run -c ./test_mom/init_config.py
```
等待同步完成即可。
### 注意
全量同步完成后不会自动增量同步新修改的数据,需要增量同步请查看全部文档中的增量同步部分。
## 版本升级
本次更新只是加入了对 pip install mysqlsmom 以及 命令行的支持,关键代码并无任何改动。
通过旧版本 git clone 和 python mysqlsmom.py ./config/xxx.py 运行同步的用户 **无需** 更新代码,稍后加入对升级步骤的详细说明。
没有合适的资源?快使用搜索试试~ 我知道了~
Python-同步mysql数据到elasticsearch的工具
共84个文件
js:12个
png:10个
py:10个
4星 · 超过85%的资源 需积分: 28 14 下载量 63 浏览量
2019-08-10
03:54:56
上传
评论
收藏 5.35MB ZIP 举报
温馨提示
同步mysql数据到elasticsearch的工具,功能丰富,用法简单,配置灵活,扩展性强;
资源推荐
资源详情
资源评论
收起资源包目录
Python-同步mysql数据到elasticsearch的工具.zip (84个子文件)
mysqlsmom-master
mysqlsmom
row_filters.py 244B
row_handlers.py 3KB
mysqlsmom.py 15KB
__init__.py 0B
template
init.py 1KB
__init__.py 0B
cron.py 1KB
binlog.py 1KB
setup.py 1KB
README.md 2KB
README_OLD.md 11KB
docs
source
hello.md 15KB
conf.py 5KB
index.rst 451B
make.bat 781B
build
html
index.html 9KB
search.html 5KB
searchindex.js 17KB
hello.html 55KB
_sources
hello.md.txt 15KB
index.rst.txt 451B
.buildinfo 230B
genindex.html 5KB
objects.inv 277B
_static
underscore-1.3.1.js 34KB
basic.css 10KB
comment-close.png 829B
up.png 203B
jquery-3.2.1.js 262KB
documentation_options.js 276B
js
modernizr.min.js 15KB
theme.js 4KB
minus.png 90B
pygments.css 4KB
down-pressed.png 222B
jquery.js 85KB
comment.png 641B
file.png 286B
plus.png 90B
searchtools.js 25KB
underscore.js 12KB
fonts
Lato
lato-italic.woff 321KB
lato-bold.eot 250KB
lato-regular.ttf 593KB
lato-regular.woff2 178KB
lato-bolditalic.woff 316KB
lato-regular.eot 248KB
lato-italic.ttf 624KB
lato-bold.woff 302KB
lato-italic.woff2 191KB
lato-bolditalic.woff2 189KB
lato-bold.ttf 587KB
lato-bolditalic.eot 260KB
lato-regular.woff 302KB
lato-bold.woff2 181KB
lato-italic.eot 262KB
lato-bolditalic.ttf 608KB
fontawesome-webfont.svg 434KB
fontawesome-webfont.woff2 75KB
fontawesome-webfont.eot 162KB
RobotoSlab
roboto-slab-v7-bold.ttf 167KB
roboto-slab-v7-regular.eot 76KB
roboto-slab-v7-bold.woff 86KB
roboto-slab-v7-regular.ttf 165KB
roboto-slab-v7-bold.woff2 66KB
roboto-slab-v7-bold.eot 78KB
roboto-slab-v7-regular.woff 84KB
roboto-slab-v7-regular.woff2 65KB
fontawesome-webfont.woff 96KB
fontawesome-webfont.ttf 162KB
websupport.js 25KB
up-pressed.png 214B
translations.js 5KB
css
badge_only.css 3KB
theme.css 114KB
doctools.js 9KB
ajax-loader.gif 673B
down.png 202B
comment-bright.png 756B
doctrees
environment.pickle 13KB
hello.doctree 60KB
index.doctree 5KB
Makefile 610B
.gitignore 1KB
共 84 条
- 1
资源评论
- 晓码哥2022-07-12选中星级可使用快捷评论
weixin_39840924
- 粉丝: 490
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功