Skip to content

Commit

Permalink
add tidb node groups docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxsd committed Dec 16, 2024
1 parent d0c3afa commit ee7cc39
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 0 deletions.
4 changes: 4 additions & 0 deletions TOC-tidb-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@
- [Overview](/garbage-collection-overview.md)
- [Configuration](/garbage-collection-configuration.md)
- [Tune TiFlash Performance](/tiflash/tune-tiflash-performance.md)
- [Manage TiDB Node Groups]
- [Optimize Resource Allocation](/tidb-cloud/optimize-resource-allocation.md)
- [Overview of TiDB Node Group](/tidb-cloud/tidb-node-group-overview.md)
- [Manage TiDB Node Groups](/tidb-cloud/tidb-node-group-management.md)
- [Upgrade a TiDB Cluster](/tidb-cloud/upgrade-tidb-cluster.md)
- [Delete a TiDB Cluster](/tidb-cloud/delete-tidb-cluster.md)
- Migrate or Import Data
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/tidb-cloud/tidb-node-group-change-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/tidb-cloud/tidb-node-group-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/tidb-cloud/tidb-node-group-table-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/tidb-cloud/tidb-node-group-window-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions tidb-cloud/optimize-resource-allocation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Optimize Your Resource Allocation
summary: Learn about how to optimize your resource allocation in TiDB Cloud.
---

# Optimize Your Resource Allocation

As a Hybrid Transactional and Analytical Processing (HTAP) database, [TiDB Cloud Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-cloud-dedicated) clusters need to support multiple upper-level businesses in most scenarios. Different upper-level businesses have different requirements for database quality of service (QoS). In some scenarios, you might need to allocate as many resources as possible to high-priority businesses to ensure that the latency of these businesses is within an acceptable range.

Check warning on line 8 in tidb-cloud/optimize-resource-allocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Ambiguous] Consider using a clearer word than 'many' because it may cause confusion. Raw Output: {"message": "[PingCAP.Ambiguous] Consider using a clearer word than 'many' because it may cause confusion.", "location": {"path": "tidb-cloud/optimize-resource-allocation.md", "range": {"start": {"line": 8, "column": 375}}}, "severity": "INFO"}

TiDB Cloud Dedicated clusters provide resource optimization allocation capabilities including [Resource Control](/tidb-resource-control.md) and the [TiDB Node Group](/tidb-cloud/tidb-node-group-overview.md) feature (Private Beta), allowing you to allocate reasonable resources to different businesses in multi-business situations.

## Resource Control

[Resource Control](/tidb-resource-control.md) can divide the storage nodes (TiKV or TiFlash layer) of a TiDB Cloud Dedicated cluster into multiple logical groups. When there are mixed workloads in a system, you can put different workloads into separate resource groups. By doing this, you can ensure resource isolation for your applications and meet QoS requirements.

When the cluster encounters an unexpected SQL performance issue, you can use [SQL bindings](/sql-statements/sql-statement-create-binding.md) or [runaway queries](/tidb-resource-control.md#manage-queries-that-consume-more-resources-than-expected-runaway-queries) along with resource groups to temporarily limit the resource consumption of a SQL statement.

The rational use of the resource control feature can reduce the number of clusters, ease the difficulty of operation and maintenance, and save management costs.

## The TiDB Node Group feature

The [TiDB Node Group](/tidb-cloud/tidb-node-group-overview.md) feature (Private Beta) physically groups the computing nodes (TiDB layer) of a TiDB Cloud Dedicated cluster. Each group is configured with a number of TiDB nodes, achieving physical separation of computing resources between different groups.

You can divide computing nodes into multiple TiDB node groups according to different business needs, and configure unique connection endpoints for each TiDB node group. Upper-layer businesses access the cluster through their respective endpoints, and requests are assigned to the corresponding TiDB Node Group for execution. Even if resources in one TiDB node group are overused, businesses in other TiDB node groups will not be affected.

## Comparison between Resource Control and the TiDB Node Group feature

Depending on your application needs and budget constraints, you can use either resource control or the TiDB Node Group feature, or a combination of them, to achieve the desired resource isolation goals.

The following table lists the pros and cons of Resource Control and the TiDB Node Group feature.

| Comparison Item | Resource Control | TiDB Node Group |
|--------------------------|---------------------------|------------------------|
| Level of isolation | TiKV or TiFlash logical layer | TiDB node physical layer |
| Flow control | Control the flow of user read and write requests based on the quotas set for the resource groups. | Not supported. |
| Configuration experience | Use SQL statements to configure | Use the TiDB Cloud console to configure |
| How to distinguish different workloads | Resource Control supports binding the following level of resource to different resource groups to distinguish different workload: <br>- User level. <br>- Session level. Set the resource group for the current session. <br>- Statement level. Set the resource group for the current statement. | Provide different connection endpoints for different workloads. |
| Cost | No extra cost | Need cost for adding TiDB nodes. No extra cost for creating TiDB node groups. |
128 changes: 128 additions & 0 deletions tidb-cloud/tidb-node-group-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
title: Manage TiDB Node Groups
summary: Learn about how to manage TiDB node groups.

Check failure on line 2 in tidb-cloud/tidb-node-group-management.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.HeadingPunctuation] Don't put a period at the end of a heading. Raw Output: {"message": "[PingCAP.HeadingPunctuation] Don't put a period at the end of a heading.", "location": {"path": "tidb-cloud/tidb-node-group-management.md", "range": {"start": {"line": 2, "column": 51}}}, "severity": "ERROR"}
---

# Manage TiDB Node Groups

This document describes how to create TiDB node groups and their endpoints to isolate your business workload using the [TiDB Cloud console](https://tidbcloud.com/). It also shows how to view details of a TiDB node group.

> **Note**:
>
> Currently, the TiDB Node Group feature is only available upon request. To request this feature, click ? in the lower-right corner of the [TiDB Cloud console](https://tidbcloud.com/) and click Request Support. Then, fill in **Apply for TiDB Node Group feature** in the **Description** field and click **Submit**.
## Prerequisites

- You are using a [TiDB Cloud Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-cloud-dedicated) cluster on AWS. The TiDB Node Group feature is **NOT** available for TiDB Cloud Serverless clusters.
- You are in the **Organization Owner** or **Project Owner** role of your organization. For more information, see [User roles](/tidb-cloud/manage-user-access.md#user-roles).

## Terms

- TiDB Node Group: TiDB node group manages the grouping of TiDB nodes and maintains the mapping between endpoints and TiDB nodes.

- Each TiDB node group has an independent endpoint.
- When you delete a TiDB node group, the related network setting (such as private link and IP access list) will be deleted too.

- Default Group: When a cluster created, a default TiDB node group is created. Therefore, each cluster has a default group. The default group can not be deleted.

## Create a TiDB node group

> **Note**:
>
> If you create a TiDB node group but still use the endpoint of the default group to connect the cluster, the TiDB nodes in the new node group will not take any workload, which is a waste of the resource.
1. In the [TiDB Cloud console](https://tidbcloud.com/), navigate to the [**Cluster**](https://tidbcloud.com/console/clusters) page of your project.
2. Click **...** in the upper-right corner.
3. Click **Modify** in the drop-down menu. The **Modify Cluster** page is displayed.
4. On the **Modify Cluster** page, click + to add a new TiDB node group as follows.

- TiDB
- **vCPU + RAM**: choose the [TiDB size](/tidb-cloud/size-your-cluster.md#size-tidb) you need.
- **Node Groups**: enter the number of TiDB nodes in the Default Groups field. You can also create new node groups by clicking +.
- TiKV
- **vCPU + RAM**: choose the [TiKV size](/tidb-cloud/size-your-cluster.md#size-tikv) you need.
- **Storage X Nodes**: choose the storage size and the number of TiKV nodes.

![Create TiDB Node Group](/media/tidb-cloud/tidb-node-group-create.png)

5. New TiDB nodes will be added with the new TiDB node group. The billing of the cluster will change. Review the cluster size in the right pane, and then click **Confirm**.

## Connect to the new TiDB node group

### Connect via Public Endpoint

Public Endpoint for the new TiDB node group is disabled by default. You need to enable it first.

To enable Public Endpoint, do the following:

1. Navigate to the [**Cluster**](https://tidbcloud.com/console/clusters) page.
2. Click **Connect** in the upper-right corner. A connection dialog is displayed.
3. Choose the new TiDB node group and public connection type.
4. Visit the **Networking** page and select the new node group.
5. Enable the Public Endpoint and add the IP access list.
6. Click **Connect** on the up-right of the page and you can get the connection string.

![Connect to the new TiDB node group via Public Endpoint](/media/tidb-cloud/tidb-node-group-connect-public-endpoint.png)

### Connect via Private Endpoint

1. Navigate to the [**Cluster**](https://tidbcloud.com/console/clusters) page.
2. Click **Connect** in the upper-right corner. A connection dialog is displayed.
3. Choose the new TiDB node group and public connection type.
4. Visit the **Networking** page and select the new node group.
5. Click **Create Private Endpoint Connection** to create a new connection for this node group. For more information, see [Connect to a TiDB Cloud Dedicated Cluster via Private Endpoint with AWS](/tidb-cloud/set-up-private-endpoint-connections.md).

> **Note**:
>
> If you use Private Link to connect different node groups, you need to create separated Private Endpoint Connection for each node group.
6. After you create the Private Endpoint Connection, click **Connect** on the up-right of the page to get the connection string.

### Connect via VPC Peering

Because the cluster is in one VPC and all the TiDB node groups share the same VPC, you only need to create one VPC Peering, then all the groups can use it.

1. Follow the instrcutions in [Connect to TiDB Cloud Dedicated via VPC Peering](/tidb-cloud/set-up-vpc-peering-connections.md) to create a VPC Peering for this cluster.
2. Click **Connect** on the up-right of the **Networking** page to get the connection string.

### View the TiDB node groups

1. Navigate to the [**Cluster**](https://tidbcloud.com/console/clusters) page.
2. Click **Nodes** in the left pane.

![TiDB node group window view](/media/tidb-cloud/tidb-node-group-window-view.png)

**You can also click the button highlighted in the screenshot to switch to table view.**

![TiDB node group table view](/media/tidb-cloud/tidb-node-group-table-view.png)

## Modify the TiDB node group

### Change the group name

1. Navigate to the [**Cluster**](https://tidbcloud.com/console/clusters) overview page.
2. Click **Nodes** in the left pane.
3. Click the edit icon hilighted in the screenshot to change the name of the TiDB node group.

![Change TiDB node group name](/media/tidb-cloud/tidb-node-group-change-name.png)

### Change the number of TiDB nodes

1. Navigate to the [**Cluster**](https://tidbcloud.com/console/clusters) page.
2. Click **Nodes** in the left pane.
3. Click **Modify**.
4. On the **Modify Cluster** page, update the number of TiDB nodes, or add new TiDB node groups.

![Change TiDB node group node count](/media/tidb-cloud/tidb-node-group-change-name.png)

### Delete the TiDB node group

> **Warning**:
>
> Deleting the groups (new-group) will also remove the nodes and associated network configurations, including private endpoint connections and the IP list for public access.
1. Navigate to the [Cluster](https://tidbcloud.com/console/clusters) overview page.
2. Click **Nodes** in the left pane.
3. Click **Modify**.
4. On the **Modify Cluster** page, click the delete icon to delete the TiDB node groups.

![Delete the TiDB node group](/media/tidb-cloud/tidb-node-group-delete.png)
53 changes: 53 additions & 0 deletions tidb-cloud/tidb-node-group-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: TiDB Node Group overview
summary: Learn about the overview of the TiDB Node Group feature.
---

# TiDB Node Group overview

TiDB Cloud lets you create TiDB node groups for TiDB Cloud Dedicated clusters. A TiDB node group physically groups the computing nodes (TiDB layer) of the cluster, each group is configured with a number of TiDB nodes. It provides a physical isolation of computing resources between different groups, allowing you to allocate reasonable resources to different businesses in multi-business situations.

With TiDB node groups, you can divide computing nodes into multiple TiDB node groups according to different business needs, and configure unique connection endpoints for each TiDB node group. Upper-layer businesses access the cluster through their respective endpoints, and requests are assigned to the corresponding TiDB node group for execution. Even if resources in one TiDB node group are overused, businesses in other TiDB node groups will not be affected.

## Implementations

TiDB node group can manage the grouping of TiDB nodes and maintain the mapping between endpoints and TiDB nodes.

For each TiDB node group, there is a dedicated load balancer created. When a user executes a SQL request to the endpoint of a TiDB node group, the request first passes through the load balancer deployed the group, and then the load balancer distributes the request only to the TiDB nodes in this group.

The following diagram shows the implementations of the TiDB Node Group feature

![The implementations of the TiDB Node Group feature](/media/tidb-cloud/implementation-of-tidb-node-group.png)

All nodes in a TiDB node group respond to requests coming from the cooresponding endpoint. You can do the following:

- Create a TiDB node group and assign TiDB nodes to the group.
- Set up connection endpoints for each group. The following three connection types are supported by TiDB node group's endpoints: public connection, private endpoint and VPC peering.
- Let the applications send requests to different groups through different endpoints to achieve resource isolation.

## Scenarios

The introduction of the TiDB Node Group feature is a big improvement for resource allocation of TiDB Cloud Dedicate clusters. TiDB nodes are for computing only and do not store data. TiDB node groups can divide TiDB nodes into multiple physical groups. Even if resources in one TiDB node group are overused, businesses in other TiDB node groups will not be affected.

With this feature, you can:

- Combine multiple applications from different systems into a single TiDB Cloud Dedicated cluster. When the workload of an application grows larger, it does not affect the normal operation of other applications. By using the TiDB node group feature , you can ensure that the response time of transactional applications is not affected by data analysis or batch applications.
- Do import or DDL tasks anytime for TiDB Cloud Dedicated cluster without concern about the performance impact for existing production workload. You can create separate TiDB node group for importing or DDL tasks. Even though importing or DDL tasks take a lot of CPU or memory resource, they only use the resource in their own TiDB node group, and the workload in other TiDB node group will not be impacted.

Check warning on line 35 in tidb-cloud/tidb-node-group-overview.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Ambiguous] Consider using a clearer word than 'a lot' because it may cause confusion. Raw Output: {"message": "[PingCAP.Ambiguous] Consider using a clearer word than 'a lot' because it may cause confusion.", "location": {"path": "tidb-cloud/tidb-node-group-overview.md", "range": {"start": {"line": 35, "column": 254}}}, "severity": "INFO"}
- Choose to combine all test environments into a single TiDB cluster, or group the batch tasks that consume more resources into a TiDB node group. It can improve hardware utilization and reduce operating costs while ensuring that critical applications can always get the necessary resources.

In addition, TiDB node groups are easily scaled in or out. For key applications with high performance requirments, you can plan enough TiDB nodes in the group. For applications that do not have high performance requirements, you can start with a small number of TiDB nodes and scale out when necessary. The rational use of the TiDB Node Group feature can reduce the number of clusters, ease the difficulty of operation and maintenance, and save management costs.

Check warning on line 38 in tidb-cloud/tidb-node-group-overview.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Ambiguous] Consider using a clearer word than 'enough' because it may cause confusion. Raw Output: {"message": "[PingCAP.Ambiguous] Consider using a clearer word than 'enough' because it may cause confusion.", "location": {"path": "tidb-cloud/tidb-node-group-overview.md", "range": {"start": {"line": 38, "column": 129}}}, "severity": "INFO"}

Check failure on line 38 in tidb-cloud/tidb-node-group-overview.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Spacing] 'y. T' should have one space. Raw Output: {"message": "[PingCAP.Spacing] 'y. T' should have one space.", "location": {"path": "tidb-cloud/tidb-node-group-overview.md", "range": {"start": {"line": 38, "column": 301}}}, "severity": "ERROR"}

## Limitations and quotas

Currently, the TiDB Node Group feature is in beta and free of charge.

- You can only create TiDB node groups for TiDB Cloud Dedicated clusters on AWS. It is planned to support this feature for other cloud providers in near future.
- Clusters with TiDB 4 vCPU 16 Mem do not support the TiDB Node Group feature.
- For a TiDB Cloud Dedicated cluster, you can create a maximum of five TiDB node groups by default. If you need more groups, contact [TiDB Cloud Support](/tidb-cloud/tidb-cloud-support.md).
- Each TiDB node group must have at least one TiDB node. The maximum node count of a group is not limited. However, the total TiDB nodes in a TiDB Cloud Dedicated cluster must be fewer than 150.

## SLA impact

According to TiDB Cloud [Service Level Agreement (SLA)](https://www.pingcap.com/legal/service-level-agreement-for-tidb-cloud-services/), the Monthly Uptime Percentage of TiDB Cloud Dedicated clusters with multiple TiDB nodes deployment can be up to 99.99%. However, after introducing the TiDB Node Group feature, TiDB Cloud can not provide high availability across TiDB node groups. If you create multiple TiDB node groups with only one TiDB node in each group, you will lose the high availability for the groups and your cluster's monthly uptime percentage will downgrade to a single TiDB node deployment model.

For high availability, it is recommended that you configure at least two TiDB nodes for each TiDB node group.

0 comments on commit ee7cc39

Please sign in to comment.