Skip to content

Commit d526b74

Browse files
authored
add show services from 2082 (#1003)
* add show services from 2082 * add update hint in the front * fix link * update version num
1 parent fbbe129 commit d526b74

32 files changed

Lines changed: 790 additions & 94 deletions

src/UserGuide/Master/Table/Reference/System-Config-Manual_apache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,10 +1532,10 @@ The `iotdb-system.properties` file contains various configurations for managing
15321532
- slow_query_threshold
15331533

15341534
| Name | slow_query_threshold |
1535-
| ----------- | -------------------------------------- |
1535+
| ----------- |----------------------------------------|
15361536
| Description | Time cost(ms) threshold for slow query |
15371537
| Type | long |
1538-
| Default | 10000 |
1538+
| Default | 3000 |
15391539
| Effective | Hot reload |
15401540

15411541
- query_cost_stat_window

src/UserGuide/Master/Table/Reference/System-Config-Manual_timecho.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,10 +1533,10 @@ The `iotdb-system.properties` file contains various configurations for managing
15331533
- slow_query_threshold
15341534

15351535
| Name | slow_query_threshold |
1536-
| ----------- | -------------------------------------- |
1536+
| ----------- |----------------------------------------|
15371537
| Description | Time cost(ms) threshold for slow query |
15381538
| Type | long |
1539-
| Default | 10000 |
1539+
| Default | 3000 |
15401540
| Effective | Hot reload |
15411541

15421542
- query_cost_stat_window

src/UserGuide/Master/Table/Reference/System-Tables_apache.md

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ IoTDB> show tables from information_schema
5757
| queries| INF|
5858
|queries_costs_histogram| INF|
5959
| regions| INF|
60+
| services| INF|
6061
| subscriptions| INF|
6162
| tables| INF|
6263
| topics| INF|
@@ -66,7 +67,7 @@ IoTDB> show tables from information_schema
6667

6768
## 2. System Tables
6869

69-
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES` , `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM` (detailed descriptions in later sections)
70+
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES` , `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM`, `SERVICES` (detailed descriptions in later sections)
7071
***Operations**​: Read-only, only supports `SELECT`, `COUNT/SHOW DEVICES`, `DESC`. Any modifications to table structure or content are not allowed and will result in an error: `"The database 'information_schema' can only be queried." `
7172
***Column Names**​: System table column names are all lowercase by default and separated by underscores (`_`).
7273

@@ -343,7 +344,7 @@ IoTDB> select * from information_schema.topics
343344
+----------+----------------------------------------------------------------+
344345
```
345346

346-
### 2.10 VIEWS Table
347+
### 2.10 VIEWS
347348

348349
> This system table is available starting from version V2.0.5.
349350
@@ -369,9 +370,9 @@ IoTDB> select * from information_schema.views
369370
```
370371

371372

372-
### 2.11 MODELS Table
373+
### 2.11 MODELS
373374

374-
> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8.
375+
> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8-beta.
375376
376377
* Contains information about all models in the database.
377378
* The table structure is as follows:
@@ -402,7 +403,7 @@ IoTDB> select * from information_schema.models where model_type = 'BUILT_IN_FORE
402403
```
403404

404405

405-
### 2.12 FUNCTIONS Table
406+
### 2.12 FUNCTIONS
406407

407408
> This system table is available starting from version V2.0.5.
408409
@@ -434,7 +435,7 @@ IoTDB> select * from information_schema.functions where function_type='built-in
434435
```
435436

436437

437-
### 2.13 CONFIGURATIONS Table
438+
### 2.13 CONFIGURATIONS
438439

439440
> This system table is available starting from version V2.0.5.
440441
@@ -473,7 +474,7 @@ IoTDB> select * from information_schema.configurations
473474
```
474475

475476

476-
### 2.14 KEYWORDS Table
477+
### 2.14 KEYWORDS
477478

478479
> This system table is available starting from version V2.0.5.
479480
@@ -506,7 +507,7 @@ IoTDB> select * from information_schema.keywords limit 10
506507
```
507508

508509

509-
### 2.15 NODES Table
510+
### 2.15 NODES
510511

511512
> This system table is available starting from version V2.0.5.
512513
@@ -538,7 +539,7 @@ IoTDB> select * from information_schema.nodes
538539
```
539540

540541

541-
### 2.16 CONFIG\_NODES Table
542+
### 2.16 CONFIG\_NODES
542543

543544
> This system table is available starting from version V2.0.5.
544545
@@ -564,7 +565,7 @@ IoTDB> select * from information_schema.config_nodes
564565
```
565566

566567

567-
### 2.17 DATA\_NODES Table
568+
### 2.17 DATA\_NODES
568569

569570
> This system table is available starting from version V2.0.5.
570571
@@ -594,9 +595,9 @@ IoTDB> select * from information_schema.data_nodes
594595
+-------+---------------+-----------------+-----------+--------+--------+-------------------+---------------------+
595596
```
596597

597-
### 2.18 CONNECTIONS Table
598+
### 2.18 CONNECTIONS
598599

599-
> This system table is available starting from version V 2.0.8
600+
> This system table is available starting from version V 2.0.8-beta
600601
601602
* Contains all connections in the cluster.
602603
* The table structure is as follows:
@@ -621,9 +622,9 @@ IoTDB> select * from information_schema.connections;
621622
+-----------+-------+----------+---------+-----------------------------+---------+
622623
```
623624

624-
### 2.19 CURRENT_QUERIES Table
625+
### 2.19 CURRENT_QUERIES
625626

626-
> This system table is available starting from version V 2.0.8
627+
> This system table is available starting from version V 2.0.8-beta
627628
628629
* Contains all queries whose execution end time falls within the range `[now() - query_cost_stat_window, now())`, including currently executing queries. The `query_cost_stat_window` parameter represents the query cost statistics window. Its default value is 0 and can be configured via the `iotdb-system.properties` configuration file.
629630
* The table structure is as follows:
@@ -652,9 +653,9 @@ IoTDB> select * from information_schema.current_queries;
652653
+-----------------------+-------+-----------------------------+--------+-----------+---------+------------------------------------------------+----+---------+
653654
```
654655

655-
### 2.20 QUERIES_COSTS_HISTOGRAM Table
656+
### 2.20 QUERIES_COSTS_HISTOGRAM
656657

657-
> This system table is available starting from version V 2.0.8
658+
> This system table is available starting from version V 2.0.8-beta
658659
659660
* Contains a histogram of query execution times within the past `query_cost_stat_window` period (only statistics for completed SQL queries). The `query_cost_stat_window` parameter represents the query cost statistics window. Its default value is 0 and can be configured via the `iotdb-system.properties` configuration file.
660661
* The table structure is as follows:
@@ -686,6 +687,31 @@ IoTDB> select * from information_schema.queries_costs_histogram limit 10
686687
+------+----+-----------+
687688
```
688689

690+
### 2.21 SERVICES
691+
692+
> This system table is available starting from version V 2.0.8-beta
693+
694+
* Displays services (MQTT service, REST service) on all active DataNodes (with RUNNING or READ-ONLY status).
695+
* Table structure:
696+
697+
| Column Name | Data Type | Column Type | Description |
698+
|---------------|-----------|-------------|---------------------------------|
699+
| service_name | STRING | TAG | Service Name |
700+
| datanode_id | INT32 | ATTRIBUTE | DataNode ID where service runs |
701+
| state | STRING | ATTRIBUTE | Service status: RUNNING/STOPPED |
702+
703+
704+
* Query example:
705+
706+
```sql
707+
IoTDB> SELECT * FROM information_schema.services
708+
+------------+-----------+---------+
709+
|service_name|datanode_id|state |
710+
+------------+-----------+---------+
711+
|MQTT |1 |STOPPED |
712+
|REST |1 |RUNNING |
713+
+------------+-----------+---------+
714+
```
689715

690716
## 3. Permission Description
691717

src/UserGuide/Master/Table/Reference/System-Tables_timecho.md

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
IoTDB has a built-in system database called `INFORMATION_SCHEMA`, which contains a series of system tables for storing IoTDB runtime information (such as currently executing SQL statements, etc.). Currently, the `INFORMATION_SCHEMA` database only supports read operations.
2525

26+
> 💡 **[V2.0.8.2 Version Update]**<br>
27+
> 👉 Added onw system tables: **[SERVICES](#_2-21-services)** (service status management), enhancing cluster maintenance and performance analysis.
28+
29+
2630
## 1. System Database
2731

2832
***Name**​: `INFORMATION_SCHEMA`
@@ -57,6 +61,7 @@ IoTDB> show tables from information_schema
5761
| queries| INF|
5862
|queries_costs_histogram| INF|
5963
| regions| INF|
64+
| services| INF|
6065
| subscriptions| INF|
6166
| tables| INF|
6267
| topics| INF|
@@ -66,7 +71,7 @@ IoTDB> show tables from information_schema
6671

6772
## 2. System Tables
6873

69-
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES`, `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM` (detailed descriptions in later sections)
74+
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES`, `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM`, `SERVICES` (detailed descriptions in later sections)
7075
***Operations**​: Read-only, only supports `SELECT`, `COUNT/SHOW DEVICES`, `DESC`. Any modifications to table structure or content are not allowed and will result in an error: `"The database 'information_schema' can only be queried." `
7176
***Column Names**​: System table column names are all lowercase by default and separated by underscores (`_`).
7277

@@ -343,7 +348,7 @@ IoTDB> select * from information_schema.topics
343348
+----------+----------------------------------------------------------------+
344349
```
345350

346-
### 2.10 VIEWS Table
351+
### 2.10 VIEWS
347352

348353
> This system table is available starting from version V2.0.5.
349354
@@ -369,7 +374,7 @@ IoTDB> select * from information_schema.views
369374
```
370375

371376

372-
### 2.11 MODELS Table
377+
### 2.11 MODELS
373378

374379
> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8.
375380
@@ -402,7 +407,7 @@ IoTDB> select * from information_schema.models where model_type = 'BUILT_IN_FORE
402407
```
403408

404409

405-
### 2.12 FUNCTIONS Table
410+
### 2.12 FUNCTIONS
406411

407412
> This system table is available starting from version V2.0.5.
408413
@@ -434,7 +439,7 @@ IoTDB> select * from information_schema.functions where function_type='built-in
434439
```
435440

436441

437-
### 2.13 CONFIGURATIONS Table
442+
### 2.13 CONFIGURATIONS
438443

439444
> This system table is available starting from version V2.0.5.
440445
@@ -473,7 +478,7 @@ IoTDB> select * from information_schema.configurations
473478
```
474479

475480

476-
### 2.14 KEYWORDS Table
481+
### 2.14 KEYWORDS
477482

478483
> This system table is available starting from version V2.0.5.
479484
@@ -506,7 +511,7 @@ IoTDB> select * from information_schema.keywords limit 10
506511
```
507512

508513

509-
### 2.15 NODES Table
514+
### 2.15 NODES
510515

511516
> This system table is available starting from version V2.0.5.
512517
@@ -538,7 +543,7 @@ IoTDB> select * from information_schema.nodes
538543
```
539544

540545

541-
### 2.16 CONFIG\_NODES Table
546+
### 2.16 CONFIG\_NODES
542547

543548
> This system table is available starting from version V2.0.5.
544549
@@ -564,7 +569,7 @@ IoTDB> select * from information_schema.config_nodes
564569
```
565570

566571

567-
### 2.17 DATA\_NODES Table
572+
### 2.17 DATA\_NODES
568573

569574
> This system table is available starting from version V2.0.5.
570575
@@ -594,7 +599,7 @@ IoTDB> select * from information_schema.data_nodes
594599
+-------+---------------+-----------------+-----------+--------+--------+-------------------+---------------------+
595600
```
596601

597-
### 2.18 CONNECTIONS Table
602+
### 2.18 CONNECTIONS
598603

599604
> This system table is available starting from version V 2.0.8
600605
@@ -621,7 +626,7 @@ IoTDB> select * from information_schema.connections;
621626
+-----------+-------+----------+---------+-----------------------------+---------+
622627
```
623628

624-
### 2.19 CURRENT_QUERIES Table
629+
### 2.19 CURRENT_QUERIES
625630

626631
> This system table is available starting from version V 2.0.8
627632
@@ -652,7 +657,7 @@ IoTDB> select * from information_schema.current_queries;
652657
+-----------------------+-------+-----------------------------+--------+-----------+---------+------------------------------------------------+----+---------+
653658
```
654659

655-
### 2.20 QUERIES_COSTS_HISTOGRAM Table
660+
### 2.20 QUERIES_COSTS_HISTOGRAM
656661

657662
> This system table is available starting from version V 2.0.8
658663
@@ -686,6 +691,32 @@ IoTDB> select * from information_schema.queries_costs_histogram limit 10
686691
+------+----+-----------+
687692
```
688693

694+
### 2.21 SERVICES
695+
696+
> This system table is available starting from version V 2.0.8.2
697+
698+
* Displays services (MQTT service, REST service) on all active DataNodes (with RUNNING or READ-ONLY status).
699+
* Table structure:
700+
701+
| Column Name | Data Type | Column Type | Description |
702+
|---------------|-----------|-------------|---------------------------------|
703+
| service_name | STRING | TAG | Service Name |
704+
| datanode_id | INT32 | ATTRIBUTE | DataNode ID where service runs |
705+
| state | STRING | ATTRIBUTE | Service status: RUNNING/STOPPED |
706+
707+
708+
* Query example:
709+
710+
```sql
711+
IoTDB> SELECT * FROM information_schema.services
712+
+------------+-----------+---------+
713+
|service_name|datanode_id|state |
714+
+------------+-----------+---------+
715+
|MQTT |1 |STOPPED |
716+
|REST |1 |RUNNING |
717+
+------------+-----------+---------+
718+
```
719+
689720

690721
## 3. Permission Description
691722

src/UserGuide/Master/Table/User-Manual/Maintenance-commands_apache.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ IoTDB> SHOW REGIONS
341341

342342
**Description**: Returns the RPC addresses and ports of all available DataNodes in the current cluster. Note: A DataNode is considered "available" if it is not in the REMOVING state.
343343

344-
> This feature is supported starting from v2.0.8.
344+
> This feature is supported starting from v2.0.8-beta.
345345
346346
**Syntax**:
347347

@@ -367,6 +367,34 @@ IoTDB> SHOW AVAILABLE URLS
367367
+----------+-------+
368368
```
369369

370+
### 1.11 View Service Information
371+
372+
**Description**: Returns service information (MQTT service, REST service) on all active DataNodes (in RUNNING or READ-ONLY state) in the current cluster.
373+
374+
> Supported since V2.0.8-beta
375+
376+
#### Syntax:
377+
```sql
378+
showServicesStatement
379+
: SHOW SERVICES <ON dataNodeId>
380+
;
381+
```
382+
383+
#### Examples:
384+
```sql
385+
IoTDB> SHOW SERVICES
386+
IoTDB> SHOW SERVICES ON 1
387+
```
388+
389+
Execution result:
390+
```sql
391+
+--------------+-------------+---------+
392+
| Service Name | DataNode ID | State |
393+
+--------------+-------------+---------+
394+
| MQTT | 1 | STOPPED |
395+
| REST | 1 | RUNNING |
396+
+--------------+-------------+---------+
397+
```
370398

371399
## 2. Status Setting
372400

0 commit comments

Comments
 (0)