Git Product home page Git Product logo

tencent / tendbcluster-tdbctl Goto Github PK

View Code? Open in Web Editor NEW
35.0 9.0 20.0 368.3 MB

Tdbctl is the control node of TenDB Cluster.

License: GNU General Public License v2.0

Shell 0.50% CMake 0.81% Makefile 0.11% C++ 60.70% C 35.98% Perl 0.06% Roff 0.13% M4 0.01% Emacs Lisp 0.01% Java 0.01% Python 0.07% CSS 0.01% HTML 0.01% Batchfile 0.01% Objective-C 1.32% Pascal 0.17% Assembly 0.01% PHP 0.03% RPC 0.01% NASL 0.04%

tendbcluster-tdbctl's Introduction

TenDB Cluster

TenDB Cluster is a MySQL distributed relational database solution developed and maintained by Tencent Game CROS DBA team. It consists of three core components: TSpider, TenDB and Tdbctl.

TSpider is the proxy layer of TenDB Cluster. It is a customized version developed by Tencent Game CROS DBA based on MariaDB 10.3.7. It mainly improves and customizes the distributed MySQL storage engine of spider; TSpider github page

TenDB is the data layer of TenDB Cluster. It is a customized MySQL branch developed by Tencent Game CROS DBA based on Percona Server 5.7.20. It provides some greate features internally for business operations; TenDB github page

Tdbctl is the control layer of TenDB Cluster. It is developed by Tencent Game CROS DBA team based on TenDB (mainly reuse TenDB's own SQL parsing capabilities and MGR capabilities). It is providing cluster routing management, cluster DDL operating, cluster monitoring and some other cluster capabilities. Tdbctl github page

Introduction to TenDB Cluster

TenDB Cluster is a MySQL distributed relational database solution developed and maintained by Tencent Game DBA team. The main features include: transparent database/table sharding, high-availability, online scaling. With these features, developers can focus on the development and operation of their product without caring about data sharding logic. Also, in the case of massive concurrency, there is no need to care about the load pressure of the DB storage layer.

Quick Start

More detail see chapter: Quick Deployment With Docker Compose

For details, see https://tendbcluster.com/

Flexible Deployment

It is recommended to use TSpider + TenDB + Tdbctl to deploy TenDB Cluster.
However, developers can also flexibly deploy TenDB Cluster according to their own online situation. Currently, companies use TSpider + Tencent Cloud RDS or TSpider + AWS RDS to deploy TenDB Cluster clusters.

Contact us

For any questions or discussions about TenDB Cluster, please feel free to give us feedback via issues:
TSpider: https://github.com/Tencent/TenDBCluster-TSpider/issues
TenDB: https://github.com/Tencent/TenDBCluster-TenDB/issues
Tdbctl: https://github.com/Tencent/TenDBCluster-Tdbctl/issues

Roadmap

For details, see chapter Roadmap

License

TenDBCluster is licensed under the GNU General Public License Version 2, except for the third-party components listed below. Copyright and license information can be found in the file TenDBCluster-License.

Acknowledgements

Thanks to MariaDB and Percona for their outstanding contributions to the MySQL open source ecosystem, it was on the shoulders of the predecessors that TenDB Cluster was born.
In addition, special thanks to the outstanding developers, contributors. For details, see https://tendbcluster.com/book-en/Documentation/acknowledgements-en.html

tendbcluster-tdbctl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tendbcluster-tdbctl's Issues

Customize sharding parameters in TenDBCluster

English
中文

New feature

  1. Add shard_count, shard_func, shard_type support for TDBCTL. Users can customize shard count, functions and types on TSpider.
    Exmaple:
-- 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.

新功能

  1. 增加了自定义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 TABLEDROP 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

Message is truncated when drop non-exists table

image
(I have four backend TenDB nodes)

When I drop a non-exists table, the Tdbctl node distribute command to Tspider and TenDB nodes. It's reasonable to show the all failed message, but it's truncated in the console.

routing sql is null, flush do nothing

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.