Docs 菜单

Update from the legacy Monitoring Agent

You have a project with monitored MongoDB deployments that Automation does not manage and want to update to the MongoDB Agent.

注意

首先查看先决条件

If you want to start or continue using Automation to manage your MongoDB deployments, please review the MongoDB 助手先决条件 before updating to the MongoDB Agent.

Use this procedure to update to the MongoDB Agent on x86_64 architecture running Microsoft Windows:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select Windows - MSI.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

MongoDB Agent Installation Instructions 框会显示以下信息:

  • Project ID (绑定到项目时必填)

  • API Key

    如果没有 API 密钥,请单击生成密钥

警告

Some or all of these values are required in a later step. Copy these values then store them where you can access them later.

6
  1. 下载 MSI 后,双击:

    mongodb-mms-automation-agent-<VERSION>.windows_x86_64.msi

    注意

    The use of mongodb-mms-automation in the filename is a legacy artifact and does not mean that the MongoDB Agent is being installed with Automation configured.

  2. 如果出现安全警告,请单击 Run

  3. Configuration/Log Folder 步骤

    提供保存这些文件的目录。

  4. Key Type步骤中,选择Agent API Key以绑定到特定项目。

  5. Enter the appropriate Agent keys.

    注意

    上一步描述的 MongoDB Agent Installation Instructions 模态中提供了这些密钥。

    • Project ID 字段中输入您的项目 ID。

    • Type your Agent API Key into the Agent API Key field.

  6. MongoDB Paths 步骤中,指定日志和备份目录

  7. Windows Firewall Configuration 步骤中,单击首选防火墙配置。

    如果单击 Configure firewall rules allowing access from only the specified |ipaddr| addresses.,则在提供的框中键入必要的 IPv4 地址。

  8. (Conditional) Windows enables Stealth Mode for the Windows Firewall by default. If you have not disabled it on the MongoDB host on which you are installing the MongoDB Agent, disable it now. Stealth Mode significantly degrades the performance and capability of the MongoDB Agent. Click Disable Stealth Mode.

  9. (有条件) Windows未启用 磁盘性能计数器 默认。如果您尚未为MongoDB托管启用磁盘性能计数器,请单击Enable Disk Performance Counters 。 MongoDB Agent使用这些计数器进行某些硬件监控活动。

  10. 单击 Install(连接)。

  11. 设置完成后,请单击 Finish

After the MSI downloads, you can run an unattended install. You run an unattended install from the command line in either the Command Prompt or PowerShell. To learn more about unattended installs, see Microsoft's documentation on Standard Installer Command-Line Options

To run the MSI installer unattended from the command line, invoke msiexec.exe with the /q and /i flags and a combination of required and optional parameters:

Parameter
必要性

MMSAPIKEY

必需

Cloud Manager项目的代理API密钥。

MMSGROUPID

必需

Cloud Manager项目的唯一标识符。

CONFIGLOGDIR

Optional

Cloud Manager应将MongoDB Agent配置文件写入的绝对文件路径。

LOGFILE

Optional

Cloud Manager应将MongoDB Agent日志写入到的绝对文件路径

MMSCONFIGBACKUP

Optional

Cloud Manager自动化配置备份JSON文件的绝对文件路径。

例子

To install the MongoDB Agent unattended, invoke msiexec.exe with the following options:

msiexec.exe /q /i "C:\PATH\TO\mongodb-mms-automation-agent-<VERSION>.windows_x86_64.msi" MMSGROUPID=<GROUP.ID> MMSAPIKEY=<AGENT.API.ID> MMSBASEURL="<http://opsmanager.example.com:8080>" LOGFILE="C:\MMSData\Server\Log\automation-agent.log" MMSCONFIGBACKUP="C:\MMSData\MongoDB\mms-cluster-config-backup.json"
7

Finish the installation of the MongoDB Agent. In the Install Agent Instructions modal, click Done.

8

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

9

Your system policies or practices may require the MongoDB binaries and Cloud Manager configuration backup file to be located somewhere other than the default location of %SystemDrive%\MMSMongoDB\versions.

注意

Windows sets the %SystemDrive% environment variable to the drive on which you installed Windows. By default, you are directed to install Windows on the C: drive. To find your %SystemDrive%, issue with following command from PowerShell:

get-childitem env:SystemDrive

如果要将这些文件存储在不同的目录中,请按照以下步骤操作:

更改 MongoDB 助手二进制文件的位置

  1. 在MongoDB Cloud Manager中, Go项目的 Deployment 页面。

    1. 如果尚未显示,请从导航栏的 Organizations 菜单中选择包含所需项目的组织。

    2. 如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。

    3. 如果 Deployment(数据库部署)页面尚未出现,请单击侧边栏中的 Deployment(数据库)。

      显示“部署”页面。

  2. 单击部署的Agents标签页。

    显示“代理”页面。

  3. 单击 Downloads & Settings 标签页。

  4. Download Directory 标题下方,单击 Download Directory (Windows) 中所示路径右侧的

  5. 将路径更改为所需的新路径。

  6. 单击 Save(连接)。

  7. 在运行MongoDB Agent的每台托管上创建您指定的新目录。 使用Windows资源管理器移动文件,或从命令提示符或 PowerShell 发出以下命令:

    md \<newPath>

    重要

    Make sure that the system user that runs the MongoDB Agent can write to this new directory. This is usually the SYSTEM user, which requires no additional configuration unless you changed the user.

更改 MongoDB 助手配置备份的位置

  1. 用您首选的文本编辑器打开 MongoDB 助手配置文件

  2. Change the mmsConfigBackup setting to the new path for the configuration backup file. Replace X in the following example with the drive letter on which your backup is stored.

    mmsConfigBackup=X:\<newPath>\mms-cluster-config-backup.json
  3. 保存 MongoDB 助手配置文件。

  4. 将配置备份文件移至新目录。 使用 Windows 资源管理器移动文件,或从命令提示符或 PowerShell 发出以下命令:

    move %SystemDrive%\MMSMongoDB\versions\mms-cluster-config-backup.json \<newPath>
10

Use this procedure to update to the MongoDB Agent:

在运行 Debian 8、Debian 9、Ubuntu 18.04、Ubuntu 20.04 或 Ubuntu 22.04 的 x86_64 架构上:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select Debian 8/9, Ubuntu 16.X/18.X - DEB.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

从将运行 MongoDB 助手的主机上的 Shell 中,发出以下 curl 命令来下载 Ubuntu 18.04/20.04/22.04 或 Debian 9/10/11(适用于 64 位 x86 架构)的安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.amd64.ubuntu1604.deb
6

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

7

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

8

该数据目录存储着 MongoDB 数据。对于现有 MongoDB 部署,请确保该目录由 mongodb 用户拥有。如果不存在 MongoDB 部署,请创建目录并设置所有者。

要创建数据目录并将所有者设置为 mongodb 用户,请执行以下操作:

sudo mkdir -p /data; sudo chown mongodb:mongodb /data
9

发出以下命令:

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

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

11

Install Agent Instructions 模式中,单击 Done

12

On zSeries architecture running Ubuntu 18.x using a deb package:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select Ubuntu 18.X Z-Series (s390x) - DEB.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

从将运行 的托管上的系统shell MongoDB Agent中,发出以下curl 命令以下载Ubuntu18.04 forIBM zSeries 的安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.s390x.ubuntu1804.deb
6

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

7

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

8

该数据目录存储着 MongoDB 数据。对于现有 MongoDB 部署,请确保该目录由 mongodb 用户拥有。如果不存在 MongoDB 部署,请创建目录并设置所有者。

要创建数据目录并将所有者设置为 mongodb 用户,请执行以下操作:

sudo mkdir -p /data; sudo chown mongodb:mongodb /data
9

发出以下命令:

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

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

11

Install Agent Instructions 模式中,单击 Done

12

Use this procedure to update to the MongoDB Agent:

在 x 86 _ 64架构上:

Running RHEL / CentOS 6.x using an rpm package:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select Amazon Linux - RPM.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

From a system shell on the host that will run the MongoDB Agent, issue the following curl command to download the installer for RHEL 6 for 64-bit x86:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.x86_64.rpm
6

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

7

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

8

数据目录存储MongoDB数据,必须由mongod用户拥有。 对于现有MongoDB 部署,请确保mongod用户为该目录的所有者。 如果不存在MongoDB 部署,请创建目录并设立所有者。

以下命令创建一个数据目录并将所有者设立为mongod用户:

sudo mkdir /data; sudo chown mongod:mongod /data
9

发出以下命令:

sudo service mongodb-mms-automation-agent start
10

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

11

Install Agent Instructions 模式中,单击 Done

12

Running RHEL / CentOS 7.x, SUSE12, SUSE15 or Amazon Linux 2:

使用rpm包:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select RHEL/CentOS (7.X), SUSE12, Amazon Linux2 - RPM.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

从将运行 的主机上的系统shell MongoDB Agent中,发出以下curl 7命令以下载适用于64 位 x 的 RHEL86 安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.x86_64.rhel7.rpm
6

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

7

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

8

数据目录存储MongoDB数据,必须由mongod用户拥有。 对于现有MongoDB 部署,请确保mongod用户为该目录的所有者。 如果不存在MongoDB 部署,请创建目录并设立所有者。

以下命令创建一个数据目录并将所有者设立为mongod用户:

sudo mkdir /data; sudo chown mongod:mongod /data
9

发出以下命令:

sudo service mongodb-mms-automation-agent start
10

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

11

Install Agent Instructions 模式中,单击 Done

12

使用tar存档:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select RHEL/CentOS (7.X), SUSE12, Amazon Linux 2 - TAR.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

Starting with this step, follow the MongoDB Agent installation modal and copy the provided commands into the .

从将运行 的托管上的系统shell MongoDB Agent中,发出以下curl 命令以下载适用于64 位 x 的 RHEL86 安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.rhel7_x86_64.tar.gz
6

您可以将MongoDB Agent安装在任何目录中。 如果您想在解压缩之前将存档移动到另一个目录,可以这样做。

要安装MongoDB Agent ,请提取存档:

tar -xvzf mongodb-mms-automation-agent-<VERSION>.rhel7_x86_64.tar.gz
7

切换到解压缩MongoDB Agent二进制文件后创建的目录:

cd mongodb-mms-automation-agent-<VERSION>.rhel7_x86_64
8

在安装MongoDB Agent助手的目录中,使用首选文本编辑器打开 local.config文件。

vi <install-path>/local.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

9

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装MongoDB Agent助手的目录中,使用首选文本编辑器打开 local.config文件。

vi <install-path>/local.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

10

If you have an existing Monitoring Agent user and do not plan on activating Automation, you only need to create the log directory.

创建以下目录来存储MongoDB Agent所需的文件。

注意

在文件路径中使用 mongodb-mms-automation 是一项传统项目,并不平均值在安装MongoDB Agent时会配置自动化。

组件
默认目录
说明

二进制文件

/var/lib/mongodb-mms-automation

这些是MongoDB Agent管理的二进制文件。 其中包括MongoDB Agent 、 BI Connector和MongoDB二进制文件。

MongoDB 助手日志

/var/log/mongodb-mms-automation

这些是MongoDB Agent创建的日志文件。

MongoDB数据库

/data

这些是MongoDB Agent创建和管理的数据库。

运行以下命令以创建目录:

sudo mkdir -m 755 -p /var/lib/mongodb-mms-automation
sudo mkdir -m 755 -p /var/log/mongodb-mms-automation
sudo mkdir -m 755 -p /data

默认,助手二进制文件和Cloud Manager配置备份文件位于/var/lib/mongodb-mms-automation中。 如果要将这些文件存储在不同的目录中,请按照以下步骤操作:

要更改代理二进制文件的位置:

  1. 在MongoDB Cloud Manager中, Go项目的 Deployment 页面。

    1. 如果尚未显示,请从导航栏的 Organizations 菜单中选择包含所需项目的组织。

    2. 如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。

    3. 如果 Deployment(数据库部署)页面尚未出现,请单击侧边栏中的 Deployment(数据库)。

      显示“部署”页面。

  2. 单击部署的Agents标签页。

    显示“代理”页面。

  3. 更改路径。

    1. 单击 Downloads & Settings(连接)。

    2. Download Directory标题下方,单击Download Directory (Linux)中所示路径右侧的铅笔图标。

    3. 将路径更改为所需的新路径。

    4. 单击 Save(连接)。

    5. 在运行代理的每台主机上创建您指定的新目录。

      sudo mkdir -m 755 -p /<newPath>

要更改助手配置备份的位置,请执行以下操作:

  1. 在您首选的文本编辑器中打开助手配置文件

  2. mmsConfigBackup 设置更改为配置备份文件的新路径。

    mmsConfigBackup=/<newPath>/mms-cluster-config-backup.json
  3. 保存代理配置文件。

  4. 将配置备份文件移至新目录。

    sudo mv /var/lib/mongodb-mms-automation/mms-cluster-config-backup.json /<newPath>
11

运行以下命令:

# Create mongodb user and group if they do not exist
if ! sudo /usr/bin/id -g mongodb &>/dev/null; then
sudo /usr/sbin/groupadd -r mongodb
fi
# Create mongodb user if they do not exist and assign
# them to the mongodb group
if ! sudo /usr/bin/id mongodb &>/dev/null; then
sudo /usr/sbin/useradd -M -r -g mongodb \
-d /var/lib/mongo -s /bin/false \
-c mongodb mongodb > /dev/null 2>&1
fi
# Grant the mongodb:mongodb user and group permissions
# to manage deployments.
sudo chown mongodb:mongodb /var/lib/mongodb-mms-automation
sudo chown mongodb:mongodb /var/log/mongodb-mms-automation
sudo chown mongodb:mongodb /data
12

在安装MongoDB Agent的目录中,以上一步中创建的系统用户身份发出以下命令:

nohup ./mongodb-mms-automation-agent \
--config=local.config \
>> /var/log/mongodb-mms-automation/automation-agent-fatal.log 2>&1 &
13

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

14

Install Agent Instructions 模式中,单击 Done

15

在 PowerPC 架构上的 RHEL/ CentOS ( 7 .x) 上(管理MongoDB 3.4或更高版本的部署):

使用rpm包:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select RHEL/CentOS (7.X), SUSE12, Amazon Linux2 - RPM.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

从将运行 的托管上的系统shell MongoDB Agent中,发出以下curl 命令以下载RHEL7 for PowerPC 的安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.ppc641e.rhel7.rpm
6

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

7

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

8

数据目录存储MongoDB数据,必须由mongod用户拥有。 对于现有MongoDB 部署,请确保mongod用户为该目录的所有者。 如果不存在MongoDB 部署,请创建目录并设立所有者。

以下命令创建一个数据目录并将所有者设立为mongod用户:

sudo mkdir /data; sudo chown mongod:mongod /data
9

发出以下命令:

sudo service mongodb-mms-automation-agent start
10

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

11

Install Agent Instructions 模式中,单击 Done

12

使用tar存档:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select RHEL/CentOS (7.X) Power (ppc64le) - TAR.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

从将运行 的托管上的系统shell MongoDB Agent中,发出以下curl 命令以下载RHEL7 for PowerPC 的安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.rhel7_ppc64le.tar.gz
6

您可以将MongoDB Agent安装在任何目录中。 如果您想在解压缩之前将存档移动到另一个目录,可以这样做。

要安装MongoDB Agent ,请提取存档:

tar -xvzf mongodb-mms-automation-agent-<VERSION>.rhel7_ppc64le.tar.gz
7

切换到解压缩MongoDB Agent二进制文件后创建的目录:

cd mongodb-mms-automation-agent-<VERSION>.rhel7_ppc64le
8

在安装MongoDB Agent助手的目录中,使用首选文本编辑器打开 local.config文件。

vi <install-path>/local.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

9

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装MongoDB Agent助手的目录中,使用首选文本编辑器打开 local.config文件。

vi <install-path>/local.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

10

If you have an existing Monitoring Agent user and do not plan on activating Automation, you only need to create the log directory.

创建以下目录来存储MongoDB Agent所需的文件。

注意

在文件路径中使用 mongodb-mms-automation 是一项传统项目,并不平均值在安装MongoDB Agent时会配置自动化。

组件
默认目录
说明

二进制文件

/var/lib/mongodb-mms-automation

这些是MongoDB Agent管理的二进制文件。 其中包括MongoDB Agent 、 BI Connector和MongoDB二进制文件。

MongoDB 助手日志

/var/log/mongodb-mms-automation

这些是MongoDB Agent创建的日志文件。

MongoDB数据库

/data

这些是MongoDB Agent创建和管理的数据库。

运行以下命令以创建目录:

sudo mkdir -m 755 -p /var/lib/mongodb-mms-automation
sudo mkdir -m 755 -p /var/log/mongodb-mms-automation
sudo mkdir -m 755 -p /data

默认,助手二进制文件和Cloud Manager配置备份文件位于/var/lib/mongodb-mms-automation中。 如果要将这些文件存储在不同的目录中,请按照以下步骤操作:

要更改代理二进制文件的位置:

  1. 在MongoDB Cloud Manager中, Go项目的 Deployment 页面。

    1. 如果尚未显示,请从导航栏的 Organizations 菜单中选择包含所需项目的组织。

    2. 如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。

    3. 如果 Deployment(数据库部署)页面尚未出现,请单击侧边栏中的 Deployment(数据库)。

      显示“部署”页面。

  2. 单击部署的Agents标签页。

    显示“代理”页面。

  3. 更改路径。

    1. 单击 Downloads & Settings(连接)。

    2. Download Directory标题下方,单击Download Directory (Linux)中所示路径右侧的铅笔图标。

    3. 将路径更改为所需的新路径。

    4. 单击 Save(连接)。

    5. 在运行代理的每台主机上创建您指定的新目录。

      sudo mkdir -m 755 -p /<newPath>

要更改助手配置备份的位置,请执行以下操作:

  1. 在您首选的文本编辑器中打开助手配置文件

  2. mmsConfigBackup 设置更改为配置备份文件的新路径。

    mmsConfigBackup=/<newPath>/mms-cluster-config-backup.json
  3. 保存代理配置文件。

  4. 将配置备份文件移至新目录。

    sudo mv /var/lib/mongodb-mms-automation/mms-cluster-config-backup.json /<newPath>
11

运行以下命令:

# Create mongodb user and group if they do not exist
if ! sudo /usr/bin/id -g mongodb &>/dev/null; then
sudo /usr/sbin/groupadd -r mongodb
fi
# Create mongodb user if they do not exist and assign
# them to the mongodb group
if ! sudo /usr/bin/id mongodb &>/dev/null; then
sudo /usr/sbin/useradd -M -r -g mongodb \
-d /var/lib/mongo -s /bin/false \
-c mongodb mongodb > /dev/null 2>&1
fi
# Grant the mongodb:mongodb user and group permissions
# to manage deployments.
sudo chown mongodb:mongodb /var/lib/mongodb-mms-automation
sudo chown mongodb:mongodb /var/log/mongodb-mms-automation
sudo chown mongodb:mongodb /data
12

在安装MongoDB Agent的目录中,以上一步中创建的系统用户身份发出以下命令:

nohup ./mongodb-mms-automation-agent \
--config=local.config \
>> /var/log/mongodb-mms-automation/automation-agent-fatal.log 2>&1 &
13

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

14

Install Agent Instructions 模式中,单击 Done

15

在 zSeries 架构上(管理MongoDB 4.0或更高版本的部署):

Running RHEL / CentOS 7.x/8.x using the rpm package manager:

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select RHEL 7.X/8X Z-Series (s390x) - RPM.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

从将运行 的托管上的系统shell MongoDB Agent中,发出以下curl 命令以下载RHEL.X/.X7 8forIBM zSeries 的安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.s390x.rhel7.rpm
6

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

7

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装 MongoDB 助手的目录中,使用首选文本编辑器打开 automation-agent.config 文件:

sudo vi /etc/mongodb-mms/automation-agent.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

8

数据目录存储MongoDB数据,必须由mongod用户拥有。 对于现有MongoDB 部署,请确保mongod用户为该目录的所有者。 如果不存在MongoDB 部署,请创建目录并设立所有者。

以下命令创建一个数据目录并将所有者设立为mongod用户:

sudo mkdir /data; sudo chown mongod:mongod /data
9

发出以下命令:

sudo service mongodb-mms-automation-agent start
10

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

11

Install Agent Instructions 模式中,单击 Done

12

Use this procedure to install update to the MongoDB Agent on Linux systems that do not use deb or rpm packages.

1
2

The Update to MongoDB Agent page opens to start the update process. The Introducing the MongoDB Agent step displays. When you have finished reading this step, click Next.

3

If Automation did not manage your Monitoring Agent, you can add any Monitoring settings you had before at the Add Custom Configuration Options for your MongoDB Agent (Optional) step.

To add options that you had for your 监控代理, under the Monitoring Configurations section:

  1. Type the desired setting in the Setting box and the corresponding value in the Value box.

  2. 要添加多个Setting ,请单击+ Add Setting链接。 出现另一行。

  3. 重复此操作,直到添加所有设置。

  4. Once you have added all the settings necessary for your deployment, click Next.

You can click the to remove any settings that you have added.

重要

Cloud Manager does not validate any of these settings. Make sure that the settings and values are correct.

4
  1. 单击 View Agent Install Instructions. The Install Agent Instructions modal opens.

  2. From the Select Your Server's Operating System menu, select Other Linux - TAR.

  3. 单击 Next. The Install New MongoDB Agent modal opens.

5

注意

从这一步开始,按照 MongoDB Agent 安装模式,将提供的命令复制到 Linux shell 中。

从将运行 的托管上的系统shell MongoDB Agent中,发出以下curl 命令以下载通用 位64 Linux的安装程序:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.linux_x86_64.tar.gz
6

您可以将MongoDB Agent安装在任何目录中。 如果您想在解压缩之前将存档移动到另一个目录,可以这样做。

要安装MongoDB Agent ,请提取存档:

tar -xvzf mongodb-mms-automation-agent-<VERSION>.linux_x86_64.tar.gz
7

切换到解压缩MongoDB Agent二进制文件后创建的目录:

cd mongodb-mms-automation-agent-<VERSION>.linux_x86_64
8

在安装MongoDB Agent助手的目录中,使用首选文本编辑器打开 local.config文件。

vi <install-path>/local.config

更新以下配置选项:

项目的ProjectID

项目的代理 API 密钥

9

要将 MongoDB Agent 配置为通过代理服务器连接到 Cloud Manager,您必须在httpProxy环境变量中指定该服务器。

在安装MongoDB Agent助手的目录中,使用首选文本编辑器打开 local.config文件。

vi <install-path>/local.config

添加以下配置键:

代理服务器的 URL(主机名和端口)。

10

If you have an existing Monitoring Agent user and do not plan on activating Automation, you only need to create the log directory.

创建以下目录来存储MongoDB Agent所需的文件。

注意

在文件路径中使用 mongodb-mms-automation 是一项传统项目,并不平均值在安装MongoDB Agent时会配置自动化。

组件
默认目录
说明

二进制文件

/var/lib/mongodb-mms-automation

这些是MongoDB Agent管理的二进制文件。 其中包括MongoDB Agent 、 BI Connector和MongoDB二进制文件。

MongoDB 助手日志

/var/log/mongodb-mms-automation

这些是MongoDB Agent创建的日志文件。

MongoDB数据库

/data

这些是MongoDB Agent创建和管理的数据库。

运行以下命令以创建目录:

sudo mkdir -m 755 -p /var/lib/mongodb-mms-automation
sudo mkdir -m 755 -p /var/log/mongodb-mms-automation
sudo mkdir -m 755 -p /data

默认,助手二进制文件和Cloud Manager配置备份文件位于/var/lib/mongodb-mms-automation中。 如果要将这些文件存储在不同的目录中,请按照以下步骤操作:

要更改代理二进制文件的位置:

  1. 在MongoDB Cloud Manager中, Go项目的 Deployment 页面。

    1. 如果尚未显示,请从导航栏的 Organizations 菜单中选择包含所需项目的组织。

    2. 如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。

    3. 如果 Deployment(数据库部署)页面尚未出现,请单击侧边栏中的 Deployment(数据库)。

      显示“部署”页面。

  2. 单击部署的Agents标签页。

    显示“代理”页面。

  3. 更改路径。

    1. 单击 Downloads & Settings(连接)。

    2. Download Directory标题下方,单击Download Directory (Linux)中所示路径右侧的铅笔图标。

    3. 将路径更改为所需的新路径。

    4. 单击 Save(连接)。

    5. 在运行代理的每台主机上创建您指定的新目录。

      sudo mkdir -m 755 -p /<newPath>

要更改助手配置备份的位置,请执行以下操作:

  1. 在您首选的文本编辑器中打开助手配置文件

  2. mmsConfigBackup 设置更改为配置备份文件的新路径。

    mmsConfigBackup=/<newPath>/mms-cluster-config-backup.json
  3. 保存代理配置文件。

  4. 将配置备份文件移至新目录。

    sudo mv /var/lib/mongodb-mms-automation/mms-cluster-config-backup.json /<newPath>
11

运行以下命令:

# Create mongodb user and group if they do not exist
if ! sudo /usr/bin/id -g mongodb &>/dev/null; then
sudo /usr/sbin/groupadd -r mongodb
fi
# Create mongodb user if they do not exist and assign
# them to the mongodb group
if ! sudo /usr/bin/id mongodb &>/dev/null; then
sudo /usr/sbin/useradd -M -r -g mongodb \
-d /var/lib/mongo -s /bin/false \
-c mongodb mongodb > /dev/null 2>&1
fi
# Grant the mongodb:mongodb user and group permissions
# to manage deployments.
sudo chown mongodb:mongodb /var/lib/mongodb-mms-automation
sudo chown mongodb:mongodb /var/log/mongodb-mms-automation
sudo chown mongodb:mongodb /data
12

在安装MongoDB Agent的目录中,以上一步中创建的系统用户身份发出以下命令:

nohup ./mongodb-mms-automation-agent \
--config=local.config \
>> /var/log/mongodb-mms-automation/automation-agent-fatal.log 2>&1 &
13

In the Install Agent Instructions modal, wait for each deployment to show Verified in the Install the MongoDB Agent step.

重要

All authentication SCRAM, LDAP, and Kerberos credentials from legacy Agents are retained after the update. All .pem key files are retained as well.

单击 Next(连接)。

14

At the Final Steps modal, the legacy Backup and Monitoring Agents are put into standby mode. Click Finish.

15

After the MongoDB Agent update completes:

  • If Automation did not previously manage your Monitoring Agent, activate 备份 and/or 监控 on your MongoDB deployment.

  • If Automation did previously manage your Monitoring Agent, it is now activated. To verify that Automation is activated:

    1
    1. 如果尚未显示,请从导航栏的 Organizations 菜单中选择包含所需项目的组织。

    2. 如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。

    3. 如果 Deployment(数据库部署)页面尚未出现,请单击侧边栏中的 Deployment(数据库)。

      显示“部署”页面。

    2

    单击部署的Servers标签页。

    显示“服务器”页面。

  • If you want to activate Automation, add a deployment to your MongoDB project.

  • Stop and remove the legacy Monitoring Agent.

  • Stop and remove the legacy Backup Agent.