forked from zhongbiaodev/py-mysql-elasticsearch-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.yaml
57 lines (49 loc) · 1.53 KB
/
sample.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# The mysql database which you want to sync
mysql:
host: host
port: port
user: user
password: password
db: db
server_id: 1 # this should be unique
character_set: utf8
elastic:
host: host
port: post
bulk_size: 200 # the update bulk size when mysqldump, default is 100 if not specified
binlog_bulk_size: 10 # the update bulk size when syncing binlog, default is 1 if not specified
# path to your own xml file, if you want to initialize dump from xml file. run with argument --fromfile in command
xml_file:
filename: a.xml
# 配置映射
table_mappings:
- mysql_table_name: keyword
es_index: test
es_type: _doc
middlewares:
- "middleware.keyword:process_id"
mapping:
_id: id
- mysql_table_name: user
es_index: user
es_type: _doc
mapping:
_id: id
middlewares:
# If you want to map your column, put the column name as the value, and es field name as the key,
# Particularly , if you set _id as follows, it will use myid column as the index doc's id, or ES will generate an id as default
# The log file's path
logging:
file: mylog.log
# The record file's path, which record the latest synced binlog file and position
binlog_sync:
record_file: binlog.info
# If you want to email notification when error occurs, fill this
email:
from: # the sender's email, uses smtp protocol
host: smtp.example.com
username: [email protected]
password: senderpassword
to: # a list of notification recipients