Online help is available in the MySQL Cluster Manager client for MySQL Cluster Manager client commands. The client can provide both general and command-specific information. In addition, you can obtain information aboutmysql client commands that are independent of the MySQL server and thus are also available for use when connected to the MySQL Cluster Manager agent.
Listing MySQL Cluster Manager client commands. For a list of all commands with brief descriptions, use thelist commands command, as shown here:
mcm> list commands;+---------------------------------------------------------------------------+| Help |+---------------------------------------------------------------------------+| COMMANDS || || abort backup Abort an ongoing cluster backup. || add hosts Add hosts to site. || add package Add a package alias. || add process Add cluster process. || autotune Autotune a cluster to given use-case template. || backup agents Backup the agents repository and metadata. || backup cluster Backup a cluster. || change log-level Change the log-level || change process Change process type. || collect logs Collect log files. || create cluster Create a cluster. || create site Create a site. || delete cluster Delete a cluster. || delete package Delete a package. || delete site Delete a site. || get Get configuration variables. || import cluster Import a running cluster. || import config Import the configuration of a running cluster. || list backups List backup images. || list clusters List all clusters. || list commands List the help text. || list hosts List hosts in site. || list nextnodeids List next nodeids to be allocated. || list packages List all packages. || list processes List processes. || list sites List all sites. || remove hosts Remove hosts from site. || remove process Remove a cluster process. || reset Reset configuration variables. || restart cluster Restart a cluster. || restore cluster Restore a cluster. || rotate log Rotate the mcmd log. || set Set configuration variables. || show settings Show agent settings. || show status Show cluster, process, operation or backup status. || start cluster Start a cluster. || start process Start a cluster process. || stop agents Stop agents in site. || stop cluster Stop a cluster. || stop process Stop a cluster process. || upgrade cluster Upgrade a cluster. || version Print version information. || || GLOBAL OPTIONS || Options that can be used with all commands || || --help|-? Print detailed help. || || Use '<COMMAND> --help' to see verbose help for individual commands. |+---------------------------------------------------------------------------+51 rows in set (0.03 sec)Obtaining information about specific MySQL Cluster Manager client commands. To obtain more detailed help specific to a given command, invoke the command using the--help option, as shown in this example:
mcm> create site --help;+----------------------------------------------------------------+| Help |+----------------------------------------------------------------+| || create site [options] <sitename> || || Creates a site from the hosts listed in --hosts. || || Required options: || --hosts|-h Comma separated list of hostnames. || Format: --hosts = <host>[,<host>]*. || |+----------------------------------------------------------------+9 rows in set (0.00 sec) For any MySQL Cluster Manager client command, the--help option may be abbreviated to-?:
mcm> list processes -?;+-------------------------------------------------------------+| Help |+-------------------------------------------------------------+| || list processes <sitename> || || Lists all processes defined in the specified cluster. |+-------------------------------------------------------------+4 rows in set (0.00 sec) As mentioned elsewhere in this manual (seeChapter 5,MySQL Cluster Manager Client Commands), many other MySQL Cluster Manager command options have short forms as well. These are included in the documentation for each command. You can also find out what these are for a given command by invoking it with the--help or-? option.
You can obtain the release version of the MySQL Cluster Manager software in use from the output of theversion command.
mysql client commands in the MySQL Cluster Manager client. You can also use most standardmysql client commands in the MySQL Cluster Manager client (butnot SQL statements, which depend on being connected to a MySQL server), such asprompt,quit, andstatus. For example, the output of the status command when connected to the MySQL Cluster Manager agent looks something like this (depending on the exact version of the client and agent that you are using and possibly other factors):
mcm> status--------------./bin/mcm Ver 8.4.6 for Linux on x86_64 (MySQL Enterprise Server - Commercial)Connection id: 3Current database: <n/a>Current user: mcmdSSL: Not in useCurrent pager:stdoutUsing outfile:''Using delimiter: ;Server version: 8.4.6 MySQL Cluster ManagerProtocol version: 10Connection: 127.0.0.1 via TCP/IPServer characterset:latin1Db characterset:latin1Client characterset:latin1Conn. characterset:latin1TCP port: 1862Binary data as: HexadecimalUptime:4 hours 11 min 54 secAgent no: 0 Connections: 1 Max msg id: {658358e0 102 0}-------------- You may use the command delimiter withmysql client commands, but you are not required to do so. For instance, assuming that the delimiter in use was the default semicolon (;) character, we could have executed thestatus command like this:
mcm> status;--------------/home/jon/bin/mcm/cluster/bin/mysql Ver 14.14 Distrib 8.4.6,... A particularly usefulmysql client command that you can also employ withmcm is thesource command (short form:\.), which you can use for executing scripts containing MySQL Cluster Manager client commands. On a Linux system, you might have a text file in your home directory namedget-attributes.mcm, whose contents are shown here:
get :ndb_mgmd mycluster\Gget :ndbd mycluster\Gget :mysqld mycluster\G Assuming that you have created a cluster namedmycluster, you can run this script in the client; the results vary according to how this cluster is actually configured, but should be similar to this:
mcm> \. ~/get-attributes.mcmmcm> get :ndb_mgmd mycluster\G*************************** 1. row *************************** Name: DataDir Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/49/dataProcess1: ndb_mgmd NodeId1: 49Process2: NodeId2: Level: Comment:*************************** 2. row *************************** Name: HostName Value: flundraProcess1: ndb_mgmd NodeId1: 49Process2: NodeId2: Level: Comment: Read only*************************** 3. row *************************** Name: NodeId Value: 49Process1: ndb_mgmd NodeId1: 49Process2: NodeId2: Level: Comment: Read only*************************** 4. row *************************** Name: PortNumber Value: 1186Process1: ndb_mgmd NodeId1: 49Process2: NodeId2: Level: Process Comment:4 rows in set (0.09 sec)mcm> get :ndbd mycluster\G*************************** 1. row *************************** Name: DataDir Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/1/dataProcess1: ndbd NodeId1: 1Process2: NodeId2: Level: Comment:*************************** 2. row *************************** Name: HostName Value: tonfiskProcess1: ndbd NodeId1: 1Process2: NodeId2: Level: Comment: Read only*************************** 3. row *************************** Name: NodeId Value: 1Process1: ndbd NodeId1: 1Process2: NodeId2: Level: Comment: Read only*************************** 4. row *************************** Name: DataDir Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/2/dataProcess1: ndbd NodeId1: 2Process2: NodeId2: Level: Comment:*************************** 5. row *************************** Name: HostName Value: grindvalProcess1: ndbd NodeId1: 2Process2: NodeId2: Level: Comment: Read only*************************** 6. row *************************** Name: NodeId Value: 2Process1: ndbd NodeId1: 2Process2: NodeId2: Level: Comment: Read only6 rows in set (0.10 sec)mcm> get :mysqld mycluster\G*************************** 1. row *************************** Name: datadir Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/50/dataProcess1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment:*************************** 2. row *************************** Name: HostName Value: hajProcess1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment: Read only*************************** 3. row *************************** Name: log_error Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/50/data/mysqld_50_out.errProcess1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment:*************************** 4. row *************************** Name: ndb_nodeid Value: 50Process1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment: Read only*************************** 5. row *************************** Name: ndbcluster Value:Process1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment: Read only*************************** 6. row *************************** Name: NodeId Value: 50Process1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment: Read only*************************** 7. row *************************** Name: port Value: 3306Process1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment:*************************** 8. row *************************** Name: socket Value: /tmp/mysql.mycluster.50.sockProcess1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment:*************************** 9. row *************************** Name: tmpdir Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/50/data/tmpProcess1: mysqld NodeId1: 50Process2: NodeId2: Level: Comment:*************************** 10. row *************************** Name: datadir Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/51/dataProcess1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment:*************************** 11. row *************************** Name: HostName Value: torskProcess1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment: Read only*************************** 12. row *************************** Name: log_error Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/51/data/mysqld_51_out.errProcess1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment:*************************** 13. row *************************** Name: ndb_nodeid Value: 51Process1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment: Read only*************************** 14. row *************************** Name: ndbcluster Value:Process1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment: Read only*************************** 15. row *************************** Name: NodeId Value: 51Process1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment: Read only*************************** 16. row *************************** Name: port Value: 3307Process1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment:*************************** 17. row *************************** Name: socket Value: /tmp/mysql.mycluster.51.sockProcess1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment:*************************** 18. row *************************** Name: tmpdir Value: /home/jon/bin/mcm/mcm_data/clusters/mycluster/51/data/tmpProcess1: mysqld NodeId1: 51Process2: NodeId2: Level: Comment:18 rows in set (0.05 sec)mcm>You are not returned to the client prompt until the script has finished executing.
Similarly, on Windows, you can create a batch file using Notepad or another text editor, copy the sameget commands as shown previously into it, and save it asget-attributes.bat in a convenient location such as the Windows desktop.
You can view a list of availablemysql client commands using thehelp command. For more information about these, view thehelp output or seemysql Client Commands, in theMySQL Manual.