MySQL Cluster Manager 8.0.31 用户手册 / 第 5 章 MySQL Cluster Manager 客户端命令 / 5.2 MySQL Cluster Manager站点和代理命令 /
4.2.4 轮转日志命令
Press CTRL+C to copyrotate log [{--hosts=|-h }host_list] [site_name] host_list: host[,host[,...]]
为连接的 MySQL Cluster Manager 代理、在特定主机上运行的代理或管理站点中所有主机上的代理 轮换mcmd日志。
例如,为客户端会话连接到的代理轮换日志:
Press CTRL+C to copymcm> rotate log; +--------------------------+ | Command result | +--------------------------+ | Log rotated successfully | +--------------------------+ 1 row in set (0.03 sec)
结果创建了一个新的日志文件,在文件扩展名之前的文件名中插入了下划线和时间戳:
Press CTRL+C to copy-rw-r----- 1 mcmd cluster 74265 Jul 15 22:45 mcmd.log -rw-r----- 1 mcmd cluster 1197573 Jul 15 22:45 mcmd_2017-07-15T22-45-28.log
笔记
对于 MySQL Cluster Manager 1.4.4 及更早版本,新文件名的格式为
,这将
用于上面的示例。
old_filename
.timestamp
mcmd.log.2017-07-15T22-45-28
要为特定主机上的代理轮换日志,例如
nanna12
和nanna13
,请使用--hosts
选项(或其缩写形式
-h
):
Press CTRL+C to copymcm> rotate log --hosts=nanna12,nanna13 mysite;
要轮换管理站点中所有代理的日志
mysite
:
Press CTRL+C to copymcm> rotate log mysite;