- 25.6.17.1 ndbinfo arbitrator_validity_detail 資料表
- 25.6.17.2 ndbinfo arbitrator_validity_summary 資料表
- 25.6.17.3 ndbinfo backup_id 資料表
- 25.6.17.4 ndbinfo blobs 資料表
- 25.6.17.5 ndbinfo blocks 資料表
- 25.6.17.6 ndbinfo certificates 資料表
- 25.6.17.7 ndbinfo cluster_locks 資料表
- 25.6.17.8 ndbinfo cluster_operations 資料表
- 25.6.17.9 ndbinfo cluster_transactions 資料表
- 25.6.17.10 ndbinfo config_nodes 資料表
- 25.6.17.11 ndbinfo config_params 資料表
- 25.6.17.12 ndbinfo config_values 資料表
- 25.6.17.13 ndbinfo counters 資料表
- 25.6.17.14 ndbinfo cpudata 資料表
- 25.6.17.15 ndbinfo cpudata_1sec 資料表
- 25.6.17.16 ndbinfo cpudata_20sec 資料表
- 25.6.17.17 ndbinfo cpudata_50ms 資料表
- 25.6.17.18 ndbinfo cpuinfo 資料表
- 25.6.17.19 ndbinfo cpustat 資料表
- 25.6.17.20 ndbinfo cpustat_50ms 資料表
- 25.6.17.21 ndbinfo cpustat_1sec 資料表
- 25.6.17.22 ndbinfo cpustat_20sec 資料表
- 25.6.17.23 ndbinfo dictionary_columns 資料表
- 25.6.17.24 ndbinfo dictionary_tables 資料表
- 25.6.17.25 ndbinfo dict_obj_info 資料表
- 25.6.17.26 ndbinfo dict_obj_tree 資料表
- 25.6.17.27 ndbinfo dict_obj_types 資料表
- 25.6.17.28 ndbinfo disk_write_speed_base 資料表
- 25.6.17.29 ndbinfo disk_write_speed_aggregate 資料表
- 25.6.17.30 ndbinfo disk_write_speed_aggregate_node 資料表
- 25.6.17.31 ndbinfo diskpagebuffer 資料表
- 25.6.17.32 ndbinfo diskstat 資料表
- 25.6.17.33 ndbinfo diskstats_1sec 資料表
- 25.6.17.34 ndbinfo error_messages 資料表
- 25.6.17.35 ndbinfo events 資料表
- 25.6.17.36 ndbinfo files 資料表
- 25.6.17.37 ndbinfo foreign_keys 資料表
- 25.6.17.38 ndbinfo hash_maps 資料表
- 25.6.17.39 ndbinfo hwinfo 資料表
- 25.6.17.40 ndbinfo index_columns 資料表
- 25.6.17.41 ndbinfo index_stats 資料表
- 25.6.17.42 ndbinfo locks_per_fragment 資料表
- 25.6.17.43 ndbinfo logbuffers 資料表
- 25.6.17.44 ndbinfo logspaces 資料表
- 25.6.17.45 ndbinfo membership 資料表
- 25.6.17.46 ndbinfo memoryusage 資料表
- 25.6.17.47 ndbinfo memory_per_fragment 資料表
- 25.6.17.48 ndbinfo nodes 資料表
- 25.6.17.49 ndbinfo operations_per_fragment 資料表
- 25.6.17.50 ndbinfo pgman_time_track_stats 資料表
- 25.6.17.51 ndbinfo processes 資料表
- 25.6.17.52 ndbinfo resources 資料表
- 25.6.17.53 ndbinfo restart_info 資料表
- 25.6.17.54 ndbinfo server_locks 資料表
- 25.6.17.55 ndbinfo server_operations 資料表
- 25.6.17.56 ndbinfo server_transactions 資料表
- 25.6.17.57 ndbinfo table_distribution_status 資料表
- 25.6.17.58 ndbinfo table_fragments 資料表
- 25.6.17.59 ndbinfo table_info 資料表
- 25.6.17.60 ndbinfo table_replicas 資料表
- 25.6.17.61 ndbinfo tc_time_track_stats 資料表
- 25.6.17.62 ndbinfo threadblocks 資料表
- 25.6.17.63 ndbinfo threads 資料表
- 25.6.17.64 ndbinfo threadstat 資料表
- 25.6.17.65 ndbinfo transporter_details 資料表
- 25.6.17.66 ndbinfo transporters 資料表
ndbinfo
是一個包含 NDB Cluster 特定資訊的資料庫。
這個資料庫包含許多資料表,每個資料表提供關於 NDB Cluster 節點狀態、資源使用和操作的不同類型資料。您可以在接下來的幾個章節中找到有關每個資料表的詳細資訊。
ndbinfo
包含在 MySQL Server 的 NDB Cluster 支援中;不需要特殊的編譯或組態步驟;資料表會在 MySQL Server 連接到叢集時建立。您可以使用 SHOW PLUGINS
來驗證給定的 MySQL Server 執行個體中是否啟用 ndbinfo
支援;如果啟用 ndbinfo
支援,您應該會在 Name
欄中看到包含 ndbinfo
的列,在 Status
欄中看到 ACTIVE
,如下所示(強調文字)
mysql> SHOW PLUGINS;
+----------------------------------+--------+--------------------+---------+---------+
| Name | Status | Type | Library | License |
+----------------------------------+--------+--------------------+---------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| sha256_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| caching_sha2_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| sha2_cache_cleaner | ACTIVE | AUDIT | NULL | GPL |
| daemon_keyring_proxy_plugin | ACTIVE | DAEMON | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_PER_INDEX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_PER_INDEX_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_PAGE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_PAGE_LRU | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_POOL_STATS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_TEMP_TABLE_INFO | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_METRICS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_DEFAULT_STOPWORD | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_DELETED | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_BEING_DELETED | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_CONFIG | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_INDEX_CACHE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_INDEX_TABLE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_TABLES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_TABLESTATS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_INDEXES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_TABLESPACES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_COLUMNS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_VIRTUAL | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CACHED_INDEXES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SESSION_TEMP_TABLESPACES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL | GPL |
| TempTable | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ndbcluster | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ndbinfo | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ndb_transid_mysql_connection_map | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| ngram | ACTIVE | FTPARSER | NULL | GPL |
| mysqlx_cache_cleaner | ACTIVE | AUDIT | NULL | GPL |
| mysqlx | ACTIVE | DAEMON | NULL | GPL |
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL |
+----------------------------------+--------+--------------------+---------+---------+
47 rows in set (0.00 sec)
您也可以透過檢查 SHOW ENGINES
的輸出,尋找包含 Engine
欄中的 ndbinfo
和 Support
欄中的 YES
的行來完成此操作,如下所示(強調文字)
mysql> SHOW ENGINES\G
*************************** 1. row ***************************
Engine: MEMORY
Support: YES
Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
XA: NO
Savepoints: NO
*************************** 2. row ***************************
Engine: InnoDB
Support: DEFAULT
Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
XA: YES
Savepoints: YES
*************************** 3. row ***************************
Engine: PERFORMANCE_SCHEMA
Support: YES
Comment: Performance Schema
Transactions: NO
XA: NO
Savepoints: NO
*************************** 4. row ***************************
Engine: MyISAM
Support: YES
Comment: MyISAM storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 5. row ***************************
Engine: ndbinfo
Support: YES
Comment: MySQL Cluster system information storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 6. row ***************************
Engine: MRG_MYISAM
Support: YES
Comment: Collection of identical MyISAM tables
Transactions: NO
XA: NO
Savepoints: NO
*************************** 7. row ***************************
Engine: BLACKHOLE
Support: YES
Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
XA: NO
Savepoints: NO
*************************** 8. row ***************************
Engine: CSV
Support: YES
Comment: CSV storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 9. row ***************************
Engine: ARCHIVE
Support: YES
Comment: Archive storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 10. row ***************************
Engine: ndbcluster
Support: YES
Comment: Clustered, fault-tolerant tables
Transactions: YES
XA: NO
Savepoints: NO
10 rows in set (0.01 sec)
如果啟用 ndbinfo
支援,您可以使用 mysql 或其他 MySQL 用戶端中的 SQL 陳述式來存取 ndbinfo
。例如,您可以在 SHOW DATABASES
的輸出中看到列出的 ndbinfo
,如下所示(強調文字)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| ndbinfo |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.04 sec)
如果 mysqld 程序啟動時未使用 --ndbcluster
選項,則 ndbinfo
將不可用,且不會由 SHOW DATABASES
顯示。如果 mysqld 先前已連線到 NDB Cluster,但叢集變得不可用(由於叢集關閉、網路連線遺失等事件),ndbinfo
及其資料表仍會顯示,但嘗試存取任何資料表(除了 blocks
或 config_params
)時,會失敗並出現 從 NDBINFO 取得錯誤 157 '與 NDB 連線失敗' 的錯誤訊息。
除了 blocks
和 config_params
資料表之外,我們所指的 ndbinfo
“資料表” 實際上是從內部 NDB
資料表產生的檢視表,這些資料表通常對 MySQL Server 不可見。您可以將 ndbinfo_show_hidden
系統變數設定為 ON
(或 1
) 來使這些資料表可見,但通常不需要這樣做。
所有 ndbinfo
資料表都是唯讀的,並且在查詢時按需產生。由於它們中的許多資料表是由資料節點並行產生,而其他資料表是特定於給定的 SQL 節點的,因此它們不保證提供一致的快照。
此外,ndbinfo
資料表不支援推送合併;因此,即使查詢使用了 WHERE
子句,合併大型 ndbinfo
資料表也可能需要將大量資料傳輸到請求的 API 節點。
ndbinfo
資料表不包含在查詢快取中。(錯誤 #59831)
您可以使用 USE
陳述式選取 ndbinfo
資料庫,然後發出 SHOW TABLES
陳述式來取得資料表清單,就像其他任何資料庫一樣,如下所示
mysql> USE ndbinfo;
Database changed
mysql> SHOW TABLES;
+---------------------------------+
| Tables_in_ndbinfo |
+---------------------------------+
| arbitrator_validity_detail |
| arbitrator_validity_summary |
| backup_id |
| blobs |
| blocks |
| certificates |
| cluster_locks |
| cluster_operations |
| cluster_transactions |
| config_nodes |
| config_params |
| config_values |
| counters |
| cpudata |
| cpudata_1sec |
| cpudata_20sec |
| cpudata_50ms |
| cpuinfo |
| cpustat |
| cpustat_1sec |
| cpustat_20sec |
| cpustat_50ms |
| dict_obj_info |
| dict_obj_tree |
| dict_obj_types |
| dictionary_columns |
| dictionary_tables |
| disk_write_speed_aggregate |
| disk_write_speed_aggregate_node |
| disk_write_speed_base |
| diskpagebuffer |
| diskstat |
| diskstats_1sec |
| error_messages |
| events |
| files |
| foreign_keys |
| hash_maps |
| hwinfo |
| index_columns |
| index_stats |
| locks_per_fragment |
| logbuffers |
| logspaces |
| membership |
| memory_per_fragment |
| memoryusage |
| nodes |
| operations_per_fragment |
| pgman_time_track_stats |
| processes |
| resources |
| restart_info |
| server_locks |
| server_operations |
| server_transactions |
| table_distribution_status |
| table_fragments |
| table_info |
| table_replicas |
| tc_time_track_stats |
| threadblocks |
| threads |
| threadstat |
| transporter_details |
| transporters |
+---------------------------------+
66 rows in set (0.00 sec)
所有 ndbinfo
資料表都使用 NDB
儲存引擎;但是,如前所述,ndbinfo
條目仍會出現在 SHOW ENGINES
和 SHOW PLUGINS
的輸出中。
您可以針對這些資料表執行 SELECT
陳述式,就像您通常期望的那樣
mysql> SELECT * FROM memoryusage;
+---------+---------------------+--------+------------+------------+-------------+
| node_id | memory_type | used | used_pages | total | total_pages |
+---------+---------------------+--------+------------+------------+-------------+
| 5 | Data memory | 425984 | 13 | 2147483648 | 65536 |
| 5 | Long message buffer | 393216 | 1536 | 67108864 | 262144 |
| 6 | Data memory | 425984 | 13 | 2147483648 | 65536 |
| 6 | Long message buffer | 393216 | 1536 | 67108864 | 262144 |
| 7 | Data memory | 425984 | 13 | 2147483648 | 65536 |
| 7 | Long message buffer | 393216 | 1536 | 67108864 | 262144 |
| 8 | Data memory | 425984 | 13 | 2147483648 | 65536 |
| 8 | Long message buffer | 393216 | 1536 | 67108864 | 262144 |
+---------+---------------------+--------+------------+------------+-------------+
8 rows in set (0.09 sec)
更複雜的查詢是可能的,例如,以下兩個使用 memoryusage
資料表的 SELECT
陳述式
mysql> SELECT SUM(used) as 'Data Memory Used, All Nodes'
> FROM memoryusage
> WHERE memory_type = 'Data memory';
+-----------------------------+
| Data Memory Used, All Nodes |
+-----------------------------+
| 6460 |
+-----------------------------+
1 row in set (0.09 sec)
mysql> SELECT SUM(used) as 'Long Message Buffer, All Nodes'
> FROM memoryusage
> WHERE memory_type = 'Long message buffer';
+-------------------------------------+
| Long Message Buffer Used, All Nodes |
+-------------------------------------+
| 1179648 |
+-------------------------------------+
1 row in set (0.08 sec)
ndbinfo
資料表和資料行名稱區分大小寫(ndbinfo
資料庫本身的名稱也是如此)。這些識別碼都是小寫。嘗試使用錯誤的大小寫字母會導致錯誤,如此範例所示
mysql> SELECT * FROM nodes;
+---------+--------+---------+-------------+-------------------+
| node_id | uptime | status | start_phase | config_generation |
+---------+--------+---------+-------------+-------------------+
| 5 | 17707 | STARTED | 0 | 1 |
| 6 | 17706 | STARTED | 0 | 1 |
| 7 | 17705 | STARTED | 0 | 1 |
| 8 | 17704 | STARTED | 0 | 1 |
+---------+--------+---------+-------------+-------------------+
4 rows in set (0.06 sec)
mysql> SELECT * FROM Nodes;
ERROR 1146 (42S02): Table 'ndbinfo.Nodes' doesn't exist
mysqldump 會完全忽略 ndbinfo
資料庫,並將其從任何輸出中排除。即使使用 --databases
或 --all-databases
選項也是如此。
NDB Cluster 也會在 INFORMATION_SCHEMA
資訊資料庫中維護資料表,包括 FILES
資料表,其中包含有關用於 NDB Cluster 磁碟資料儲存的檔案資訊,以及 ndb_transid_mysql_connection_map
資料表,其中顯示了交易、交易協調器和 NDB Cluster API 節點之間的關係。如需更多資訊,請參閱資料表的描述或 章節 25.6.18,「適用於 NDB Cluster 的 INFORMATION_SCHEMA 資料表」。