Skip to content

Commit 0677261

Browse files
committed
adding sample.yaml
1 parent 16e0190 commit 0677261

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pip install py-mysql-elasticsearch-sync
3636
```
3737

3838
## Configuration
39-
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.
39+
There is a [sample config](https://github.com/zhongbiaodev/py-mysql-elasticsearch-sync/blob/master/src/sample.yaml) file in repo, you can start by editing it.
4040

4141
## Running
4242
Simply run command

src/sample.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# The mysql database which you want to sync
2+
mysql:
3+
host: 127.0.0.1
4+
port: 3306
5+
user: foo
6+
password: bar
7+
db: mydb
8+
table: mytable
9+
server_id: 1 # this should be unique
10+
11+
elastic:
12+
host: 127.0.0.1
13+
port: 9200
14+
bulk_size: 100
15+
index: article
16+
type: article
17+
18+
# If you want to map your column, put the column name as the value, and es field name as the key,
19+
# 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
20+
mapping:
21+
_id: myid
22+
es_field_name: mysql_column_name
23+
24+
# The log file's path
25+
logging:
26+
file: mylog.log
27+
28+
# The record file's path, which record the latest synced binlog file and position
29+
binlog_sync:
30+
record_file: binlog.info
31+
32+
# If you want to email notification when error occurs, fill this
33+
email:
34+
from: # the sender's email, uses smtp protocol
35+
host: smtp.example.com
36+
username: sender@example.com
37+
password: senderpassword
38+
to: # a list of notification recipients
39+
- first_recipient@example.com
40+
- second_recipient@example.com

0 commit comments

Comments
 (0)