tencent / tendbcluster-tdbctl Goto Github PK
View Code? Open in Web Editor NEWTdbctl is the control node of TenDB Cluster.
License: GNU General Public License v2.0
Tdbctl is the control node of TenDB Cluster.
License: GNU General Public License v2.0
MySQL [mysql]> select * from mysql.servers;
+-------------+-----------+----+----------+----------+-------+--------+---------+-------+
| Server_name | Host | Db | Username | Password | Port | Socket | Wrapper | Owner |
+-------------+-----------+----+----------+----------+-------+--------+---------+-------+
| SPIDER0 | 127.0.0.1 | | mysql | mysql | 25000 | | SPIDER | |
| SPT0 | 127.0.0.1 | | mysql | mysql | 20000 | | mysql | |
| SPT1 | 127.0.0.1 | | mysql | mysql | 20001 | | mysql | |
| TDBCTL0 | 127.0.0.1 | | mysql | mysql | 26000 | | TDBCTL | |
+-------------+-----------+----+----------+----------+-------+--------+---------+-------+
4 rows in set (0.000 sec)
MySQL [mysql]> tdbctl flush routing;
Query OK, 0 rows affected, 1 warning (0.001 sec)
MySQL [mysql]> show warnings;
+---------+-------+---------------------------------------+
| Level | Code | Message |
+---------+-------+---------------------------------------+
| Warning | 12028 | routing sql is null, flush do nothing |
+---------+-------+---------------------------------------+
1 row in set (0.000 sec)
shard_count
, shard_func
, shard_type
support for TDBCTL. Users can customize shard count, functions and types on TSpider.-- first, configure tdbctl routing
-- on tspider
set ddl_execute_by_ctl = on;
CREATE TABLE t1 (
id INT PRIMARY KEY,
vc VARCHAR(20)
)COMMENT 'shard_count "1", shard_func "crc32", shard_type "list"'
shard_count can be set with value 0, 1 or the number of backends. The default value is 0, meaning set shard_count as the number of backends.
WARNING, on current version, use customized shard_count = "1"
could trigger bugs on DDL
like ALTER TABLE
and DROP TABLE
.
shard_func can be set with crc32
, crc32_ci
, none
, which means PARTITION BY LIST(crc32(key))
, (crc32_ci(key))
and (key)
respectively. The default value is crc32. Note: crc32_ci means crc32 case ignore.
shard_type can be choosen from list
and range
. The default value is list
, which specifies partition type as list
.
shard_count
, shard_func
, shard_type
支持,用户可以在TSpider中指定这些参数。-- first, configure tdbctl routing
-- on tspider
set ddl_execute_by_ctl = on;
CREATE TABLE t1 (
id INT PRIMARY KEY,
vc VARCHAR(20)
)COMMENT 'shard_count "1", shard_func "crc32", shard_type "list"'
shard_count 的值可以为0, 1或者当前所有后端总数. 默认值是0,表示使用当前所有后端。
WARNING, 在现在的版本中,自定义shard_count = "1"
会在ALTER TABLE
和DROP TABLE
类的DDL
上触发bug.。
shard_func 的值可以为crc32
, crc32_ci
, none
, 分别表示PARTITION BY LIST(crc32(key))
, (crc32_ci(key))
和 (key)
. 默认值是crc32. 注意:crc32_ci
表示忽略大小写的crc32
。
shard_type 可以选择list
或者range
,默认值是list
, 制定了分区类别是list
。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.