- 18.6.15.1 ndbinfo arbitrator_validity_detail 表
- 18.6.15.2 ndbinfo arbitrator_validity_summary 表
- 18.6.15.3 ndbinfo 块表
- 18.6.15.4 ndbinfo cluster_operations 表
- 18.6.15.5 ndbinfo cluster_transactions 表
- 18.6.15.6 ndbinfo config_params 表
- 18.6.15.7 ndbinfo 计数器表
- 18.6.15.8 ndbinfo dict_obj_types 表
- 18.6.15.9 ndbinfo disk_write_speed_base 表
- 18.6.15.10 ndbinfo disk_write_speed_aggregate 表
- 18.6.15.11 ndbinfo disk_write_speed_aggregate_node 表
- 18.6.15.12 ndbinfo diskpagebuffer 表
- 18.6.15.13 ndbinfo 日志缓冲区表
- 18.6.15.14 ndbinfo 日志空间表
- 18.6.15.15 ndbinfo 成员表
- 18.6.15.16 ndbinfo 内存使用表
- 18.6.15.17 ndbinfo memory_per_fragment 表
- 18.6.15.18 ndbinfo节点表
- 18.6.15.19 ndbinfo operations_per_fragment 表
- 18.6.15.20 ndbinfo 资源表
- 18.6.15.21 ndbinfo restart_info 表
- 18.6.15.22 ndbinfo server_operations 表
- 18.6.15.23 ndbinfo server_transactions 表
- 18.6.15.24 ndbinfo tc_time_track_stats 表
- 18.6.15.25 ndbinfo 线程块表
- 18.6.15.26 ndbinfo threadstat 表
- 18.6.15.27 ndbinfo 传输器表
ndbinfo
是一个包含 NDB Cluster 特定信息的数据库。
该数据库包含许多表,每个表提供有关 NDB Cluster 节点状态、资源使用情况和操作的不同类型的数据。您可以在接下来的几节中找到有关每个表的更多详细信息。
ndbinfo
包含在 MySQL 服务器中的 NDB Cluster 支持中;不需要特殊的编译或配置步骤;这些表由 MySQL 服务器在连接到集群时创建。您可以验证
ndbinfo
支持在给定的 MySQL 服务器实例中使用SHOW PLUGINS
;如果ndbinfo
启用了支持,您应该会看到包含ndbinfo
在
Name
列中和列ACTIVE
中的Status
行,如下所示(强调文本):
mysql> SHOW PLUGINS;
+----------------------------------+--------+--------------------+---------+---------+
| Name | Status | Type | Library | License |
+----------------------------------+--------+--------------------+---------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| mysql_old_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | 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 |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCK_WAITS | 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 |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
+----------------------------------+--------+--------------------+---------+---------+
22 rows in set (0.00 sec)
您还可以通过检查
SHOW ENGINES
包含
ndbinfo
在Engine
列中和列YES
中的行的输出来执行此操作Support
,如此处所示(强调文本):
mysql> SHOW ENGINES\G
*************************** 1. row ***************************
Engine: ndbcluster
Support: YES
Comment: Clustered, fault-tolerant tables
Transactions: YES
XA: NO
Savepoints: NO
*************************** 2. row ***************************
Engine: MRG_MYISAM
Support: YES
Comment: Collection of identical MyISAM tables
Transactions: NO
XA: NO
Savepoints: NO
*************************** 3. row ***************************
Engine: ndbinfo
Support: YES
Comment: NDB Cluster system information storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 4. row ***************************
Engine: CSV
Support: YES
Comment: CSV storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 5. row ***************************
Engine: MEMORY
Support: YES
Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
XA: NO
Savepoints: NO
*************************** 6. row ***************************
Engine: FEDERATED
Support: NO
Comment: Federated MySQL storage engine
Transactions: NULL
XA: NULL
Savepoints: NULL
*************************** 7. row ***************************
Engine: ARCHIVE
Support: YES
Comment: Archive storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 8. row ***************************
Engine: InnoDB
Support: YES
Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
XA: YES
Savepoints: YES
*************************** 9. row ***************************
Engine: MyISAM
Support: DEFAULT
Comment: Default engine as of MySQL 3.23 with great performance
Transactions: NO
XA: NO
Savepoints: NO
*************************** 10. row ***************************
Engine: BLACKHOLE
Support: YES
Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
XA: NO
Savepoints: NO
10 rows in set (0.00 sec)
如果ndbinfo
启用了支持,那么您可以在mysql或其他 MySQL 客户端ndbinfo
中使用 SQL 语句
访问。例如,您可以在 的输出中看到 listed
,如下所示(强调文本):
ndbinfo
SHOW DATABASES
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| ndbinfo |
| test |
+--------------------+
4 rows in set (0.00 sec)
如果mysqld进程未使用该
--ndbcluster
选项启动,
ndbinfo
则不可用且不显示SHOW DATABASES
。如果
mysqld以前连接到 NDB Cluster 但集群变得不可用(由于集群关闭、网络连接丢失等事件),
ndbinfo
并且其表仍然可见,但尝试访问任何表(除了blocks
或config_params
) 失败并从 NDBINFO 得到错误 157 'Connection to NDB failed'。
除了表blocks
和config_params
表之外,我们所说的ndbinfo
“表”
实际上是从
NDB
通常对 MySQL 服务器不可见的内部表生成的视图。ndbinfo_show_hidden
您可以通过将系统变量设置为ON
(或)使这些表可见
1
,但这通常不是必需的。
所有ndbinfo
表都是只读的,在查询时按需生成。因为它们中的许多是由数据节点并行生成的,而其他的则特定于给定的 SQL 节点,因此不能保证它们提供一致的快照。
此外,表不支持下推连接
ndbinfo
;因此连接大型
ndbinfo
表可能需要将大量数据传输到请求 API 节点,即使查询使用了WHERE
子句也是如此。
ndbinfo
表不包含在查询缓存中。(漏洞 #59831)
您可以使用语句选择ndbinfo
数据库
USE
,然后发出
SHOW TABLES
语句以获取表列表,就像任何其他数据库一样,如下所示:
mysql> USE ndbinfo;
Database changed
mysql> SHOW TABLES;
+---------------------------------+
| Tables_in_ndbinfo |
+---------------------------------+
| arbitrator_validity_detail |
| arbitrator_validity_summary |
| blocks |
| cluster_operations |
| cluster_transactions |
| config_params |
| counters |
| dict_obj_types |
| disk_write_speed_aggregate |
| disk_write_speed_aggregate_node |
| disk_write_speed_base |
| diskpagebuffer |
| logbuffers |
| logspaces |
| membership |
| memory_per_fragment |
| memoryusage |
| nodes |
| operations_per_fragment |
| resources |
| restart_info |
| server_operations |
| server_transactions |
| threadblocks |
| threadstat |
| transporters |
+---------------------------------+
26 rows in set (0.00 sec)
NDB 7.4 中添加了
, dict_obj_types
,
disk_write_speed_aggregate
,
disk_write_speed_aggregate_node
,
disk_write_speed_base
和
restart_info
表
。operations_per_fragment
您可以对这些表执行SELECT
语句,就像您通常期望的那样:
mysql> SELECT * FROM memoryusage;
+---------+---------------------+--------+------------+------------+-------------+
| node_id | memory_type | used | used_pages | total | total_pages |
+---------+---------------------+--------+------------+------------+-------------+
| 5 | Data memory | 753664 | 23 | 1073741824 | 32768 |
| 5 | Index memory | 163840 | 20 | 1074003968 | 131104 |
| 5 | Long message buffer | 2304 | 9 | 67108864 | 262144 |
| 6 | Data memory | 753664 | 23 | 1073741824 | 32768 |
| 6 | Index memory | 163840 | 20 | 1074003968 | 131104 |
| 6 | Long message buffer | 2304 | 9 | 67108864 | 262144 |
+---------+---------------------+--------+------------+------------+-------------+
6 rows in set (0.02 sec)
更复杂的查询,例如以下两个
SELECT
使用该
memoryusage
表的语句,是可能的:
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.37 sec)
mysql> SELECT SUM(max) as 'Total IndexMemory Available'
> FROM memoryusage
> WHERE memory_type = 'Index memory';
+-----------------------------+
| Total IndexMemory Available |
+-----------------------------+
| 25664 |
+-----------------------------+
1 row in set (0.33 sec)
ndbinfo
表名和列名区分大小写(ndbinfo
数据库本身的名称也是如此)。这些标识符是小写的。尝试使用错误的字母大小写会导致错误,如本例所示:
mysql> SELECT * FROM nodes;
+---------+--------+---------+-------------+
| node_id | uptime | status | start_phase |
+---------+--------+---------+-------------+
| 1 | 13602 | STARTED | 0 |
| 2 | 16 | STARTED | 0 |
+---------+--------+---------+-------------+
2 rows in set (0.04 sec)
mysql> SELECT * FROM Nodes;
ERROR 1146 (42S02): Table 'ndbinfo.Nodes' doesn't exist
mysqldump完全忽略
ndbinfo
数据库,并将其从任何输出中排除。即使使用
--databases
or
--all-databases
选项也是如此。
NDB Cluster 还在
INFORMATION_SCHEMA
信息数据库中维护表,包括FILES
包含有关用于 NDB Cluster 磁盘数据存储的文件信息的
ndb_transid_mysql_connection_map
表,以及显示事务、事务协调器和 NDB Cluster API 节点之间关系的表。有关更多信息,请参阅表的描述或
第 21.5 节,“INFORMATION_SCHEMA NDB 集群表”。