[AIX][Linux]

AIX and Linux 系统启动时启动 MFT 代理程序

可以将 Managed File Transfer Agent 配置为在 AIX® and Linux®上的系统启动时启动。 注销时,代理将继续运行,并且可以接收文件传输。

使用下列其中一个 Managed File Transfer 命令; fteCreateAgentfteCreateCDAgentfteCreateBridgeAgent创建和配置代理程序时,可以使用仅执行以下命令的脚本文件将其配置为在 AIX and Linux 机器上重新引导期间自动启动:

su -l mqmft_user -c mq_install_root/bin/fteStartAgent agent_name
其中 mq_install_root 是必需 Managed File Transfer 安装的根目录,缺省值为: /opt/mqmagent_name 是要启动的 Managed File Transfer Agent 的名称。 此脚本文件的使用因特定操作系统而异。 例如,在 Linux下提供了其他选项。
[Linux]

Linux

对于 Linux 系统,有多种在系统引导过程中启动应用程序的方式。 通常,请考虑以下步骤:
  1. 创建一个名为 /etc/rc.mqmft 的文件,包含以下内容:
    #!/bin/sh
    su -l mqmft_user"-c mq_install_root/bin/fteStartAgent agent_name"
    其中,mqmft_user 是将作为代理进程运行身份的用户标识。 该用户标识必须是 mqm 组的成员。
  2. 使该文件可执行,例如:
    chmod 755 /etc/rc.mqmft 
  3. 接下来,将以下行添加到 /etc/inittab
    mqmft:5:boot:/etc/rc.mqmft

Linux 引导期间启动代理的其他方式包括将脚本行添加到 /etc/rc.d/rc.local 文件中,或在 Linux SuSe 上,将脚本行添加到 /etc/init.d/boot.local 文件中。 您应选择最适合自己环境的方法。 以下是有关在受支持的特定 Linux 分发版启动期间启动代理的其他方式的更多信息:

SLES 10 和 11
对于 SUSE Linux Enterprise Server (SLES) 10 和 11 系统,请执行以下步骤:
  1. 以系统 root 用户标识身份创建您自己的 /etc/init.d/rc.rclocal 文件。
  2. 将以下行添加到 rc.rclocal 文件:
    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides: rc.rclocal
    # Required-Start: $network $syslog
    # Required-Stop: $network $syslog
    # Default-Stop: 0 1 2 6
    # Description: MQMFT agent startup
    ### END INIT INFO
    su -l mqmft_user"-c mq_install_root/bin/fteStartAgent agent_name"
  3. 运行以下命令:
    chmod 755 rc.rclocal
    
    chkconfig --add rc.rclocal
[Linux]

在具有 systemdLinux 上启动 Managed File Transfer 代理程序

执行以下过程:
  1. /etc/systemd/ 系统文件夹中创建文件并对其进行命名,例如, <agentname>.service。 添加以下内容,其中 <agentname>MFT_AGT_LNX_0
    # vi /etc/systemd/system/MFT_AGT_LNX_0.service
    [Unit]
    Description=IBM MQ MFT MFT_AGT_LNX_0
    [Service]
    ExecStart=/opt/mqm/bin/fteStartAgent MFT_AGT_LNX_0
    ExecStop=/opt/mqm/bin/fteStopAgent MFT_AGT_LNX_0
    Type=forking
    User=mqm
    Group=mqm
    KillMode=none
  2. 要启用服务,请运行以下命令:
    # systemctl enable MFT_AGT_LNX_0
    # systemctl daemon-reload
  3. 要启动代理程序并检查其状态,请运行以下命令:
    # systemctl start MFT_AGT_LNX_0
    # systemctl status MFT_AGT_LNX_0