GithubHelp home page GithubHelp logo

lekaijun / mysqlsmom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m358807551/mysqlsmom

0.0 2.0 0.0 5.43 MB

同步mysql数据到elasticsearch的工具,功能丰富,用法简单,配置灵活,扩展性强;

Python 100.00%

mysqlsmom's Introduction

Alt text

简介

一个 同步 Mysql 数据到 Elasticsearch的工具,特色是支持分析 binlog 做实时增量同步,以及支持编写自定义逻辑处理数据后再同步到 es。

纯 Python 编写,运行 mysqlsmom 的唯三要求:

  • python2.7
  • redis
  • Mysql 配置 binlog-format=row

中文文档地址:https://mysqlsmom.readthedocs.io/en/latest/

快速开始

从一个全量同步开始。

安装

pip install mysqlsmom

然后指定 elasticsearch 版本(默认支持2.4),支持其它版本请运行(将5.4换成需要的elasticsearch版本)

pip install --upgrade elasticsearch==5.4

设置同步配置

创建全量同步配置文件

mom new test_mom/init_config.py -t init --force

此时的目录结构

└── test_mom
    └── init_config.py

编辑同步配置

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 运行同步的用户 无需 更新代码,稍后加入对升级步骤的详细说明。

mysqlsmom's People

Contributors

m358807551 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.