From 7805012eacb119643713e5fe4415f3dd27d4c23f Mon Sep 17 00:00:00 2001 From: Bisheng Huang Date: Fri, 4 Dec 2026 16:40:15 +0800 Subject: [PATCH] best-practices: retire read-only storage node guidance Remove the dedicated read-only storage node deployment guide from current best practices because this deployment pattern is no longer actively recommended as a general solution. Remove its navigation entries and system-variable cross-reference. Preserve the v6.6.0 release announcement and point its two links to the archived v6.6 guide. Signed-off-by: Bisheng Huang --- TOC-best-practices.md | 1 - best-practices/_index.md | 3 +- best-practices/readonly-nodes.md | 124 ------------------------------- releases/release-6.6.0.md | 4 +- system-variable-reference.md | 1 - 5 files changed, 3 insertions(+), 130 deletions(-) delete mode 100644 best-practices/readonly-nodes.md diff --git a/TOC-best-practices.md b/TOC-best-practices.md index aa9299436e768..e7ca1db0c4b07 100644 --- a/TOC-best-practices.md +++ b/TOC-best-practices.md @@ -24,7 +24,6 @@ ## Operations - [Use HAProxy for Load Balancing](/best-practices/haproxy-best-practices.md) -- [Use Read-Only Storage Nodes](/best-practices/readonly-nodes.md) - [Monitor TiDB Using Grafana](/best-practices/grafana-monitor-best-practices.md) ## Performance Tuning diff --git a/best-practices/_index.md b/best-practices/_index.md index afa2249976986..1d51f0a484118 100644 --- a/best-practices/_index.md +++ b/best-practices/_index.md @@ -44,12 +44,11 @@ Find operational best practices for running TiDB in production, such as traffic | Best practice topic | Description | | ------------------- | ----------- | | [Use HAProxy for Load Balancing](/best-practices/haproxy-best-practices.md) | Best practices for configuring HAProxy to distribute application traffic across multiple TiDB nodes. | -| [Use Read-Only Storage Nodes](/best-practices/readonly-nodes.md) | Best practices for using read-only nodes to isolate analytical or heavy read workloads from OLTP traffic. | | [Monitor TiDB Using Grafana](/best-practices/grafana-monitor-best-practices.md) | Best practices for using key metrics and dashboard configurations for proactive troubleshooting. | ## Performance tuning -Understand how to tune TiDB components such as TiKV and PD, and how to use features like read-only storage nodes to improve performance under different workloads. +Understand how to tune TiDB components such as TiKV and PD to improve performance under different workloads. | Best practice topic | Description | | ------------------- | ----------- | diff --git a/best-practices/readonly-nodes.md b/best-practices/readonly-nodes.md deleted file mode 100644 index 6fef118657e61..0000000000000 --- a/best-practices/readonly-nodes.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: Best Practices for Read-Only Storage Nodes -summary: This document introduces configuring read-only storage nodes for isolating high-tolerance delay loads from online services. Steps include marking TiKV nodes as read-only, using Placement Rules to store data on read-only nodes as learners, and using Follower Read to read data from read-only nodes. -aliases: ['/tidb/stable/readonly-nodes/','/tidb/dev/readonly-nodes/'] ---- - -# Best Practices for Read-Only Storage Nodes - -This document introduces how to configure read-only storage nodes and how to direct backup, analysis, testing, and other traffic to these nodes. In this way, loads with high tolerance for delay can be physically isolated from important online services. - -## Procedures - -### 1. Specify some TiKV nodes as read-only - -To specify some TiKV nodes as read-only, you can mark these nodes with a special label (use `$` as the prefix of the label key). Unless you explicitly specify these nodes to store some data using Placement Rules, PD does not schedule any data to these nodes. - -You can configure a read-only node by running the `tiup cluster edit-config` command: - -``` -tikv_servers: - - host: ... - ... - labels: - $mode: readonly -``` - -### 2. Use Placement Rules to store data on read-only nodes as learners - -1. Run the `pd-ctl config placement-rules` command to export the default Placement Rules: - - ```shell - pd-ctl config placement-rules rule-bundle load --out="rules.json" - ``` - - If you have not configured Placement Rules before, the output is as follows: - - ```json - [ - { - "group_id": "pd", - "group_index": 0, - "group_override": false, - "rules": [ - { - "group_id": "pd", - "id": "default", - "start_key": "", - "end_key": "", - "role": "voter", - "count": 3 - } - ] - } - ] - ``` - -2. Store all data on the read-only nodes as a learner. The following example is based on the default configuration: - - ```json - [ - { - "group_id": "pd", - "group_index": 0, - "group_override": false, - "rules": [ - { - "group_id": "pd", - "id": "default", - "start_key": "", - "end_key": "", - "role": "voter", - "count": 3 - }, - { - "group_id": "pd", - "id": "readonly", - "start_key": "", - "end_key": "", - "role": "learner", - "count": 1, - "label_constraints": [ - { - "key": "$mode", - "op": "in", - "values": [ - "readonly" - ] - } - ], - "version": 1 - } - ] - } - ] - ``` - -3. Use the `pd-ctl config placement-rules` command to write the preceding configurations to PD: - - ```shell - pd-ctl config placement-rules rule-bundle save --in="rules.json" - ``` - -> **Note:** -> -> - If you perform the preceding operations on a cluster with a large dataset, the entire cluster might need some time to completely replicate data to read-only nodes. During this period, the read-only nodes might not be able to provide services. -> - Because of the special implementation of backup, the learner number of each label cannot exceed 1. Otherwise, it will generate duplicate data during backup. - -### 3. Use Follower Read to read data from read-only nodes - -#### 3.1 Use Follower Read in TiDB - -To read data from read-only nodes when using TiDB, you can set the system variable [`tidb_replica_read`](/system-variables.md#tidb_replica_read-new-in-v40) to `learner`: - -```sql -set tidb_replica_read=learner; -``` - -#### 3.2 Use Follower Read when backing up cluster data - -To read data from read-only nodes when backing up cluster data, you can specify the `--replica-read-label` option in the br command line. Note that when running the following command in shell, you need to use single quotes to wrap the label to prevent `$` from being parsed. - -```shell -tiup br backup full ... --replica-read-label '$mode:readonly' -``` diff --git a/releases/release-6.6.0.md b/releases/release-6.6.0.md index b41d0ad678b48..84fa94e647b9d 100644 --- a/releases/release-6.6.0.md +++ b/releases/release-6.6.0.md @@ -194,9 +194,9 @@ In v6.6.0-DMR, the key new features and improvements are as follows: * Support configuring read-only storage nodes for resource-consuming tasks @[v01dstar](https://github.com/v01dstar) - In production environments, some read-only operations might consume a large number of resources regularly and affect the performance of the entire cluster, such as backups and large-scale data reading and analysis. TiDB v6.6.0 supports configuring read-only storage nodes for resource-consuming read-only tasks to reduce the impact on the online application. Currently, TiDB, TiSpark, and BR support reading data from read-only storage nodes. You can configure read-only storage nodes according to [steps](/best-practices/readonly-nodes.md#procedures) and specify where data is read through the system variable `tidb_replica_read`, the TiSpark configuration item `spark.tispark.replica_read`, or the br command line argument `--replica-read-label`, to ensure the stability of cluster performance. + In production environments, some read-only operations might consume a large number of resources regularly and affect the performance of the entire cluster, such as backups and large-scale data reading and analysis. TiDB v6.6.0 supports configuring read-only storage nodes for resource-consuming read-only tasks to reduce the impact on the online application. Currently, TiDB, TiSpark, and BR support reading data from read-only storage nodes. You can configure read-only storage nodes according to [steps](https://docs-archive.pingcap.com/tidb/v6.6/readonly-nodes/#procedures) and specify where data is read through the system variable `tidb_replica_read`, the TiSpark configuration item `spark.tispark.replica_read`, or the br command line argument `--replica-read-label`, to ensure the stability of cluster performance. - For more information, see [documentation](/best-practices/readonly-nodes.md). + For more information, see [documentation](https://docs-archive.pingcap.com/tidb/v6.6/readonly-nodes/). * Support dynamically modifying `store-io-pool-size` [#13964](https://github.com/tikv/tikv/issues/13964) @[LykxSassinator](https://github.com/LykxSassinator) diff --git a/system-variable-reference.md b/system-variable-reference.md index 348bcf3da04a4..9deef6eb074a4 100644 --- a/system-variable-reference.md +++ b/system-variable-reference.md @@ -3544,7 +3544,6 @@ Referenced in: Referenced in: - [Best Practices for Local Reads in Three-Data-Center Deployments](/best-practices/three-dc-local-read.md) -- [Best Practices for Read-Only Storage Nodes](/best-practices/readonly-nodes.md) - [Follower Read](/follower-read.md) - [Follower Read](/develop/dev-guide-use-follower-read.md) - [Optimizer Hints](/optimizer-hints.md)