- 18.5.10.1 ndbinfo arbitrator_validity_detail テーブル
- 18.5.10.2 ndbinfo arbitrator_validity_summary テーブル
- 18.5.10.3 ndbinfo blocks テーブル
- 18.5.10.4 ndbinfo cluster_operations テーブル
- 18.5.10.5 ndbinfo cluster_transactions テーブル
- 18.5.10.6 ndbinfo config_params テーブル
- 18.5.10.7 ndbinfo counters テーブル
- 18.5.10.8 ndbinfo dict_obj_types テーブル
- 18.5.10.9 ndbinfo disk_write_speed_base テーブル
- 18.5.10.10 ndbinfo disk_write_speed_aggregate テーブル
- 18.5.10.11 ndbinfo disk_write_speed_aggregate_node テーブル
- 18.5.10.12 ndbinfo diskpagebuffer テーブル
- 18.5.10.13 ndbinfo logbuffers テーブル
- 18.5.10.14 ndbinfo logspaces テーブル
- 18.5.10.15 ndbinfo membership テーブル
- 18.5.10.16 ndbinfo memoryusage テーブル
- 18.5.10.17 ndbinfo memory_per_fragment テーブル
- 18.5.10.18 ndbinfo nodes テーブル
- 18.5.10.19 ndbinfo resources テーブル
- 18.5.10.20 ndbinfo server_operations テーブル
- 18.5.10.21 ndbinfo server_transactions テーブル
- 18.5.10.22 ndbinfo threadblocks テーブル
- 18.5.10.23 ndbinfo threadstat テーブル
- 18.5.10.24 ndbinfo transporters テーブル
ndbinfo
は、MySQL Cluster に固有の情報を格納するデータベースです。
このデータベースは多くのテーブルを格納し、各テーブルは、MySQL Cluster ノードのステータス、リソースの使用率、および操作に関するさまざまな種類のデータを提供します。次のいくつかのセクションで、これらの各テーブルに関する詳細な情報を見つけることができます。
ndbinfo
は、MySQL Cluster サポートとともに MySQL サーバーに付属しているため、特別なコンパイルや構成のステップは必要ありません。MySQL サーバーがクラスタに接続すると、MySQL サーバーによってテーブルが作成されます。SHOW PLUGINS
を使用すると、特定の MySQL サーバーインスタンスで ndbinfo
サポートがアクティブになっていることを確認できます。ndbinfo
サポートが有効になっている場合は、次に (強調表示したテキストで) 示すように、Name
カラムに ndbinfo
が含まれ、Status
カラムに ACTIVE
が含まれる行が表示されます。
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)
また、次に (強調表示されたテキストで) 示すように、Engine
カラムに ndbinfo
が含まれ、Support
カラムに YES
が含まれる行があるかどうかについて、SHOW ENGINES
の出力をチェックすることで、これを実行することもできます。
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: MySQL 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 クライアントで SQL ステートメントを使用して、ndbinfo
にアクセスできます。たとえば、次に示すように、SHOW DATABASES
の出力に ndbinfo
が一覧表示されます。
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| ndbinfo |
| test |
+--------------------+
4 rows in set (0.00 sec)
--ndbcluster
オプションを付けて mysqld プロセスが起動されなかった場合は、ndbinfo
を使用できず、SHOW DATABASES
によって表示されません。以前に mysqld が MySQL Cluster に接続されたが、(クラスタのシャットダウンやネットワーク接続の損失などのイベントが原因で) クラスタを使用できなくなった場合、ndbinfo
およびそのテーブルは引き続き表示されますが、(blocks
または config_params
以外の) テーブルにアクセスしようとしても、次のエラーで失敗します: Got error 157 'Connection to NDB failed' from NDBINFO
blocks
および config_params
テーブルを除いて、ndbinfo
「テーブル」と呼ばれるものは、実際には、MySQL サーバーから通常見えない内部 NDB
テーブルから生成されるビューです。
ndbinfo
テーブルはすべて読み取り専用であり、クエリーの実行時に要求に応じて生成されます。これらの多くはデータノードによって並列して生成されますが、その他は特定の SQL ノードに固有であるため、一貫性のあるスナップショットを提供する保証はありません。
さらに、ndbinfo
テーブルでは、結合のプッシュダウンがサポートされていません。そのため、クエリーで WHERE
句を使用している場合でも、大きな ndbinfo
テーブルの結合には、リクエスト元の API ノードに大量のデータを転送する必要があることがあります。
クエリーキャッシュに、ndbinfo
テーブルが含まれていません。(Bug #59831)
その他のデータベースの場合と同様に、USE
ステートメントで ndbinfo
データベースを選択してから、SHOW TABLES
ステートメントを発行すると、次のようなテーブルのリストを取得できます。
mysql> USE ndbinfo;
Database changed
mysql> SHOW TABLES;
+----------------------+
| Tables_in_ndbinfo |
+----------------------+
| blocks |
| cluster_operations |
| cluster_transactions |
| config_params |
| counters |
| diskpagebuffer |
| logbuffers |
| logspaces |
| memoryusage |
| nodes |
| resources |
| server_operations |
| server_transactions |
| threadblocks |
| threadstat |
| transporters |
+----------------------+
16 rows in set (0.04 sec)
通常の想定どおりに、これらのテーブルに対して 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)
memoryusage
テーブルを使用する次の 2 つの 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.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
または --all-databases
オプションを使用する場合でも当てはまります。
MySQL Cluster は、INFORMATION_SCHEMA
情報データベース内に、MySQL Cluster ディスクデータストレージ用に使用されるファイルに関する情報を格納する FILES
テーブルなどのテーブルも保持しています。詳細は、セクション21.30「MySQL Cluster の INFORMATION_SCHEMA テーブル」を参照してください。