MySQL Cluster Manager 8.0.31 用户手册 / 第 5 章 MySQL Cluster Manager 客户端命令 / 5.2 MySQL Cluster Manager站点和代理命令 /
4.2.9 主机列表命令
list hosts site_name
该list hosts
命令用于获取包含给定管理站点的主机列表。该命令需要一个参数,即要检查的站点的名称。对于列出的每个主机,返回的信息包括主机名、状态和正在使用的管理代理软件的版本,如本例所示:
mcm> list hosts mysite;
+-----------+-----------+---------+
| Host | Status | Version |
+-----------+-----------+---------+
| tonfisk | Available | 1.3.6 |
+-----------+-----------+---------+
| flundra | Available | 1.3.6 |
+-----------+-----------+---------+
2 rows in set (0.16 sec)
如果省略site_name
参数,命令将失败并出现错误,如下所示:
mcm> list hosts;
ERROR 6 (00MGR): Illegal number of operands
使用--verbose
选项(缩写形式 :
-v
)会导致命令打印有关主机的附加信息:
mcm> list hosts --verbose mysite;
+---------+-----------+---------+-------+---------+-------------------------------+
| Host | Status | Version | Cores | Memory | OS |
+---------+-----------+---------+-------+---------+-------------------------------+
| tonfisk | Available | 1.3.6 | 1 | 1819 Mb | Linux 3.13.11-100.fc19.x86_64 |
| flundra | Available | 1.3.6 | 1 | 1819 Mb | Linux 3.13.11-100.fc19.x86_64 |
+---------+-----------+---------+-------+---------+-------------------------------+
2 rows in set (0.07 sec)