[Doc] Docs for CN Blacklist (backport #62018) (#62769)

Co-authored-by: 絵空事スピリット <wanglichen@starrocks.com>
This commit is contained in:
mergify[bot] 2025-09-08 09:28:08 +08:00 committed by GitHub
parent c5fc434994
commit 0649cfb7a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 311 additions and 194 deletions

View File

@ -2,24 +2,25 @@
displayed_sidebar: docs
---
# Manage BE Blacklist
# Manage BE and CN Blacklist
This topic describes how to manage the BE Blacklist.
From v3.3.0 onwards, StarRocks supports the BE Blacklist feature, which allows you to forbid the usage of certain BE nodes in query execution, thereby avoiding frequent query failures or other unexpected behaviors caused by the failed connections to the BE nodes.
From v3.3.0 onwards, StarRocks supports the BE Blacklist feature, which allows you to forbid the usage of certain BE nodes in query execution, thereby avoiding frequent query failures or other unexpected behaviors caused by the failed connections to the BE nodes. A network issue preventing connections to one or more BEs would be an example of when to use the blacklist.
By default, StarRocks can automatically manage the BE Blacklist, adding the BE nodes that have lost connection to the blacklist and removing them from the blacklist when the connection is reestablished. However, StarRocks will not remove the BE node from the blacklist if the node is manually blacklisted.
From v4.0 onwards, StarRocks supports adding Compute Nodes (CNs) to the Blacklist.
By default, StarRocks can automatically manage the BE and CN Blacklist, adding the BE or CN nodes that have lost connection to the blacklist and removing them from the blacklist when the connection is reestablished. However, StarRocks will not remove the node from the Blacklist if it is manually blacklisted.
:::note
- Only users with the SYSTEM-level BLACKLIST privilege can use this feature.
- Each FE node keeps its own BE Blacklist, and will not share it with other FE nodes.
- Each FE node keeps its own BE and CN Blacklist, and will not share it with other FE nodes.
:::
## Add a BE to the blacklist
## Add a BE/CN to the blacklist
You can manually add a BE node to the BE Blacklist using [ADD BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/ADD_BACKEND_BLACKLIST.md). In this statement, you must specify the ID of the BE node to be blacklisted. You can obtain the BE ID by executing [SHOW BACKENDS](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.md).
You can manually add a BE/CN node to the Blacklist using [ADD BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/ADD_BACKEND_BLACKLIST.md). In this statement, you must specify the ID of the BE/CN node to be blacklisted. You can obtain the BE ID by executing [SHOW BACKENDS](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.md) and CN ID by executing [SHOW COMPUTE NODES](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_COMPUTE_NODES.md).
Example:
@ -32,49 +33,71 @@ SHOW BACKENDS\G
...
-- Add BE to the blacklist.
ADD BACKEND BLACKLIST 10001;
-- Obtain CN ID.
SHOW COMPUTE NODES\G
*************************** 1. row ***************************
ComputeNodeId: 10005
IP: xxx.xx.xx.xxx
...
-- Add CN to the blacklist.
ADD COMPUTE NODE BLACKLIST 10005;
```
## Remove a BE from blacklist
## Remove a BE/CN from blacklist
You can manually remove a BE node from the BE Blacklist using [DELETE BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/DELETE_BACKEND_BLACKLIST.md). In this statement, you must also specify the ID of the BE node.
You can manually remove a BE/CN node from the Blacklist using [DELETE BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/DELETE_BACKEND_BLACKLIST.md). In this statement, you must also specify the ID of the BE/CN node.
Example:
```SQL
-- Remove a BE from the Blacklist.
DELETE BACKEND BLACKLIST 10001;
-- Remove a CN from the Blacklist.
DELETE COMPUTE NODE BLACKLIST 10005;
```
## View BE Blacklist
## View BE/CN Blacklist
You can view the BE nodes in the BE Blacklist using [SHOW BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKEND_BLACKLIST.md).
You can view the BE/CN nodes in the Blacklist using [SHOW BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKEND_BLACKLIST.md).
Example:
```SQL
-- View the BE Blacklist.
SHOW BACKEND BLACKLIST;
+-----------+------------------+---------------------+------------------------------+--------------------+
| BackendId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+-----------+------------------+---------------------+------------------------------+--------------------+
| 10001 | MANUAL | 2024-04-28 11:52:09 | 0 | 5 |
+-----------+------------------+---------------------+------------------------------+--------------------+
-- View the CN Blacklist.
SHOW COMPUTE NODE BLACKLIST;
+---------------+------------------+---------------------+------------------------------+--------------------+
| ComputeNodeId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+---------------+------------------+---------------------+------------------------------+--------------------+
| 10005 | MANUAL | 2025-08-18 10:47:51 | 0 | 5 |
+---------------+------------------+---------------------+------------------------------+--------------------+
```
The following fields are returned:
- `AddBlackListType`: How the BE node was added to the blacklist. `MANUAL` indicates it is manually blacklisted by the user. `AUTO` indicates it is automatically blacklisted by StarRocks.
- `AddBlackListType`: How the BE/CN node was added to the blacklist. `MANUAL` indicates it is manually blacklisted by the user. `AUTO` indicates it is automatically blacklisted by StarRocks.
- `LostConnectionTime`:
- For the `MANUAL` type, it indicates the time when the BE node was manually added to the blacklist.
- For the `MANUAL` type, it indicates the time when the BE/CN node was manually added to the blacklist.
- For the `AUTO` type, it indicates the time when the last successful connection was established.
- `LostConnectionNumberInPeriod`: The number of disconnections detected within `CheckTimePeriod(s)`, which is the interval at which StarRocks checks the connection status of the BE nodes in the blacklist.
- `CheckTimePeriod(s)`: The interval at which StarRocks checks the connection status of the blacklisted BE nodes. Its value is evaluated to the value you specified for the FE configuration item `black_host_history_sec`. Unit: Seconds.
- `LostConnectionNumberInPeriod`: The number of disconnections detected within `CheckTimePeriod(s)`, which is the interval at which StarRocks checks the connection status of the BE/CN nodes in the blacklist.
- `CheckTimePeriod(s)`: The interval at which StarRocks checks the connection status of the blacklisted BE/CN nodes. Its value is evaluated to the value you specified for the FE configuration item `black_host_history_sec`. Unit: Seconds.
## Configure automatic management of BE Blacklist
## Configure automatic management of BE/CN Blacklist
Each time a BE node loses connection to the FE node, or a query fails due to timeout on a BE node, the FE node adds the BE node to its the BE Blacklist. The FE node will constantly assess the connectivity of the BE node in the blacklist by counting its connection failures within a certain duration of time. StarRocks will remove a blacklisted BE node only if the number of its connection failures is below a pre-specified threshold.
Each time a BE/CN node loses connection to the FE node, or a query fails due to timeout on a BE/CN node, the FE node adds the BE/CN node to its BE and CN Blacklist. The FE node will constantly assess the connectivity of the BE/CN node in the blacklist by counting its connection failures within a certain duration of time. StarRocks will remove a blacklisted BE/CN node only if the number of its connection failures is below a pre-specified threshold.
You can configure the automatic management of the BE Blacklist using the following [FE configurations](./FE_configuration.md):
You can configure the automatic management of the BE and CN Blacklist using the following [FE configurations](./FE_configuration.md):
- `black_host_history_sec`: The time duration for retaining historical connection failures of BE nodes in the BE Blacklist.
- `black_host_connect_failures_within_time`: The threshold of connection failures allowed for a blacklisted BE node.
- `black_host_history_sec`: The time duration for retaining historical connection failures of BE/CN nodes in the Blacklist.
- `black_host_connect_failures_within_time`: The threshold of connection failures allowed for a blacklisted BE/CN node.
If a BE node is added to the BE Blacklist automatically, StarRocks will assess its connectivity and judge whether it can be removed from the BE Blacklist. Within `black_host_history_sec`, only if a blacklisted BE node has fewer connection failures than the threshold set in `black_host_connect_failures_within_time`, it can be removed from the BE Blacklist.
If a BE/CN node is added to the Blacklist automatically, StarRocks will assess its connectivity and judge whether it can be removed from the Blacklist. Within `black_host_history_sec`, only if a blacklisted BE/CN node has fewer connection failures than the threshold set in `black_host_connect_failures_within_time`, it can be removed from the Blacklist.

View File

@ -2,11 +2,11 @@
displayed_sidebar: docs
---
# ADD BACKEND BLACKLIST
# ADD BACKEND/COMPUTE NOTE BLACKLIST
ADD BACKEND BLACKLIST adds a BE node to the BE Blacklist. You can manually add BE nodes to the blacklist to forbid the usage of the nodes in query execution, thereby avoiding frequent query failures or other unexpected behaviors caused by failed connections to the BE nodes.
Adds a BE or CN node to the BE and CN Blacklist. You can manually add BE/CN nodes to the blacklist to forbid the usage of the nodes in query execution, thereby avoiding frequent query failures or other unexpected behaviors caused by failed connections to the nodes.
This feature is supported from v3.3.0 onwards. For more information, see [Manage BE Blacklist](../../../../administration/management/BE_blacklist.md).
BE Blacklist is supported from v3.3.0 onwards and CN Blacklist is supported from v4.0 onwards. For more information, see [Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md).
:::note
@ -14,17 +14,17 @@ Only users with the SYSTEM-level BLACKLIST privilege can perform this operation.
:::
By default, StarRocks can automatically manage the BE Blacklist, adding the BE nodes that have lost connection to the blacklist and removing them from the blacklist when the connection is reestablished. However, StarRocks will not remove the BE node from the blacklist if the node is manually blacklisted.
By default, StarRocks can automatically manage the BE and CN Blacklist, adding the BE/CN nodes that have lost connection to the blacklist and removing them from the blacklist when the connection is reestablished. However, StarRocks will not remove the node from the blacklist if it is manually blacklisted.
## Syntax
```SQL
ADD BACKEND BLACKLIST <be_id>[, ...]
ADD { BACKEND | COMPUTE NODE } BLACKLIST { <be_id>[, ...] | <cn_id>[, ...] }
```
## Parameters
`be_id`: ID of the BE node to be blacklisted. You can obtain the BE ID by executing [SHOW BACKENDS](SHOW_BACKENDS.md).
`be_id` or `cn_id`: ID of the BE or CN node to be blacklisted. You can obtain the BE ID by executing [SHOW BACKENDS](./SHOW_BACKENDS.md) and CN ID by executing [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md).
## Examples
@ -37,11 +37,20 @@ SHOW BACKENDS\G
...
-- Add BE to the blacklist.
ADD BACKEND BLACKLIST 10001;
-- Obtain CN ID.
SHOW COMPUTE NODES\G
*************************** 1. row ***************************
ComputeNodeId: 10005
IP: xxx.xx.xx.xxx
...
-- Add CN to the blacklist.
ADD COMPUTE NODE BLACKLIST 10005;
```
## Relevant SQLs
- [DELETE BACKEND BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKEND BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [DELETE BACKEND/COMPUTE NODE BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](./SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,11 +2,11 @@
displayed_sidebar: docs
---
# DELETE BACKEND BLACKLIST
# DELETE BACKEND/COMPUTE NOT BLACKLIST
DELETE BACKEND BLACKLIST removes a BE node from the BE Blacklist. Please note that StarRocks will not remove the BE nodes that are manually blacklisted by users.
Removes a BE/CN node from the BE Blacklist. Please note that StarRocks will not remove the BE/CN nodes that are manually blacklisted by users.
This feature is supported from v3.3.0 onwards. For more information, see [Manage BE Blacklist](../../../../administration/management/BE_blacklist.md).
BE Blacklist is supported from v3.3.0 onwards and CN Blacklist is supported from v4.0 onwards. For more information, see [Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md).
:::note
@ -17,12 +17,12 @@ Only users with the SYSTEM-level BLACKLIST privilege can perform this operation.
## Syntax
```SQL
DELETE BACKEND BLACKLIST <be_id>[, ...]
DELETE { BACKEND | COMPUTE NODE } BLACKLIST { <be_id>[, ...] | <cn_id>[, ...] }
```
## Parameters
`be_id`: ID of the BE node to be removed from the blacklist. You can obtain the ID of the blacklisted BE by executing [SHOW BACKEND BLACKLIST](./SHOW_BACKEND_BLACKLIST.md).
`be_id` or `cn_id`: ID of the BE or CN node to be removed from the blacklist. You can obtain the ID of the blacklisted BE/CN by executing [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md).
## Examples
@ -32,7 +32,8 @@ DELETE BACKEND BLACKLIST 10001;
## Relevant SQLs
- [ADD BACKEND BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [SHOW BACKEND BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [ADD BACKEND/COMPUTE NODE BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](./SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,11 +2,11 @@
displayed_sidebar: docs
---
# SHOW BACKEND BLACKLIST
# SHOW BACKEND/COMPUTE NODE BLACKLIST
SHOW BACKEND BLACKLIST shows the BE nodes in the BE Blacklist.
Shows the BE/CN nodes in the BE and CN Blacklist.
This feature is supported from v3.3.0 onwards. For more information, see [Manage BE Blacklist](../../../../administration/management/BE_blacklist.md).
BE Blacklist is supported from v3.3.0 onwards and CN Blacklist is supported from v4.0 onwards. For more information, see [Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md).
:::note
@ -17,32 +17,41 @@ Only users with the SYSTEM-level BLACKLIST privilege can perform this operation.
## Syntax
```SQL
SHOW BACKEND BLACKLIST
SHOW { BACKEND | COMPUTE NODE } BLACKLIST
```
## Return value
| **Return** | **Description** |
| ---------------------------- | ------------------------------------------------------------ |
| AddBlackListType | How the BE node was added to the blacklist. `MANUAL` indicates it is manually blacklisted by the user. `AUTO` indicates it is automatically blacklisted by StarRocks. |
| LostConnectionTime | For the `MANUAL` type, it indicates the time when the BE node was manually added to the blacklist.<br />For the `AUTO` type, it indicates the time when the last successful connection was established. |
| AddBlackListType | How the BE/CN node was added to the blacklist. `MANUAL` indicates it is manually blacklisted by the user. `AUTO` indicates it is automatically blacklisted by StarRocks. |
| LostConnectionTime | For the `MANUAL` type, it indicates the time when the BE/CN node was manually added to the blacklist.<br />For the `AUTO` type, it indicates the time when the last successful connection was established. |
| LostConnectionNumberInPeriod | The number of disconnections detected within `CheckTimePeriod(s)`. |
| CheckTimePeriod(s) | The interval at which StarRocks checks the connection status of the blacklisted BE nodes. Its value is evaluated to the value you specified for the FE configuration item `black_host_history_sec`. Unit: Seconds. |
| CheckTimePeriod(s) | The interval at which StarRocks checks the connection status of the blacklisted BE/CN nodes. Its value is evaluated to the value you specified for the FE configuration item `black_host_history_sec`. Unit: Seconds. |
## Examples
```SQL
-- View the BE Blacklist.
SHOW BACKEND BLACKLIST;
+-----------+------------------+---------------------+------------------------------+--------------------+
| BackendId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+-----------+------------------+---------------------+------------------------------+--------------------+
| 10001 | MANUAL | 2024-04-28 11:52:09 | 0 | 5 |
+-----------+------------------+---------------------+------------------------------+--------------------+
-- View the CN Blacklist.
SHOW COMPUTE NODE BLACKLIST;
+---------------+------------------+---------------------+------------------------------+--------------------+
| ComputeNodeId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+---------------+------------------+---------------------+------------------------------+--------------------+
| 10005 | MANUAL | 2025-08-18 10:47:51 | 0 | 5 |
+---------------+------------------+---------------------+------------------------------+--------------------+
```
## Relevant SQLs
- [ADD BACKEND BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [DELETE BACKEND BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [ADD BACKEND/COMPUTE NODE BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [DELETE BACKEND/COMPUTE NODE BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,24 +2,26 @@
displayed_sidebar: docs
---
# BE ブラックリストの管理
# BE と CN のブラックリストを管理する
このトピックでは、BE ブラックリストの管理方法について説明します。
このトピックでは、BE と CN のブラックリストの管理方法について説明します。
バージョン v3.3.0 以降、StarRocks は BE ブラックリスト機能をサポートしています。この機能により、特定の BE ードのクエリ実行での使用を禁止することができ、BE ノードへの接続が失敗することによる頻繁なクエリの失敗やその他の予期しない動作を回避できます。
バージョン v3.3.0 以降、StarRocks は BE ブラックリスト機能をサポートしており、特定の BE ードのクエリ実行を禁止することで、BE ノードへの接続失敗による頻繁なクエリ失敗やその他の予期しない動作を回避できます。
デフォルトでは、StarRocks は BE ブラックリストを自動的に管理し、接続が失われた BE ノードをブラックリストに追加し、接続が再確立されたときにブラックリストから削除します。ただし、手動でブラックリストに追加された BE ードは、StarRocks によってブラックリストから削除されません。
バージョン v4.0 以降、StarRocks は COMPUTE NODE (CN) をブラックリストに追加することをサポートしています。
デフォルトでは、StarRocks は自動的に BE と CN のブラックリストを管理し、接続が失われた BE または CN ードをブラックリストに追加し、接続が再確立されたときにブラックリストから削除します。ただし、手動でブラックリストに追加されたードは、StarRocks によってブラックリストから削除されません。
:::note
- SYSTEM レベルの BLACKLIST 権限を持つユーザーのみがこの機能を使用きます。
- 各 FE ノードは独自の BE ブラックリストを保持し、他の FE ノードと共有しません。
- この機能を使用できるのは、SYSTEM レベルの BLACKLIST 権限を持つユーザーのみです。
- 各 FE ノードは独自の BE と CN のブラックリストを保持し、他の FE ノードと共有しません。
:::
## BE をブラックリストに追加する
## BE/CN をブラックリストに追加する
[ADD BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/ADD_BACKEND_BLACKLIST.md) を使用して、BE ノードを手動で BE ブラックリストに追加できます。このステートメントでは、ブラックリストに追加する BE ノードの ID を指定する必要があります。[SHOW BACKENDS](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.md) を実行して BE ID を取得できます。
[ADD BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/ADD_BACKEND_BLACKLIST.md) を使用して、手動で BE/CN ノードをブラックリストに追加できます。このステートメントでは、ブラックリストに追加する BE/CN ノードの ID を指定する必要があります。BE ID は [SHOW BACKENDS](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.md) を実行して取得し、CN ID は [SHOW COMPUTE NODES](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_COMPUTE_NODES.md) を実行して取得できます。
例:
@ -32,49 +34,71 @@ SHOW BACKENDS\G
...
-- BE をブラックリストに追加します。
ADD BACKEND BLACKLIST 10001;
-- CN ID を取得します。
SHOW COMPUTE NODES\G
*************************** 1. row ***************************
ComputeNodeId: 10005
IP: xxx.xx.xx.xxx
...
-- CN をブラックリストに追加します。
ADD COMPUTE NODE BLACKLIST 10005;
```
## ブラックリストから BE を削除する
## ブラックリストから BE/CN を削除する
[DELETE BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/DELETE_BACKEND_BLACKLIST.md) を使用して、BE ノードを手動で BE ブラックリストから削除できます。このステートメントでも、BE ノードの ID を指定する必要があります。
[DELETE BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/DELETE_BACKEND_BLACKLIST.md) を使用して、手動で BE/CN ノードをブラックリストから削除できます。このステートメントでも、BE/CN ノードの ID を指定する必要があります。
例:
```SQL
-- BE をブラックリストから削除します。
DELETE BACKEND BLACKLIST 10001;
-- CN をブラックリストから削除します。
DELETE COMPUTE NODE BLACKLIST 10005;
```
## BE ブラックリストを表示する
## BE/CN ブラックリストを表示する
[SHOW BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKEND_BLACKLIST.md) を使用して、BE ブラックリストにある BE ノードを表示できます。
[SHOW BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKEND_BLACKLIST.md) を使用して、ブラックリストにある BE/CN ノードを表示できます。
例:
```SQL
-- BE ブラックリストを表示します。
SHOW BACKEND BLACKLIST;
+-----------+------------------+---------------------+------------------------------+--------------------+
| BackendId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+-----------+------------------+---------------------+------------------------------+--------------------+
| 10001 | MANUAL | 2024-04-28 11:52:09 | 0 | 5 |
+-----------+------------------+---------------------+------------------------------+--------------------+
-- CN ブラックリストを表示します。
SHOW COMPUTE NODE BLACKLIST;
+---------------+------------------+---------------------+------------------------------+--------------------+
| ComputeNodeId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+---------------+------------------+---------------------+------------------------------+--------------------+
| 10005 | MANUAL | 2025-08-18 10:47:51 | 0 | 5 |
+---------------+------------------+---------------------+------------------------------+--------------------+
```
次のフィールドが返されます:
- `AddBlackListType`: BE ノードがブラックリストに追加された方法を示します。`MANUAL` はユーザーによって手動でブラックリストに追加されたことを示し、`AUTO` は StarRocks によって自動的にブラックリストに追加されたことを示します。
- `AddBlackListType`: BE/CN ノードがブラックリストに追加された方法。`MANUAL` はユーザーによって手動でブラックリストに追加されたことを示します。`AUTO` は StarRocks によって自動的にブラックリストに追加されたことを示します。
- `LostConnectionTime`:
- `MANUAL` タイプの場合、BE ノードが手動でブラックリストに追加された時間を示します。
- `MANUAL` タイプの場合、BE/CN ノードが手動でブラックリストに追加された時間を示します。
- `AUTO` タイプの場合、最後に成功した接続が確立された時間を示します。
- `LostConnectionNumberInPeriod`: `CheckTimePeriod(s)` 内で検出された切断の数であり、StarRocks がブラックリストにある BE ノードの接続状態を確認する間隔です。
- `CheckTimePeriod(s)`: ブラックリストにある BE ノードの接続状態を StarRocks が確認する間隔です。この値は FE 設定項目 `black_host_history_sec` に指定された値に評価されます。単位: 秒。
- `LostConnectionNumberInPeriod`: `CheckTimePeriod(s)` 内で検出された切断の数で、これは StarRocks がブラックリスト内の BE/CN ノードの接続状態を確認する間隔です。
- `CheckTimePeriod(s)`: StarRocks がブラックリストにある BE/CN ノードの接続状態を確認する間隔。この値は FE 設定項目 `black_host_history_sec` に指定た値に評価されます。単位: 秒。
## BE ブラックリストの自動管理を設定する
## BE/CN ブラックリストの自動管理を設定する
BE ノードが FE ノードへの接続を失うたびに、または BE ノードでタイムアウトが原因でクエリが失敗するたびに、FE ノードは BE ノードを BE ブラックリストに追加します。FE ノードは、ブラックリストにある BE ノードの接続失敗を一定期間内にカウントすることで、その接続性を常に評価します。StarRocks は、接続失敗の数が事前に指定された閾値を下回った場合にのみ、ブラックリストにある BE ノードを削除します。
BE/CN ノードが FE ノードへの接続を失うたびに、または BE/CN ノードでタイムアウトによるクエリが失敗するたびに、FE ノードは BE/CN ノードをその BE と CN ブラックリストに追加します。FE ノードは、一定期間内の接続失敗をカウントすることで、ブラックリスト内の BE/CN ノードの接続性を常に評価します。StarRocks は、接続失敗の数が事前に指定された閾値を下回った場合にのみ、ブラックリストにある BE/CN ノードを削除します。
次の [FE 設定](./FE_configuration.md) を使用して、BE ブラックリストの自動管理を設定できます:
次の [FE 設定](./FE_configuration.md) を使用して、BE と CN ブラックリストの自動管理を設定できます:
- `black_host_history_sec`: BE ブラックリストにある BE ノードの過去の接続失敗を保持する期間。
- `black_host_connect_failures_within_time`: ブラックリストにある BE ノードに許容される接続失敗の閾値。
- `black_host_history_sec`: ブラックリスト内の BE/CN ノードの接続失敗の履歴を保持する期間。
- `black_host_connect_failures_within_time`: ブラックリストにある BE/CN ノードに許可される接続失敗の閾値。
BE ノードが自動的に BE ブラックリストに追加された場合、StarRocks はその接続性を評価し、BE ブラックリストから削除できるかどうかを判断します。`black_host_history_sec` 内で、ブラックリストにある BE ノードが `black_host_connect_failures_within_time` に設定された閾値よりも少ない接続失敗を持つ場合にのみ、BE ブラックリストから削除できます。
BE/CN ードが自動的にブラックリストに追加された場合、StarRocks はその接続性を評価し、ブラックリストから削除できるかどうかを判断します。`black_host_history_sec` 内で、ブラックリストにある BE/CN ノードが `black_host_connect_failures_within_time` に設定された閾値よりも少ない接続失敗を持つ場合にのみ、ブラックリストから削除されます。

View File

@ -2,13 +2,11 @@
displayed_sidebar: docs
---
# ADD BACKEND BLACKLIST
# ADD BACKEND/COMPUTE NOTE BLACKLIST
## 説明
BE または CN ノードを BE および CN ブラックリストに追加します。クエリ実行時にノードの使用を禁止するために、手動で BE/CN ノードをブラックリストに追加することができます。これにより、ノードへの接続が失敗したことによる頻繁なクエリの失敗やその他の予期しない動作を回避できます。
BE ノードを BE ブラックリストに追加します。クエリ実行時にノードの使用を禁止するために、手動で BE ードをブラックリストに追加することができます。これにより、BE ノードへの接続失敗による頻繁なクエリ失敗やその他の予期しない動作を回避できます。
この機能は v3.3.0 以降でサポートされています。詳細については、[Manage BE Blacklist](../../../../administration/management/BE_blacklist.md) を参照してください。
BE ブラックリストは v3.3.0 以降でサポートされ、CN ブラックリストは v4.0 以降でサポートされています。詳細については、[Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md) を参照してください。
:::note
@ -16,19 +14,19 @@ BE ノードを BE ブラックリストに追加します。クエリ実行時
:::
デフォルトでは、StarRocks は BE ブラックリストを自動的に管理し、接続が失われた BE ノードをブラックリストに追加し、接続が再確立されたときにブラックリストから削除します。ただし、手動でブラックリストに追加された BE ードは、StarRocks によってブラックリストから削除されません。
デフォルトでは、StarRocks は BE および CN ブラックリストを自動的に管理し、接続が失われた BE/CN ードをブラックリストに追加し、接続が再確立されたときにブラックリストから削除します。ただし、手動でブラックリストに追加されたードは、StarRocks によってブラックリストから削除されません。
## 構文
## Syntax
```SQL
ADD BACKEND BLACKLIST <be_id>[, ...]
ADD { BACKEND | COMPUTE NODE } BLACKLIST { <be_id>[, ...] | <cn_id>[, ...] }
```
## パラメータ
## Parameters
`be_id`: ブラックリストに追加する BE ノードの ID。BE ID は [SHOW BACKENDS](SHOW_BACKENDS.md) を実行して取得できます。
`be_id` または `cn_id`: ブラックリストに追加する BE または CN ノードの ID。BE ID は [SHOW BACKENDS](./SHOW_BACKENDS.md) を実行して取得し、CN ID は [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md) を実行して取得できます。
##
## Examples
```SQL
-- BE ID を取得します。
@ -39,10 +37,20 @@ SHOW BACKENDS\G
...
-- BE をブラックリストに追加します。
ADD BACKEND BLACKLIST 10001;
-- CN ID を取得します。
SHOW COMPUTE NODES\G
*************************** 1. row ***************************
ComputeNodeId: 10005
IP: xxx.xx.xx.xxx
...
-- CN をブラックリストに追加します。
ADD COMPUTE NODE BLACKLIST 10005;
```
## 関連する SQL
## Relevant SQLs
- [DELETE BACKEND BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKEND BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [DELETE BACKEND/COMPUTE NODE BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](./SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,13 +2,11 @@
displayed_sidebar: docs
---
# DELETE BACKEND BLACKLIST
# DELETE BACKEND/COMPUTE NOT BLACKLIST
## 説明
BE/CN ノードを BE ブラックリストから削除します。StarRocks は、ユーザーによって手動でブラックリストに登録された BE/CN ノードを削除しないことに注意してください。
BE ノードを BE ブラックリストから削除します。StarRocks は、ユーザーによって手動でブラックリストに登録された BE ノードを削除しないことに注意してください。
この機能は v3.3.0 以降でサポートされています。詳細については、[Manage BE Blacklist](../../../../administration/management/BE_blacklist.md) を参照してください。
BE ブラックリストは v3.3.0 以降でサポートされ、CN ブラックリストは v4.0 以降でサポートされています。詳細については、[Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md) を参照してください。
:::note
@ -16,24 +14,25 @@ BE ノードを BE ブラックリストから削除します。StarRocks は、
:::
## 構文
## Syntax
```SQL
DELETE BACKEND BLACKLIST <be_id>[, ...]
DELETE { BACKEND | COMPUTE NODE } BLACKLIST { <be_id>[, ...] | <cn_id>[, ...] }
```
## パラメータ
## Parameters
`be_id`: ブラックリストから削除する BE ノードの ID。ブラックリストに登録された BE の ID は、[SHOW BACKEND BLACKLIST](./SHOW_BACKEND_BLACKLIST.md) を実行することで取得できます。
`be_id` または `cn_id`: ブラックリストから削除する BE または CN ノードの ID。ブラックリストに登録された BE/CN の ID は、[SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md) を実行して取得できます。
##
## Examples
```SQL
DELETE BACKEND BLACKLIST 10001;
```
## 関連 SQL
## Relevant SQLs
- [ADD BACKEND BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [SHOW BACKEND BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [ADD BACKEND/COMPUTE NODE BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](./SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,13 +2,11 @@
displayed_sidebar: docs
---
# SHOW BACKEND BLACKLIST
# SHOW BACKEND/COMPUTE NODE BLACKLIST
## 説明
BE および CN ブラックリストにある BE/CN ノードを表示します。
BE Blacklist にある BE ノードを表示します。
この機能は v3.3.0 以降でサポートされています。詳細は [Manage BE Blacklist](../../../../administration/management/BE_blacklist.md) を参照してください。
BE ブラックリストは v3.3.0 以降でサポートされ、CN ブラックリストは v4.0 以降でサポートされています。詳細については、[Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md) を参照してください。
:::note
@ -16,34 +14,44 @@ BE Blacklist にある BE ノードを表示します。
:::
## 構文
## Syntax
```SQL
SHOW BACKEND BLACKLIST
SHOW { BACKEND | COMPUTE NODE } BLACKLIST
```
## 戻り値
## Return value
| **戻り値** | **説明** |
| ---------------------------- | ----------------------------------------------------------- |
| AddBlackListType | BE ノードがブラックリストに追加された方法。`MANUAL` はユーザーによって手動でブラックリストに追加されたことを示します。`AUTO` は StarRocks によって自動的にブラックリストに追加されたことを示します。 |
| LostConnectionTime | `MANUAL` タイプの場合、BE ノードが手動でブラックリストに追加された時刻を示します。<br />`AUTO` タイプの場合、最後に正常に接続された時刻を示します。 |
| **Return** | **Description** |
| ---------------------------- | ------------------------------------------------------------ |
| AddBlackListType | BE/CN ノードがブラックリストに追加された方法。`MANUAL` はユーザーによって手動でブラックリストに追加されたことを示します。`AUTO` は StarRocks によって自動的にブラックリストに追加されたことを示します。 |
| LostConnectionTime | `MANUAL` タイプの場合、BE/CN ノードが手動でブラックリストに追加された時間を示します。<br />`AUTO` タイプの場合、最後に成功した接続が確立された時間を示します。 |
| LostConnectionNumberInPeriod | `CheckTimePeriod(s)` 内で検出された切断の回数。 |
| CheckTimePeriod(s) | StarRocks がブラックリストに登録された BE ノードの接続状況を確認する間隔。この値は、FE 設定項目 `black_host_history_sec` に指定した値に評価されます。単位: 秒。 |
| CheckTimePeriod(s) | StarRocks がブラックリストに登録された BE/CN ノードの接続状態を確認する間隔。この値は、FE 設定項目 `black_host_history_sec` に指定した値に評価されます。単位: 秒。 |
##
## Examples
```SQL
-- BE ブラックリストを表示します。
SHOW BACKEND BLACKLIST;
+-----------+------------------+---------------------+------------------------------+--------------------+
| BackendId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+-----------+------------------+---------------------+------------------------------+--------------------+
| 10001 | MANUAL | 2024-04-28 11:52:09 | 0 | 5 |
+-----------+------------------+---------------------+------------------------------+--------------------+
-- CN ブラックリストを表示します。
SHOW COMPUTE NODE BLACKLIST;
+---------------+------------------+---------------------+------------------------------+--------------------+
| ComputeNodeId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+---------------+------------------+---------------------+------------------------------+--------------------+
| 10005 | MANUAL | 2025-08-18 10:47:51 | 0 | 5 |
+---------------+------------------+---------------------+------------------------------+--------------------+
```
## 関連 SQL
## Relevant SQLs
- [ADD BACKEND BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [DELETE BACKEND BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [ ADD BACKEND/COMPUTE NODE BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [ DELETE BACKEND/COMPUTE NODE BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [ SHOW BACKENDS](SHOW_BACKENDS.md)
- [ SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,24 +2,26 @@
displayed_sidebar: docs
---
# 管理 BE 黑名单
# 管理 BE 和 CN 黑名单
文介绍如何管理 BE 黑名单。
主题介绍如何管理 BE 和 CN 黑名单。
从 v3.3.0 版本开始StarRocks 支持 BE 黑名单功能,允许您在查询执行中禁止使用特定 BE 节点,从而避免由于节点断连而引起的查询超时失败或其他意外行为。
从 v3.3.0 开始StarRocks 支持 BE 黑名单功能,该功能允许您禁止在查询执行中使用某些 BE 节点,从而避免由于与 BE 节点的连接失败导致的频繁查询失败或其他意外行为。
默认情况下StarRocks 可以自动管理 BE 黑名单,将断连的 BE 节点添加到黑名单中,并在重新连接成功时将其从黑名单中移除。但 StarRocks 不会主动将用户手动加入黑名单的节点移除。
从 v4.0 开始StarRocks 支持将 COMPUTE NODE (CN) 添加到黑名单。
默认情况下StarRocks 可以自动管理 BE 和 CN 黑名单,将失去连接的 BE 或 CN 节点添加到黑名单并在连接重新建立时将其从黑名单中移除。但是如果节点是手动加入黑名单的StarRocks 将不会自动将其移除。
:::note
- 使用该功能需要 SYSTEM 级 BLACKLIST 权限
- 每个 FE 节点仅维护各自的 BE 黑名单,不与其他 FE 节点共享。
- 只有具有 SYSTEM 级别 BLACKLIST 权限的用户才能使用此功能
- 每个 FE 节点保留自己的 BE 和 CN 黑名单,并且不会与其他 FE 节点共享。
:::
## 添加 BE 节点至黑名单
## 将 BE/CN 添加到黑名单
您可以使用 [ADD BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/ADD_BACKEND_BLACKLIST.md) 语句手动将一个 BE 节点添加到 BE 黑名单中。您需要在此语句中指定该 BE 节点的 ID。您可以通过执行 [SHOW BACKENDS](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.md) 语句来获取 BE 节点的 ID。
您可以使用 [ADD BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/ADD_BACKEND_BLACKLIST.md) 手动将 BE/CN 节点添加到黑名单。在此语句中,您必须指定要加入黑名单的 BE/CN 节点的 ID。您可以通过执行 [SHOW BACKENDS](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.md) 获取 BE ID通过执行 [SHOW COMPUTE NODES](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_COMPUTE_NODES.md) 获取 CN ID。
示例:
@ -30,51 +32,73 @@ SHOW BACKENDS\G
BackendId: 10001
IP: xxx.xx.xx.xxx
...
-- 添加 BE 节点至黑名单。
-- 将 BE 添加到黑名单。
ADD BACKEND BLACKLIST 10001;
-- 获取 CN ID。
SHOW COMPUTE NODES\G
*************************** 1. row ***************************
ComputeNodeId: 10005
IP: xxx.xx.xx.xxx
...
-- 将 CN 添加到黑名单。
ADD COMPUTE NODE BLACKLIST 10005;
```
## 从黑名单中移除 BE 节点
## 从黑名单中移除 BE/CN
您可以使用 [DELETE BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/DELETE_BACKEND_BLACKLIST.md) 语句手动将一个 BE 节点从 BE 黑名单中移除。您同样需要在此语句中指定 BE 节点的 ID。
您可以使用 [DELETE BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/DELETE_BACKEND_BLACKLIST.md) 手动从黑名单中移除 BE/CN 节点。在此语句中,您也必须指定 BE/CN 节点的 ID。
示例:
```SQL
-- 从黑名单中移除 BE。
DELETE BACKEND BLACKLIST 10001;
-- 从黑名单中移除 CN。
DELETE COMPUTE NODE BLACKLIST 10005;
```
## 查看 BE 黑名单
## 查看 BE/CN 黑名单
您可以使用 [SHOW BACKEND BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKEND_BLACKLIST.md) 语句查看 BE 黑名单中的节点。
您可以使用 [SHOW BACKEND/COMPUTE NODE BLACKLIST](../../sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKEND_BLACKLIST.md) 查看黑名单中的 BE/CN 节点。
示例:
```SQL
-- 查看 BE 黑名单。
SHOW BACKEND BLACKLIST;
+-----------+------------------+---------------------+------------------------------+--------------------+
| BackendId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+-----------+------------------+---------------------+------------------------------+--------------------+
| 10001 | MANUAL | 2024-04-28 11:52:09 | 0 | 5 |
+-----------+------------------+---------------------+------------------------------+--------------------+
-- 查看 CN 黑名单。
SHOW COMPUTE NODE BLACKLIST;
+---------------+------------------+---------------------+------------------------------+--------------------+
| ComputeNodeId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+---------------+------------------+---------------------+------------------------------+--------------------+
| 10005 | MANUAL | 2025-08-18 10:47:51 | 0 | 5 |
+---------------+------------------+---------------------+------------------------------+--------------------+
```
返回以下字段:
返回的字段如下
- `AddBlackListType`BE 节点被添加到黑名单的方式。`MANUAL` 表示由用户手动添加到黑名单。`AUTO` 表示由 StarRocks 自动添加到黑名单。
- `AddBlackListType`BE/CN 节点被加入黑名单的方式。`MANUAL` 表示由用户手动加入黑名单。`AUTO` 表示由 StarRocks 自动加入黑名单。
- `LostConnectionTime`
- 对于 `MANUAL` 类型,表示 BE 节点被手动添加到黑名单的时间。
- 对于 `AUTO` 类型,表示最后一次成功建立连接的时间。
- `LostConnectionNumberInPeriod`:在 `CheckTimePeriod(s)` 内检测到的断连次数。
- `CheckTimePeriod(s)`StarRocks 检查黑名单中 BE 节点连接状态的间隔。其值等于您在 FE 配置项 `black_host_history_sec`指定的值。单位:秒。
- 对于 `MANUAL` 类型,表示 BE/CN 节点被手动加入黑名单的时间。
- 对于 `AUTO` 类型,表示最后一次成功连接建立的时间。
- `LostConnectionNumberInPeriod`:在 `CheckTimePeriod(s)` 内检测到的断次数,即 StarRocks 检查黑名单中 BE/CN 节点连接状态的时间间隔
- `CheckTimePeriod(s)`StarRocks 检查黑名单中 BE/CN 节点连接状态的时间间隔。其值等于您为 FE 配置项 `black_host_history_sec` 指定的值。单位:秒。
## 配置 BE 黑名单自动管理
## 配置 BE/CN 黑名单自动管理
当某个 BE 节点断连,或查询因某个 BE 节点超时而失败时FE 节点会将该 BE 节点添加到 BE 黑名单中。FE 节点将不断评估黑名单中 BE 节点的连接状态,统计其在一定时间内连接失败的次数。只有当该 BE 节点的连接失败次数低于预先指定的阈值时StarRocks 才会将其从黑名单中移除。
每当 BE/CN 节点与 FE 节点失去连接,或由于 BE/CN 节点上的超时导致查询失败时FE 节点会将 BE/CN 节点添加到其 BE 和 CN 黑名单中。FE 节点将通过统计其在特定时间段内的连接失败次数来持续评估黑名单中 BE/CN 节点的连接性。只有当黑名单中的 BE/CN 节点的连接失败次数低于预设的阈值时StarRocks 才会将其移除。
您可以使用以下 [FE 配置项](./FE_configuration.md)来配置 BE 黑名单的自动管理:
您可以使用以下 [FE 配置](./FE_configuration.md) 配置 BE 和 CN 黑名单的自动管理:
- `black_host_history_sec`:黑名单中 BE 节点连接失败记录保留时长。
- `black_host_connect_failures_within_time`黑名单中的 BE 节点允许连接失败的上限
- `black_host_history_sec`黑名单中保留 BE/CN 节点历史连接失败的时
- `black_host_connect_failures_within_time`允许黑名单中 BE/CN 节点的连接失败次数阈值
如果一个 BE 节点被自动添加到 BE 黑名单中StarRocks 将评估其连接状态,并判断是否可以将其从 BE 黑名单中移除。在 `black_host_history_sec` 内,只有当黑名单中的 BE 节点的连接失败次数少于 `black_host_connect_failures_within_time` 中设置的阈值时,StarRocks 才会将其从 BE 黑名单中移除。
如果 BE/CN 节点是自动加入黑名单的StarRocks 将评估其连接性并判断是否可以将其从黑名单中移除。在 `black_host_history_sec` 时间内,只有当黑名单中的 BE/CN 节点的连接失败次数少于 `black_host_connect_failures_within_time` 中设置的阈值时,才可以将其从黑名单中移除。

View File

@ -2,31 +2,29 @@
displayed_sidebar: docs
---
# ADD BACKEND BLACKLIST
# ADD BACKEND/COMPUTE NODE BLACKLIST
## 功能
将 BE 或 CN 节点添加到 BE 和 CN 黑名单中。您可以手动将 BE/CN 节点添加到黑名单,以禁止在查询执行中使用这些节点,从而避免由于节点连接失败导致的频繁查询失败或其他意外行为。
将一个 BE 节点添加到 BE 黑名单中。您可以手动将 BE 节点添加到黑名单中,禁止在查询执行中使用该节点,从而避免由于节点断连而引起的查询超时失败或其他意外行为。
此功能自 v3.3.0 起支持。更多信息,参考[管理 BE 黑名单](../../../../administration/management/BE_blacklist.md)。
BE 黑名单从 v3.3.0 开始支持CN 黑名单从 v4.0 开始支持。更多信息,请参见 [Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md)。
:::note
该操作需要有 SYSTEM 级 BLACKLIST 权限
只有具有 SYSTEM 级别 BLACKLIST 权限的用户才能执行此操作
:::
默认情况下StarRocks 可以自动管理 BE 黑名单,将断连的 BE 节点添加到黑名单中,并在重新连接成功时将其从黑名单中移除。但 StarRocks 不会主动将用户手动加入黑名单的节点移除。
默认情况下StarRocks 可以自动管理 BE 和 CN 黑名单,将失去连接的 BE/CN 节点添加到黑名单中并在连接重新建立时将其从黑名单中移除。然而如果节点是手动加入黑名单的StarRocks 不会将其从黑名单中移除。
## 语法
```SQL
ADD BACKEND BLACKLIST <be_id>[, ...]
ADD { BACKEND | COMPUTE NODE } BLACKLIST { <be_id>[, ...] | <cn_id>[, ...] }
```
## 参数说明
## 参数
`be_id`:要添加到黑名单中的 BE 节点的 ID。您可以通过执行 [SHOW BACKENDS](SHOW_BACKENDS.md) 语句来获取 BE 节点的 ID。
`be_id``cn_id`:要加入黑名单的 BE 或 CN 节点的 ID。您可以通过执行 [SHOW BACKENDS](./SHOW_BACKENDS.md) 获取 BE ID通过执行 [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md) 获取 CN ID。
## 示例
@ -37,13 +35,22 @@ SHOW BACKENDS\G
BackendId: 10001
IP: xxx.xx.xx.xxx
...
-- 添加 BE 节点至黑名单。
-- 将 BE 加入黑名单。
ADD BACKEND BLACKLIST 10001;
-- 获取 CN ID。
SHOW COMPUTE NODES\G
*************************** 1. row ***************************
ComputeNodeId: 10005
IP: xxx.xx.xx.xxx
...
-- 将 CN 加入黑名单。
ADD COMPUTE NODE BLACKLIST 10005;
```
## 相关 SQL
- [DELETE BACKEND BLACKLIST](DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKEND BLACKLIST](SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [DELETE BACKEND/COMPUTE NODE BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](./SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,39 +2,37 @@
displayed_sidebar: docs
---
# DELETE BACKEND BLACKLIST
# DELETE BACKEND/COMPUTE NOT BLACKLIST
## 功能
从 BE 黑名单中移除一个 BE/CN 节点。请注意StarRocks 不会移除用户手动加入黑名单的 BE/CN 节点。
从 BE 黑名单中移除 BE 节点。请注意StarRocks 不会主动将用户手动加入黑名单的节点移除。
此功能自 v3.3.0 起支持。更多信息,参考[管理 BE 黑名单](../../../../administration/management/BE_blacklist.md)。
BE 黑名单从 v3.3.0 开始支持CN 黑名单从 v4.0 开始支持。更多信息,请参见 [Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md)。
:::note
该操作需要有 SYSTEM 级 BLACKLIST 权限
只有拥有 SYSTEM 级别 BLACKLIST 权限的用户才能执行此操作
:::
## 语法
## Syntax
```SQL
DELETE BACKEND BLACKLIST <be_id>[, ...]
DELETE { BACKEND | COMPUTE NODE } BLACKLIST { <be_id>[, ...] | <cn_id>[, ...] }
```
## 参数说明
## Parameters
`be_id`:要从黑名单中移除的 BE 节点的 ID。您可以通过执行 [SHOW BACKEND BLACKLIST](SHOW_BACKEND_BLACKLIST.md) 语句获取被列入黑名单的 BE 的 ID。
`be_id``cn_id`:要从黑名单中移除的 BE 或 CN 节点的 ID。您可以通过执行 [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md) 获取被列入黑名单的 BE/CN 的 ID。
## 示例
## Examples
```SQL
DELETE BACKEND BLACKLIST 10001;
```
## 相关 SQL
- [ADD BACKEND BLACKLIST](ADD_BACKEND_BLACKLIST.md)
- [SHOW BACKEND BLACKLIST](SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
## Relevant SQLs
- [ADD BACKEND/COMPUTE NODE BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [SHOW BACKEND/COMPUTE NODE BLACKLIST](./SHOW_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](./SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)

View File

@ -2,49 +2,56 @@
displayed_sidebar: docs
---
# SHOW BACKEND BLACKLIST
# SHOW BACKEND/COMPUTE NODE BLACKLIST
## 功能
显示在 BE 和 CN 黑名单中的 BE/CN 节点。
查看 BE 黑名单中的节点。
此功能自 v3.3.0 起支持。更多信息,参考[管理 BE 黑名单](../../../../administration/management/BE_blacklist.md)。
BE 黑名单从 v3.3.0 开始支持CN 黑名单从 v4.0 开始支持。有关更多信息,请参阅 [Manage BE and CN Blacklist](../../../../administration/management/BE_blacklist.md)。
:::note
该操作需要有 SYSTEM 级 BLACKLIST 权限
只有具有 SYSTEM 级别 BLACKLIST 权限的用户才能执行此操作
:::
## 语法
## Syntax
```SQL
SHOW BACKEND BLACKLIST
SHOW { BACKEND | COMPUTE NODE } BLACKLIST
```
## 返回
## Return value
| **返回** | **说明** |
| **Return** | **Description** |
| ---------------------------- | ------------------------------------------------------------ |
| AddBlackListType | BE 节点被添加到黑名单的方式。`MANUAL` 表示由用户手动添加到黑名单。`AUTO` 表示由 StarRocks 自动添加到黑名单。 |
| LostConnectionTime | 对于 `MANUAL` 类型,表示 BE 节点被手动添加到黑名单的时间。<br />对于 `AUTO` 类型,表示最后一次成功建立连接的时间。 |
| LostConnectionNumberInPeriod | 在 `CheckTimePeriod(s)` 内检测到的断连次数。 |
| CheckTimePeriod(s) | StarRocks 检查黑名单中 BE 节点连接状态的间隔。其值等于您在 FE 配置项 `black_host_history_sec`指定的值。单位:秒。 |
| AddBlackListType | BE/CN 节点被添加到黑名单的方式。`MANUAL` 表示由用户手动加入黑名单。`AUTO` 表示由 StarRocks 自动加入黑名单。 |
| LostConnectionTime | 对于 `MANUAL` 类型,表示 BE/CN 节点被手动加入黑名单的时间。<br />对于 `AUTO` 类型,表示上次成功连接的时间。 |
| LostConnectionNumberInPeriod | 在 `CheckTimePeriod(s)` 内检测到的断次数。 |
| CheckTimePeriod(s) | StarRocks 检查黑名单中 BE/CN 节点连接状态的间隔。其值为您为 FE 配置项 `black_host_history_sec` 指定的值。单位:秒。 |
## 示例
## Examples
```SQL
-- 查看 BE 黑名单。
SHOW BACKEND BLACKLIST;
+-----------+------------------+---------------------+------------------------------+--------------------+
| BackendId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+-----------+------------------+---------------------+------------------------------+--------------------+
| 10001 | MANUAL | 2024-04-28 11:52:09 | 0 | 5 |
+-----------+------------------+---------------------+------------------------------+--------------------+
-- 查看 CN 黑名单。
SHOW COMPUTE NODE BLACKLIST;
+---------------+------------------+---------------------+------------------------------+--------------------+
| ComputeNodeId | AddBlackListType | LostConnectionTime | LostConnectionNumberInPeriod | CheckTimePeriod(s) |
+---------------+------------------+---------------------+------------------------------+--------------------+
| 10005 | MANUAL | 2025-08-18 10:47:51 | 0 | 5 |
+---------------+------------------+---------------------+------------------------------+--------------------+
```
## 相关 SQL
- [ADD BACKEND BLACKLIST](ADD_BACKEND_BLACKLIST.md)
- [DELETE BACKEND BLACKLIST](DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](./SHOW_BACKENDS.md)
## Relevant SQLs
- [ADD BACKEND/COMPUTE NODE BLACKLIST](./ADD_BACKEND_BLACKLIST.md)
- [DELETE BACKEND/COMPUTE NODE BLACKLIST](./DELETE_BACKEND_BLACKLIST.md)
- [SHOW BACKENDS](SHOW_BACKENDS.md)
- [SHOW COMPUTE NODES](./SHOW_COMPUTE_NODES.md)