Skip to content

Commit 4f95349

Browse files
authored
(DOCSP-29318) [OM] fatal log file rotation for OM agent (#5034) (#5056)
* (DOCSP-29318) [OM] fatal log file rotation for OM agent (#5034)
1 parent 9f112af commit 4f95349

8 files changed

+239
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
title: "Stop the {+mdbagent+}."
2+
stepnum: 1
3+
level: 4
4+
ref: stop-agent-fatallog-deb
5+
content: |
6+
Stop the {+mdbagent+} using the following command:
7+
8+
.. code-block:: sh
9+
:class: copyable-code
10+
11+
sudo systemctl stop mongodb-mms-automation-agent.service
12+
13+
---
14+
title: "Reinstall the {+mdbagent+}."
15+
stepnum: 2
16+
level: 4
17+
ref: install-agent-fatallog-deb
18+
content: |
19+
Use the installation instructions that apply to your {+mdbagent+}
20+
use case:
21+
22+
- If you use {+mdbagent+} to manage deployments, follow the
23+
instructions to
24+
:ref:`Install the {+mdbagent+} to Manage Deployments <automation-agent-install-steps-manage>`, or
25+
26+
- If you use {+mdbagent+} to only monitor or back up deployments,
27+
follow the instructions to
28+
:ref:`Install the {+mdbagent+} to Only Monitor or Backup Deployments <automation-agent-install-steps-monitor>`.
29+
30+
At the top of the installation page, select
31+
``Ubuntu/ Debian`` and follow the procedure to install
32+
the {+mdbagent+}.
33+
34+
---
35+
title: "Start the {+mdbagent+}."
36+
stepnum: 3
37+
level: 4
38+
ref: start-agent-fatallog-deb
39+
content: |
40+
41+
Using your terminal, start the {+mdbagent+} with the following
42+
command:
43+
44+
.. code-block:: sh
45+
:class: copyable-code
46+
47+
sudo systemctl start mongodb-mms-automation-agent.service
48+
49+
The reinstalled {+mdbagent+} rotates ``automation-agent-fatal.log``
50+
on a regular basis.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
title: "Stop the {+mdbagent+}."
2+
stepnum: 1
3+
level: 4
4+
ref: stop-agent-fatallog-rpm
5+
content: |
6+
Stop the {+mdbagent+} using the appropriate command for your agent
7+
process.
8+
9+
If you started your agent process with ``systemd``, run the following
10+
command:
11+
12+
.. code-block:: sh
13+
:class: copyable-code
14+
15+
sudo systemctl stop mongodb-mms-automation-agent.service
16+
17+
If you started your agent process with ``init.d``, run the following
18+
command:
19+
20+
.. code-block:: sh
21+
:class: copyable-code
22+
23+
sudo service mongodb-mms-automation-agent stop
24+
25+
---
26+
title: "Reinstall the {+mdbagent+}."
27+
stepnum: 2
28+
level: 4
29+
ref: install-agent-fatallog-rpm
30+
content: |
31+
Use the installation instructions that apply to your {+mdbagent+}
32+
use case:
33+
34+
- If you use {+mdbagent+} to manage deployments, follow the
35+
instructions to
36+
:ref:`Install the {+mdbagent+} to Manage Deployments <automation-agent-install-steps-manage>`, or
37+
38+
- If you use {+mdbagent+} to only monitor or back up deployments,
39+
follow the instructions to
40+
:ref:`Install the {+mdbagent+} to Only Monitor or Backup Deployments <automation-agent-install-steps-monitor>`.
41+
42+
At the top of the installation page, select
43+
``RHEL/CentOS/SLES/AMZ`` and follow the procedure to install
44+
the {+mdbagent+}.
45+
46+
---
47+
title: "Start the {+mdbagent+}."
48+
stepnum: 3
49+
level: 4
50+
ref: start-agent-fatallog-rpm
51+
content: |
52+
53+
Using your terminal, start the {+mdbagent+} with the appropriate
54+
command for your system:
55+
56+
To start the agent process with ``systemd``, run the following
57+
command:
58+
59+
.. code-block:: sh
60+
:class: copyable-code
61+
62+
sudo systemctl start mongodb-mms-automation-agent.service
63+
64+
To start the agent process with ``init.d``, run the following
65+
command:
66+
67+
.. code-block:: sh
68+
:class: copyable-code
69+
70+
sudo service mongodb-mms-automation-agent start
71+
72+
The reinstalled {+mdbagent+} rotates ``automation-agent-fatal.log``
73+
on a regular basis.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
title: "Stop the {+mdbagent+}."
2+
stepnum: 1
3+
level: 4
4+
ref: stop-agent-fatallog-tar
5+
content: |
6+
Stop the {+mdbagent+} using the following command:
7+
8+
.. code-block:: sh
9+
:class: copyable-code
10+
11+
pkill -f mongodb-mms-automation-agent
12+
13+
---
14+
title: "Reinstall the {+mdbagent+}."
15+
stepnum: 2
16+
level: 4
17+
ref: install-agent-fatallog-tar
18+
content: |
19+
Use the installation instructions that apply to your {+mdbagent+}
20+
use case:
21+
22+
- If you use {+mdbagent+} to manage deployments, follow the
23+
instructions to
24+
:ref:`Install the {+mdbagent+} to Manage Deployments <automation-agent-install-steps-manage>`, or
25+
26+
- If you use {+mdbagent+} to only monitor or back up deployments,
27+
follow the instructions to
28+
:ref:`Install the {+mdbagent+} to Only Monitor or Backup Deployments <automation-agent-install-steps-monitor>`.
29+
30+
At the top of the installation page, select
31+
``Linux`` and follow the procedure to install
32+
the {+mdbagent+}.
33+
34+
---
35+
title: "Start the {+mdbagent+}."
36+
stepnum: 3
37+
level: 4
38+
ref: start-agent-fatallog-tar
39+
content: |
40+
41+
Using your terminal, run the following command with:
42+
43+
- The path to your configuration file
44+
- The path to save the fatal log file
45+
46+
.. code-block:: sh
47+
:class: copyable-code
48+
49+
nohup /bin/bash -c "./mongodb-mms-automation-agent --config=./example/path/to/config 2>&1 | ./fatallogger -logfile ./example/path/to/log 2>&1"
50+
51+
...

source/includes/toc-mongodb-agent.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ file: /tutorial/manage-agent-api-key
5757
name: Manage Agent API Keys
5858
description: |
5959
Manage project's agent API keys.
60+
---
61+
file: /tutorial/update-fatal-log-rotation
62+
name: Update Agent to Enable Fatal Log Rotation
63+
description: |
64+
Reinstall older versions of the {+mdbagent+} to enable fatal log
65+
file rotation.
6066
...

source/tutorial/install-mongodb-agent-to-manage.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Install the MongoDB Agent to Manage Deployments
77
.. tabs-pillstrip:: platforms
88

99
.. _automation-agent-install-steps:
10+
.. _automation-agent-install-steps-manage:
1011
.. _mongodb-agent-install-steps:
1112
.. _mongodb-agent-install-from-package:
1213
.. _mongodb-agent-install-from-archive:

source/tutorial/install-mongodb-agent-to-monitor.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Install the MongoDB Agent to Only Monitor or Backup Deployments
77
.. tabs-pillstrip:: platforms
88

99
.. _automation-agent-install-steps:
10+
.. _automation-agent-install-steps-monitor:
1011
.. _mongodb-agent-install-steps:
1112
.. _mongodb-agent-install-from-package:
1213
.. _mongodb-agent-install-from-archive:

source/tutorial/manage-project-settings.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,3 @@ Project Settings
219219
* - :guilabel:`Automation Agent Log Level`
220220

221221
- Change the verbosity of the {+aagent+} log.
222-
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.. _update-agent-fatal-log-rotation:
2+
3+
==========================================
4+
Update Agent to Enable Fatal Log Rotation
5+
==========================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. cond:: cloud
10+
11+
For {+mdbagent+} versions below 12.8, you must reinstall the
12+
{+mdbagent+} to enable fatal log file rotation.
13+
14+
In {+mdbagent+} versions 12.8 and above, fatal log file rotation is
15+
automatically enabled.
16+
17+
.. cond:: onprem
18+
19+
For {+mdbagent+} versions below 12.0.21, you must reinstall the
20+
{+mdbagent+} to enable fatal log file rotation.
21+
22+
In {+mdbagent+} versions 12.0.21 and above, fatal log file rotation
23+
is automatically enabled.
24+
25+
.. note::
26+
27+
Fatal log file rotation helps to maintain a
28+
useful ``automation-agent-fatal.log`` file by rotating the file on a
29+
regular basis and deleting only the oldest logs.
30+
31+
Reinstall the {+mdbagent+}
32+
---------------------------
33+
34+
To reinstall the {+mdbagent+} to enable fatal log file rotation, follow
35+
the procedure for your distribution:
36+
37+
.. tabs::
38+
39+
tabs:
40+
- id: log-update-rpm
41+
name: RPM
42+
content: |
43+
44+
.. include:: /includes/steps/update-log-rotation-rpm.rst
45+
46+
- id: log-update-deb
47+
name: DEB
48+
content: |
49+
50+
.. include:: /includes/steps/update-log-rotation-deb.rst
51+
52+
- id: log-update-tar
53+
name: TAR
54+
content: |
55+
56+
.. include:: /includes/steps/update-log-rotation-tar.rst
57+

0 commit comments

Comments
 (0)