9.數(shù)據(jù)按節(jié)點(diǎn)(DataNode)分片
[root@k8s01 conf]# vim schema.xml
[root@k8s01 conf]# vim rule.xml
id:表示字段名
count:表示后端有3個(gè)DataNode節(jié)點(diǎn)
[root@k8s01 conf]# ../bin/mycat restart
Stopping Mycat-server...
Stopped Mycat-server.
Starting Mycat-server...
[root@k8s01 conf]#
10.驗(yàn)證數(shù)據(jù)分片后存放
驗(yàn)證數(shù)據(jù):
k8s01節(jié)點(diǎn):
k8s02節(jié)點(diǎn):
k8s03節(jié)點(diǎn):
11.數(shù)據(jù)按字段sharding-by-murmur(Hash算法后)分片(字段類(lèi)型只支持int,varchar)
[root@k8s01 conf]# vim schema.xml
[root@k8s01 conf]# vim rule.xml
[root@k8s01 conf]# ../bin/mycat restart
Stopping Mycat-server...
Stopped Mycat-server.
Starting Mycat-server...
[root@k8s01 conf]#
12.驗(yàn)證數(shù)據(jù)分片后存放
驗(yàn)證數(shù)據(jù):
k8s01節(jié)點(diǎn):
k8s02節(jié)點(diǎn):
k8s03節(jié)點(diǎn):
13.數(shù)據(jù)按字段crc32slot(crc32算法后)分片(字段類(lèi)型只支持int,varchar)
[root@k8s01 conf]# vim schema.xml
[root@k8s01 conf]# vim rule.xml
[root@k8s01 conf]# ../bin/mycat restart
Stopping Mycat-server...
Stopped Mycat-server.
Starting Mycat-server...
[root@k8s01 conf]#
14.驗(yàn)證數(shù)據(jù)分片后存放
[root@k8s01 conf]# cat ruledata/crc32slot_hubei_T_WUHAN.properties --查看crc32加密后數(shù)據(jù)存放節(jié)點(diǎn)
#WARNING !!!Please do not modify or delete this file!!!
#Sat Jan 04 14:20:03 CST 2020
2=68266-102399
1=34133-68265
0=0-34132
[root@k8s01 conf]#
驗(yàn)證數(shù)據(jù):
k8s01節(jié)點(diǎn):
k8s02節(jié)點(diǎn):
k8s03節(jié)點(diǎn):
Mycat中間件實(shí)現(xiàn)Mysql數(shù)據(jù)分片(上篇): http://blog.itpub.net/25854343/viewspace-2665474/