Rechercher dans le manuel MySQL

22.5.9 Quick Reference: NDB Cluster SQL Statements

This section discusses several SQL statements that can prove useful in managing and monitoring a MySQL server that is connected to an NDB Cluster, and in some cases provide information about the cluster itself.

  • SHOW ENGINE NDB STATUS, SHOW ENGINE NDBCLUSTER STATUS

    The output of this statement contains information about the server's connection to the cluster, creation and usage of NDB Cluster objects, and binary logging for NDB Cluster replication.

    See Section 13.7.6.15, “SHOW ENGINE Syntax”, for a usage example and more detailed information.

  • SHOW ENGINES

    This statement can be used to determine whether or not clustering support is enabled in the MySQL server, and if so, whether it is active.

    See Section 13.7.6.16, “SHOW ENGINES Syntax”, for more detailed information.

    Note

    This statement does not support a LIKE clause. However, you can use LIKE to filter queries against the INFORMATION_SCHEMA.ENGINES table, as discussed in the next item.

  • SELECT * FROM INFORMATION_SCHEMA.ENGINES [WHERE ENGINE LIKE 'NDB%']

    This is the equivalent of SHOW ENGINES, but uses the ENGINES table of the INFORMATION_SCHEMA database. Unlike the case with the SHOW ENGINES statement, it is possible to filter the results using a LIKE clause, and to select specific columns to obtain information that may be of use in scripts. For example, the following query shows whether the server was built with NDB support and, if so, whether it is enabled:

    1. mysql> SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES
    2.     ->   WHERE ENGINE LIKE 'NDB%';
    3. +---------+
    4. | support |
    5. +---------+
    6. | ENABLED |
    7. +---------+

    See Section 25.9, “The INFORMATION_SCHEMA ENGINES Table”, for more information.

  • SHOW VARIABLES LIKE 'NDB%'

    This statement provides a list of most server system variables relating to the NDB storage engine, and their values, as shown here:

    1. mysql> SHOW VARIABLES LIKE 'NDB%';
    2. +-------------------------------------+-------+
    3. | Variable_name                       | Value |
    4. +-------------------------------------+-------+
    5. | ndb_autoincrement_prefetch_sz       | 32    |
    6. | ndb_cache_check_time                | 0     |
    7. | ndb_extra_logging                   | 0     |
    8. | ndb_force_send                      | ON    |
    9. | ndb_index_stat_cache_entries        | 32    |
    10. | ndb_index_stat_enable               | OFF   |
    11. | ndb_index_stat_update_freq          | 20    |
    12. | ndb_report_thresh_binlog_epoch_slip | 3     |
    13. | ndb_report_thresh_binlog_mem_usage  | 10    |
    14. | ndb_use_copying_alter_table         | OFF   |
    15. | ndb_use_exact_count                 | ON    |
    16. | ndb_use_transactions                | ON    |
    17. +-------------------------------------+-------+

    See Section 5.1.8, “Server System Variables”, for more information.

  • SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'NDB%';

    This statement is the equivalent of the SHOW command described in the previous item, and provides almost identical output, as shown here:

    1. mysql> SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
    2.     ->   WHERE VARIABLE_NAME LIKE 'NDB%';
    3. +-------------------------------------+----------------+
    4. | VARIABLE_NAME                       | VARIABLE_VALUE |
    5. +-------------------------------------+----------------+
    6. | NDB_AUTOINCREMENT_PREFETCH_SZ       | 32             |
    7. | NDB_CACHE_CHECK_TIME                | 0              |
    8. | NDB_EXTRA_LOGGING                   | 0              |
    9. | NDB_FORCE_SEND                      | ON             |
    10. | NDB_INDEX_STAT_CACHE_ENTRIES        | 32             |
    11. | NDB_INDEX_STAT_ENABLE               | OFF            |
    12. | NDB_INDEX_STAT_UPDATE_FREQ          | 20             |
    13. | NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP | 3              |
    14. | NDB_REPORT_THRESH_BINLOG_MEM_USAGE  | 10             |
    15. | NDB_USE_COPYING_ALTER_TABLE         | OFF            |
    16. | NDB_USE_EXACT_COUNT                 | ON             |
    17. | NDB_USE_TRANSACTIONS                | ON             |
    18. +-------------------------------------+----------------+

    Unlike the case with the SHOW command, it is possible to select individual columns. For example:

    1. mysql> SELECT VARIABLE_VALUE
    2.     ->   FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
    3.     ->   WHERE VARIABLE_NAME = 'ndb_force_send';
    4. +----------------+
    5. | VARIABLE_VALUE |
    6. +----------------+
    7. | ON             |
    8. +----------------+

    See The INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES Tables, and Section 5.1.8, “Server System Variables”, for more information.

  • SHOW STATUS LIKE 'NDB%'

    This statement shows at a glance whether or not the MySQL server is acting as a cluster SQL node, and if so, it provides the MySQL server's cluster node ID, the host name and port for the cluster management server to which it is connected, and the number of data nodes in the cluster, as shown here:

    1. mysql> SHOW STATUS LIKE 'NDB%';
    2. +--------------------------+----------------+
    3. | Variable_name            | Value          |
    4. +--------------------------+----------------+
    5. | Ndb_cluster_node_id      | 10             |
    6. | Ndb_config_from_host     | 198.51.100.103 |
    7. | Ndb_config_from_port     | 1186           |
    8. | Ndb_number_of_data_nodes | 4              |
    9. +--------------------------+----------------+

    If the MySQL server was built with clustering support, but it is not connected to a cluster, all rows in the output of this statement contain a zero or an empty string:

    1. mysql> SHOW STATUS LIKE 'NDB%';
    2. +--------------------------+-------+
    3. | Variable_name            | Value |
    4. +--------------------------+-------+
    5. | Ndb_cluster_node_id      | 0     |
    6. | Ndb_config_from_host     |       |
    7. | Ndb_config_from_port     | 0     |
    8. | Ndb_number_of_data_nodes | 0     |
    9. +--------------------------+-------+

    See also Section 13.7.6.35, “SHOW STATUS Syntax”.

  • SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'NDB%';

    This statement provides similar output to the SHOW command discussed in the previous item. However, unlike the case with SHOW STATUS, it is possible using the SELECT to extract values in SQL for use in scripts for monitoring and automation purposes.

    See The INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS Tables, for more information.

You can also query the tables in the ndbinfo information database for real-time data about many NDB Cluster operations. See Section 22.5.10, “ndbinfo: The NDB Cluster Information Database”.


Suchen Sie im MySQL-Handbuch

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 26/06/2006, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/mysql-rf-mysql-cluster-sql-statements.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:en Manuel MySQL : https://dev.mysql.com/

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut