You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-7Lines changed: 41 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,30 +5,64 @@ Simple and fast MySQL to Elasticsearch sync tool, written in Python3.
5
5
This tool helps you to initialize MySQL dump table to Elasticsearch by parsing mysqldump, then incremental sync MySQL table to Elasticsearch by processing MySQL Binlog.
6
6
7
7
## Installation
8
+
By following these steps.
9
+
##### 1. Python
8
10
This tool is written in Python3.4, so you must install Python3.4 first, by following [this guide](https://docs.python.org/3.4/using/index.html)
11
+
##### 2. ibxml2 and libxslt
12
+
Also, this tool depends on python lxml package, so that you should install the lxml's dependecies correctly, the libxml2 and libxslt are required.
9
13
10
-
Also, this tool depends on python lxml package, in which you should install it correctly. (Attention, the lxml needs )
11
-
See [lxml Installation](http://lxml.de/installation.html)
There is a [sample config](https://github.com/zhongbiaodev/py-mysql-elasticsearch-sync/blob/master/sample.yaml) file in repo, you can start by editing it.
44
+
45
+
## Running
46
+
Simply run command
47
+
48
+
```
49
+
python3 main.py path/to/your/config.yaml
50
+
```
51
+
and the tool will dump your data as stream to sync, when dump is over, it will start to sync binlog.
52
+
53
+
the latest synced binlog file and position are recorded in your info file which is configured in your config file. You can restart dump step by remove it, or you can change sync position by edit it.
54
+
55
+
Or if you but want to load it from your own dumpfile. You should dump your table first as xml format(by adding ```-X```option to your mysqldump command)
0 commit comments