“文档” 菜单
文档首页
/
MongoDB Ops Manager
/

更新代理以启用致命错误日志轮换

对于低于 12.0.21 的 MongoDB Agent 版本,必须重新安装 MongoDB Agent 才能启用致命错误日志文件轮换。

如果您已将 MongoDB Agent 升级到 12.0.21 从 12.0.20 或更早版本开始,您必须手动重新安装当前的 MongoDB 助手版本 (12.0.21+) 才能启用致命错误日志文件轮换。

对于新安装的 MongoDB 助手 (12.0.21+),会自动启用致命错误日志文件轮换。

注意

致命日志文件轮换通过定期轮换文件并仅删除最早的日志,有助于维护有用的 automation-agent-fatal.log文件。

要重新安装 MongoDB Agent 以启用致命错误日志文件轮换,请按照适用于您的发行版的步骤进行操作:

1

使用适合您代理进程的命令停止 MongoDB Agent。

如果使用systemd启动代理进程,请运行以下命令:

sudo systemctl stop mongodb-mms-automation-agent.service

如果使用init.d启动代理进程,请运行以下命令:

sudo service mongodb-mms-automation-agent stop
2

请使用适用于您的 MongoDB 助手使用案例的安装说明:

  • 如果您使用 MongoDB 助手来管理部署,请按照说明安装 MongoDB 助手以管理部署,或

  • 如果使用 MongoDB 助手仅监控或备份部署,请按照说明安装 MongoDB 助手以仅监控或备份部署。

在安装页面顶部,选择RHEL/CentOS/SLES/AMZ并按照步骤安装 MongoDB 助手。

3

使用终端,使用适合系统的命令启动 MongoDB Agent:

要使用systemd启动代理进程,请运行以下命令:

sudo systemctl start mongodb-mms-automation-agent.service

要使用init.d启动代理进程,请运行以下命令:

sudo service mongodb-mms-automation-agent start

当 MongoDB Agent 重新启动或文件达到 100 MiB 时,重新安装的 MongoDB Agent 会轮换automation-agent-fatal.log文件。

MongoDB Agent会保留新的automation-agent-fatal.log文件和五个轮换的日志。

1

使用以下命令停止 MongoDB 助手:

sudo systemctl stop mongodb-mms-automation-agent.service
2

请使用适用于您的 MongoDB 助手使用案例的安装说明:

在安装页面顶部,选择Ubuntu/ Debian并按照步骤安装 MongoDB 助手。

3

使用终端,通过以下命令启动 MongoDB 助手:

sudo systemctl start mongodb-mms-automation-agent.service

当 MongoDB Agent 重新启动或文件达到 100 MiB 时,重新安装的 MongoDB Agent 会轮换automation-agent-fatal.log文件。

MongoDB Agent会保留新的automation-agent-fatal.log文件和五个轮换的日志。

1

使用以下命令停止 MongoDB 助手:

pkill -f mongodb-mms-automation-agent
2

请使用适用于您的 MongoDB 助手使用案例的安装说明:

在安装页面顶部,选择Linux并按照步骤安装 MongoDB 助手。

3

使用终端运行以下命令:

  • 配置文件的路径

  • 致命错误日志文件的保存路径

nohup /bin/bash -c "./mongodb-mms-automation-agent --config=./example/path/to/config 2>&1 | ./fatallogger -logfile ./example/path/to/log 2>&1"

后退

管理代理 API 密钥

来年

组织和项目