### 23.6.14 ndbinfo：NDB 集群信息数据库

[23.6.14.1 ndbinfo 仲裁器\_有效性\_明细表](mysql-cluster-ndbinfo-arbitrator-validity-detail.html)
[23.6.14.2 ndbinfo 仲裁器\_有效性\_汇总表](mysql-cluster-ndbinfo-arbitrator-validity-summary.html)
[23.6.14.3 ndbinfo 备份\_标识表](mysql-cluster-ndbinfo-backup-id.html)
[23.6.14.4 ndbinfo blob 表](mysql-cluster-ndbinfo-blobs.html)
[23.6.14.5 ndbinfo 块表](mysql-cluster-ndbinfo-blocks.html)
[23.6.14.6 ndbinfo 集群\_锁表](mysql-cluster-ndbinfo-cluster-locks.html)
[23.6.14.7 ndbinfo 集群\_操作表](mysql-cluster-ndbinfo-cluster-operations.html)
[23.6.14.8 ndbinfo 集群\_交易表](mysql-cluster-ndbinfo-cluster-transactions.html)
[23.6.14.9 ndbinfo 配置\_节点表](mysql-cluster-ndbinfo-config-nodes.html)
[23.6.14.10 ndbinfo 配置\_参数表](mysql-cluster-ndbinfo-config-params.html)
[23.6.14.11 ndbinfo 配置\_值表](mysql-cluster-ndbinfo-config-values.html)
[23.6.14.12 ndbinfo 计数器表](mysql-cluster-ndbinfo-counters.html)
[23.6.14.13 ndbinfo cpudata 表](mysql-cluster-ndbinfo-cpudata.html)
[23.6.14.14 ndbinfo cpudata_1秒表](mysql-cluster-ndbinfo-cpudata-1sec.html)
[23.6.14.15 ndbinfo cpudata_20秒表](mysql-cluster-ndbinfo-cpudata-20sec.html)
[23.6.14.16 ndbinfo cpudata_50ms 表](mysql-cluster-ndbinfo-cpudata-50ms.html)
[23.6.14.17 ndbinfo cpuinfo 表](mysql-cluster-ndbinfo-cpuinfo.html)
[23.6.14.18 ndbinfo cpustat 表](mysql-cluster-ndbinfo-cpustat.html)
[23.6.14.19 ndbinfo cpustat_50ms 表](mysql-cluster-ndbinfo-cpustat-50ms.html)
[23.6.14.20 ndbinfo cpustat_1秒表](mysql-cluster-ndbinfo-cpustat-1sec.html)
[23.6.14.21 ndbinfo cpustat_20秒表](mysql-cluster-ndbinfo-cpustat-20sec.html)
[23.6.14.22 ndbinfo 字典\_列表](mysql-cluster-ndbinfo-dictionary-columns.html)
[23.6.14.23 ndbinfo 字典\_表 表](mysql-cluster-ndbinfo-dictionary-tables.html)
[23.6.14.24 ndbinfo 字典\_对象\_信息表](mysql-cluster-ndbinfo-dict-obj-info.html)
[23.6.14.25 ndbinfo 字典\_对象\_树表](mysql-cluster-ndbinfo-dict-obj-tree.html)
[23.6.14.26 ndbinfo 字典\_对象\_类型表](mysql-cluster-ndbinfo-dict-obj-types.html)
[23.6.14.27 ndbinfo 磁盘\_写\_速度\_基表](mysql-cluster-ndbinfo-disk-write-speed-base.html)
[23.6.14.28 ndbinfo 磁盘\_写\_速度\_聚合表](mysql-cluster-ndbinfo-disk-write-speed-aggregate.html)
[23.6.14.29 ndbinfo 磁盘\_写\_速度\_总计的\_节点表](mysql-cluster-ndbinfo-disk-write-speed-aggregate-node.html)
[23.6.14.30 ndbinfo diskpagebuffer 表](mysql-cluster-ndbinfo-diskpagebuffer.html)
[23.6.14.31 ndbinfo diskstat 表](mysql-cluster-ndbinfo-diskstat.html)
[23.6.14.32 ndbinfo 磁盘统计信息\_1秒表](mysql-cluster-ndbinfo-diskstats-1sec.html)
[23.6.14.33 ndbinfo 错误\_消息表](mysql-cluster-ndbinfo-error-messages.html)
[23.6.14.34 ndbinfo 事件表](mysql-cluster-ndbinfo-events.html)
[23.6.14.35 ndbinfo 文件表](mysql-cluster-ndbinfo-files.html)
[23.6.14.36 ndbinfo 外\_键表](mysql-cluster-ndbinfo-foreign-keys.html)
[23.6.14.37 ndbinfo 哈希\_地图表](mysql-cluster-ndbinfo-hash-maps.html)
[23.6.14.38 ndbinfo hwinfo 表](mysql-cluster-ndbinfo-hwinfo.html)
[23.6.14.39 ndbinfo 索引\_列表](mysql-cluster-ndbinfo-index-columns.html)
[23.6.14.40 ndbinfo 索引\_统计表](mysql-cluster-ndbinfo-index-stats.html)
[23.6.14.41 ndbinfo 锁\_每\_片段表](mysql-cluster-ndbinfo-locks-per-fragment.html)
[23.6.14.42 ndbinfo 日志缓冲区表](mysql-cluster-ndbinfo-logbuffers.html)
[23.6.14.43 ndbinfo 日志空间表](mysql-cluster-ndbinfo-logspaces.html)
[23.6.14.44 ndbinfo 成员表](mysql-cluster-ndbinfo-membership.html)
[23.6.14.45 ndbinfo 内存使用表](mysql-cluster-ndbinfo-memoryusage.html)
[23.6.14.46 ndbinfo 内存\_每\_片段表](mysql-cluster-ndbinfo-memory-per-fragment.html)
[23.6.14.47 ndbinfo 节点表](mysql-cluster-ndbinfo-nodes.html)
[23.6.14.48 ndbinfo 操作\_每\_片段表](mysql-cluster-ndbinfo-operations-per-fragment.html)
[23.6.14.49 ndbinfo pgman\_时间\_追踪\_统计表](mysql-cluster-ndbinfo-pgman-time-track-stats.html)
[23.6.14.50 ndbinfo 进程表](mysql-cluster-ndbinfo-processes.html)
[23.6.14.51 ndbinfo 资源表](mysql-cluster-ndbinfo-resources.html)
[23.6.14.52 ndbinfo 重启\_信息表](mysql-cluster-ndbinfo-restart-info.html)
[23.6.14.53 ndbinfo 服务器\_锁表](mysql-cluster-ndbinfo-server-locks.html)
[23.6.14.54 ndbinfo 服务器\_操作表](mysql-cluster-ndbinfo-server-operations.html)
[23.6.14.55 ndbinfo 服务器\_交易表](mysql-cluster-ndbinfo-server-transactions.html)
[23.6.14.56 ndbinfo 表\_分配\_状态表](mysql-cluster-ndbinfo-table-distribution-status.html)
[23.6.14.57 ndbinfo 表\_片段表](mysql-cluster-ndbinfo-table-fragments.html)
[23.6.14.58 ndbinfo 表\_信息表](mysql-cluster-ndbinfo-table-info.html)
[23.6.14.59 ndbinfo 表\_副本表](mysql-cluster-ndbinfo-table-replicas.html)
[23.6.14.60 ndbinfo tc\_时间\_追踪\_统计表](mysql-cluster-ndbinfo-tc-time-track-stats.html)
[23.6.14.61 ndbinfo 线程块表](mysql-cluster-ndbinfo-threadblocks.html)
[23.6.14.62 ndbinfo 线程表](mysql-cluster-ndbinfo-threads.html)
[23.6.14.63 ndbinfo 线程统计表](mysql-cluster-ndbinfo-threadstat.html)
[23.6.14.64 ndbinfo 传输器表](mysql-cluster-ndbinfo-transporters.html)

[](<>)

`ndbinfo`是一个包含特定于 NDB Cluster 的信息的数据库。

该数据库包含许多表，每个表都提供有关 NDB Cluster 节点状态、资源使用情况和操作的不同类型的数据。您可以在接下来的几节中找到有关每个表的更多详细信息。

[](<>)

`ndbinfo`包含在 MySQL 服务器中的 NDB Cluster 支持中；不需要特殊的编译或配置步骤；这些表是由 MySQL 服务器在连接到集群时创建的。您可以验证`ndbinfo`支持在给定的 MySQL 服务器实例中使用[`显示插件`](show-plugins.html);如果`ndbinfo`支持已启用，您应该看到一行包含`ndbinfo`在里面`姓名`列和`积极的`在里面`状态`列，如此处所示（强调文本）：

```
mysql> SHOW PLUGINS;
+----------------------------------+--------+--------------------+---------+---------+
| Name                             | Status | Type               | Library | License |
+----------------------------------+--------+--------------------+---------+---------+
| binlog                           | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| mysql_native_password            | ACTIVE | AUTHENTICATION     | 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     |
+----------------------------------+--------+--------------------+---------+---------+
47 rows in set (0.00 sec)
```

您也可以通过检查输出来做到这一点[`显示引擎`](show-engines.html)对于一条线，包括`ndbinfo`在里面`引擎`列和`是的`在里面`支持`列，如此处所示（强调文本）：

```
mysql> SHOW ENGINES\G
*************************** 1. row ***************************
      Engine: ndbcluster
     Support: YES
     Comment: Clustered, fault-tolerant tables
Transactions: YES
          XA: NO
  Savepoints: NO
*************************** 2. row ***************************
      Engine: CSV
     Support: YES
     Comment: CSV storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 3. row ***************************
      Engine: InnoDB
     Support: DEFAULT
     Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
          XA: YES
  Savepoints: YES
*************************** 4. row ***************************
      Engine: BLACKHOLE
     Support: YES
     Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 5. row ***************************
      Engine: MyISAM
     Support: YES
     Comment: MyISAM 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: ARCHIVE
     Support: YES
     Comment: Archive storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 8. row ***************************
      Engine: ndbinfo
     Support: YES
     Comment: NDB Cluster system information storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 9. row ***************************
      Engine: PERFORMANCE_SCHEMA
     Support: YES
     Comment: Performance Schema
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 10. row ***************************
      Engine: MEMORY
     Support: YES
     Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
          XA: NO
  Savepoints: NO
10 rows in set (0.00 sec)
```

如果`ndbinfo`支持已启用，然后您可以访问`ndbinfo`在中使用 SQL 语句[**mysql**](mysql.html)或另一个 MySQL 客户端。例如，您可以看到`ndbinfo`在输出中列出[`显示数据库`](show-databases.html)，如此处所示（强调文本）：

```
mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| ndbinfo            |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.04 sec)
```

如果[**mysqld**](mysqld.html)进程没有启动[`--ndbcluster`](mysql-cluster-options-variables.html#option_mysqld_ndbcluster)选项，`ndbinfo`不可用且不显示[`显示数据库`](show-databases.html).如果[**mysqld**](mysqld.html)以前连接到 NDB 集群，但集群变得不可用（由于集群关闭、网络连接丢失等事件），`ndbinfo`并且它的表仍然可见，但尝试访问任何表（除了`块`要么`配置参数`) 失败，并从 NDBINFO 收到错误 157“与 NDB 的连接失败”。

除了[`块`](mysql-cluster-ndbinfo-blocks.html)和[`配置参数`](mysql-cluster-ndbinfo-config-params.html)表，我们所说的`ndbinfo`“表”实际上是从内部生成的视图[`新开发银行`](mysql-cluster.html)MySQL 服务器通常不可见的表。您可以通过设置[`ndbinfo_show_hidden`](mysql-cluster-options-variables.html#sysvar_ndbinfo_show_hidden)系统变量为`在`（要么`1`)，但这通常不是必需的。

全部`ndbinfo`表是只读的，并在查询时按需生成。因为它们中的许多是由数据节点并行生成的，而另一些特定于给定的 SQL 节点，所以不能保证它们提供一致的快照。

此外，不支持下推连接`ndbinfo`表格；所以加入大`ndbinfo`表可能需要将大量数据传输到请求 API 节点，即使查询使用`在哪里`条款。

[](<>)[](<>)

`ndbinfo`表不包含在查询缓存中。（错误 #59831）

您可以选择`ndbinfo`数据库与[`采用`](use.html)声明，然后发出[`显示表格`](show-tables.html)获取表列表的语句，就像任何其他数据库一样，如下所示：

```
mysql> USE ndbinfo;
Database changed

mysql> SHOW TABLES;
+---------------------------------+
| Tables_in_ndbinfo               |
+---------------------------------+
| arbitrator_validity_detail      |
| arbitrator_validity_summary     |
| backup_id                       |
| blobs                           |
| blocks                          |
| 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                      |
| transporters                    |
+---------------------------------+
64 rows in set (0.00 sec)
```

在 NDB 8.0 中，所有`ndbinfo`表使用`新开发银行`存储引擎；然而，一个`ndbinfo`条目仍然出现在的输出中[`显示引擎`](show-engines.html)和[`显示插件`](show-plugins.html)如前所述。

[](<>)

你可以执行[`选择`](select.html)正如您通常期望的那样，针对这些表的语句：

```
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)
```

比较复杂的查询，比如下面两个[`选择`](select.html)语句使用[`内存使用情况`](mysql-cluster-ndbinfo-memoryusage.html)表，是可能的：

```
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
```

[**mysql转储**](mysqldump.html)忽略`ndbinfo`完全数据库，并将其从任何输出中排除。即使在使用[`--数据库`](mysqldump.html#option_mysqldump_databases)要么[`--所有数据库`](mysqldump.html#option_mysqldump_all-databases)选项。

NDB Cluster 还在`INFORMATION_SCHEMA`信息数据库，包括[`文件`](information-schema-files-table.html)表，其中包含有关用于 NDB Cluster 磁盘数据存储的文件的信息，以及[`ndb_transid_mysql_connection_map`](information-schema-ndb-transid-mysql-connection-map-table.html)表，它显示了事务、事务协调器和 NDB Cluster API 节点之间的关系。有关详细信息，请参阅表的说明或[第 23.6.15 节，“信息\_NDB 集群的 SCHEMA 表”](mysql-cluster-information-schema-tables.html).
