forked from pingcap/tidb-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_sharding.toml
93 lines (72 loc) · 2.08 KB
/
config_sharding.toml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# diff Configuration.
log-level = "info"
# for example, the whole data is [1...100]
# we can split these data to [1...10], [11...20], ..., [91...100]
# the [1...10] is a chunk, and it's chunk size is 10
# size of the split chunk
chunk-size = 1000
# how many goroutines are created to check data
check-thread-count = 4
# sampling check percent, for example 10 means only check 10% data
sample-percent = 100
# calculate the data's checksum, and compare data by checksum.
use-checksum = true
# the name of the file which saves sqls used to fix different data
fix-sql-file = "fix.sql"
# tables need to check.
[[check-tables]]
# schema name in target database.
schema = "test"
# table list which need check in target database.
# in sharding mode, you must set config for every table in table-config, otherwise will not check the table.
tables = ["test"]
# schema and table in check-tables must be contained in check-tables.
# a example for sharding tables.
[[table-config]]
# target schema name.
schema = "test"
# target table name.
table = "test"
# field should be the primary key, unique key or field with index.
# if comment this, diff will find a suitable field.
# index-field = "id"
# check data's range.
# range = "age > 10 AND age < 20"
# set true if comparing sharding tables with target table
is-sharding = true
# source tables.
[[table-config.source-tables]]
instance-id = "source-1"
schema = "test"
table = "test1"
[[table-config.source-tables]]
instance-id = "source-1"
schema = "test"
table = "test2"
[[table-config.source-tables]]
instance-id = "source-2"
schema = "test"
table = "test3"
[[source-db]]
host = "127.0.0.1"
port = 3306
user = "root"
password = ""
instance-id = "source-1"
# remove comment if use tidb's snapshot data
# snapshot = "2016-10-08 16:45:26"
[[source-db]]
host = "127.0.0.2"
port = 3306
user = "root"
password = ""
instance-id = "source-2"
# remove comment if use tidb's snapshot data
# snapshot = "2016-10-08 16:45:26"
[target-db]
host = "127.0.0.1"
port = 4000
user = "root"
password = ""
# remove comment if use tidb's snapshot data
# snapshot = "2016-10-08 16:45:26"