Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Implementation of Mysql data slicing with Mycat Middleware (part two)

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

9. Data is fragmented by node (DataNode)

[root@k8s01 conf] # vim schema.xml

[root@k8s01 conf] # vim rule.xml

Id: represents the field name

Count: indicates that the backend has 3 DataNode nodes

[root@k8s01 conf] #.. / bin/mycat restart

Stopping Mycat-server...

Stopped Mycat-server.

Starting Mycat-server...

[root@k8s01 conf] #

10. Verify that the data is sliced and stored

Verify the data:

K8s01 node:

K8s02 node:

K8s03 node:

11. Data is fragmented by field sharding-by-murmur (after Hash algorithm) (field type only supports 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] #

twelve。 Verify that the data is sliced and stored

Verify the data:

K8s01 node:

K8s02 node:

K8s03 node:

13. Data is fragmented by field crc32slot (after crc32 algorithm) (field type only supports 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. Verify that the data is sliced and stored

[root@k8s01 conf] # cat ruledata/crc32slot_hubei_T_WUHAN.properties-- View the data storage node after crc32 encryption

# WARNING! Please do not modify or delete this file!!!

# Sat Jan 04 14:20:03 CST 2020

2268266-102399

1144133-68265

0-34132

[root@k8s01 conf] #

Verify the data:

K8s01 node:

K8s02 node:

K8s03 node:

Mycat middleware implements Mysql data slicing (part I): http://blog.itpub.net/25854343/viewspace-2665474/

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report