设置 Aspera 群集管理器

作为高可用性安装的一部分,您必须设置 Aspera 群集管理器 (ACM)。

有关 ACM 的概述信息,请参阅 Aspera 群集管理器(概述)

在共享存储上安装 ACM 软件

  1. 从 IBM Aspera 中获取最新的 ACM 软件,并将其放入共享的 /mnt/shared/orchestrator/acm_data/ 目录中。
  2. 通过运行以下命令在专用共享卷上提取 ACM 软件,如下所示root:
    $ cd /mnt/shared/orchestrator/acm_data/
    $ tar xzvf acm4orchestrator-0-9.tar.gz
    注意: 您只需在一个节点上运行此步骤;/mnt/shared/orchestrator/acm_data/ 目录由两个节点共享orchestrator:NONE.
  3. 通过在两个 Orchestrator 服务器上执行以下命令创建符号链接:
    $ cd /opt/aspera
    $ ln –s /mnt/shared/orchestrator/acm_data/ ./acm
  4. 确认文件 database.yml 位于以下目录中:
    /opt/aspera/orchestrator/config/
    如果您使用的是分布式架构,且 MySQL 运行在与 Orchestrator 服务器分离的服务器上,请将 database.yml 文件从任意 Orchestrator 服务器上的 /opt/aspera/orchestrator/config/ 目录复制到任意 MyQL 服务器上的 /opt/aspera/acm/config/ 目录中。
  5. 确认 MySQL 中定义的用户和密码与 database.yml 匹配MYSQL_USERMYSQL_PWD如下文件中定义的值:
    /opt/aspera/acm/bin/acmcommon
  6. 配置服务在以下目录中运行:
    /opt/aspera/acm/bin/acmcommon
    默认情况下,所有服务一起运行,如下例所示:
    SERVICES=('APACHE' 'ORCHESTRATOR' 'MYSQL')
    如果在分布式架构中运行 Orchestrator(MySQL 和 Orchestrator 运行在不同的服务器上),请按照以下额外步骤操作。
    • 要只运行 Orchestrator + Apache 服务,请设置以下内容:
      SERVICES=('APACHE' 'ORCHESTRATOR')
    • 要只运行 MySQL 服务,请设置如下:
      SERVICES=('MYSQL')
    注意:在分布式架构中,/opt/aspera/acm/ 上的 ACM 挂载点必须指向 Orchestrator + Apache 服务和 MySQL 系统共享系统上的不同文件夹。 之所以需要这样做,是因为SERVICES必须在这些系统上进行不同的设置。
    例如,在 Orchestrator + Apache 服务器上的 /etc/fstab 中,可以有以下内容:n
    10.0.75.10:/home/mnt/shared/acm_data_orchestrator/ /mnt/shared/orchestrator/acm_data/ nfs4 rw,noac,sync,hard,intr 0 0
    在MySQL,可能有以下内容:
    10.0.75.10:/home/mnt/shared/acm_data_mysql/ /mnt/shared/orchestrator/acm_data/ nfs4 rw,noac,sync,hard,intr 0 0
    
  7. 要将 ACM 日志文件配置为 /var/log/aspera.log 文件,由rsyslog服务,在每个节点上按以下步骤修改 /etc/rsyslog.conf
    1. 在文件末尾添加这几行(注意# Aspera Logging是文本,而不是命令):
      # Aspera Logging
      local2.* -/var/log/aspera.log
    2. 全部替换cron.none出现次数如下:
      cron.none;local2.none
    3. /var/log/messages 事件替换为 -/var/log/messages 事件
    4. 重新启动rsyslog:
      $ /etc/init.d/rsyslog restart
  8. 设置系统以轮换日志。

    您可能会发现日志文件 /var/log/aspera.log 增长过快。 在这种情况下,有几种方法可以旋转 Aspera 日志:

    • "选项 A":在以下目录中添加 /var/log/aspera.log
      /etc/logrotate.d/syslog
    • "选项 B":在以下文件中为 aspera.log 创建一个条目:
      /etc/logrotate.conf
    • "选项 C":在以下目录中为 aspera.log 创建一个单独的配置文件:
      /etc/logrotate.d/

    选项 A 将与系统日志一起轮换记录日志(通常每周一次,经过压缩,并保存最后 10 个日志)。 不过,有些服务器的流量很大,需要比每周一次更频繁地轮换日志;在这种情况下,请使用选项 B 或 C。

    方案 A:/etc/logrotate.d/syslog 中的条目中添加 /var/log/aspera.log 如下:

    /var/log/messages 
    /var/log/secure 
    /var/log/maillog 
    /var/log/spooler 
    /var/log/boot.log 
    /var/log/cron 
    /var/log/aspera.log { 
    sharedscripts 
    postrotate 
    /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true 
    /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true 
    endscript 
    }

    选项 B: 编辑 /etc/logrotate.conf# system-specific logs may also be configured here. 行之后添加配置

    下面的示例会在 /var/log/aspera.log 达到 100MB 时压缩和旋转 10 个日志。 日志旋转完成后,它将运行 postrotate ... endscript 指定的任何脚本。

    /var/log/aspera.log {
    rotate 10
    size 100M
    create 664 root
    postrotate
    /usr/bin/killall -HUP syslogd
    endscript
    compress
    }

    下面的示例每天压缩和轮换一次 10 个日志。 copytruncate 选项告诉 logrotate 首先复制原始日志文件,然后将其截断为零字节,而不是移动原始日志文件并创建一个新文件。

    /var/log/aspera.log {
    daily
    rotate 10
    copytruncate
    compress
    }

    选项 C: 创建一个单独的 /etc/logrotate.d/aspera 配置文件,其中包含与选项 B 相同的信息。

    如果发现许多文件的长时间传输还未完成,日志就已被覆盖,可以增加日志大小。 有关详细信息,请参阅 IBM Aspera High-Speed Transfer Server管理指南

  9. 现在您已完成此步骤,可以查看 设置 Aspera 群集管理器 中的步骤。

关闭MySQL, Apache和 Orchestrator 服务的自动重启功能

chkconfig命令会在重启后关闭Aspera服务的自动重启进程。 禁用自动重启在高可用性环境中至关重要,这样 ACM 就能根据需要控制重启过程,以保持高可用性。
  1. 运行以下命令,关闭 MySQL, Apache 和 Orchestrator 服务:
    # chkconfig aspera_mysqld off
    # chkconfig aspera_httpd off
    # chkconfig AsperaOrchestrator off
  2. 如果使用的是 Centos 7.x 平台,请在关闭服务后运行以下附加步骤。
    1. 重新启动后,关闭(禁用)自动重新启动orchestratorservice:
      # systemctl disable orchestrator_asctl.service
    2. 删除符号链接:
      # /etc/systemd/system/multi-user.target.wants/orchestrator_asctl.service
    3. 要确认已禁用,请运行以下程序:
      # systemctl list-unit-files | grep orchestrator_asctl.service
      orchestrator_asctl.service                  disabled

配置运行 ACM 的 crontab 条目

在两个节点的 crontab 中配置 ACM 服务,以便acm4orchestrator脚本每分钟启动一次。

使用 crontab –e 命令对条目进行如下配置。
$ crontab –e
* * * * * /opt/aspera/acm/bin/acm4orchestrator ip_address > /dev/null 2>&1
crontab 中必须输入一个参数:运行脚本的主机 IP 地址。 此参数将传递给 acm4orchestrator 脚本。
在下面的示例中,IP 地址为10.0.71.21.
$ crontab –e
* * * * * /opt/aspera/acm/bin/acm4orchestrator 10.0.71.21 device_ID > /dev/null 2>&1
查找设备 ID:
$ stat -c "%d" mount_point
例如:
$ stat -c "%d" /mnt
在上面的例子中/mnt是共享存储位置。
创建共享存储的挂载:
$ mount -v -o vers=3,proto=tcp,port=2049 shared_storage mount_point
例如:
$ mount -v -o vers=3,proto=tcp,port=2049 ha_storage.aspera.us /mnt

crontab 中配置后,acm4orchestrator 脚本会定期运行,以确定active节点上启动所需的 Orchestrator 服务activepassive节点,取决于它们当前的状态 (activepassive).

获取 crontab 参数值

要列出系统上可用的 IP 地址,请运行以下命令:
$ ip addr | grep "inet"
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
inet 10.0.75.21/16 brd 10.255.255 scope global eth0

运行 ACM 正常性检查

acmctl 命令有一个选项,用于检查是否进行了必要的配置,以使 acm4orchestrator 脚本能够正常运行。 您应确保每个服务器都通过了正确性测试。

  1. 在两个节点上运行带有 -s 选项的 acmctl 命令,以验证 ACM 的基本先决条件。

    注意Checking if an entry for ACM seems to exist in crontab在 Cube Viewer 中显示为KO不是OK在下面的示例中,由于用户尚未创建crontab条目,该条目将在每台服务器上运行 ACM 软件。

    $ /opt/aspera/acm/bin/acmctl –s
    
    ACM sanity check
    ----------------
    Checking if an entry for ACM seems to exist in the crontab     OK 
    Checking that the orchestrator master service is disabled in chkconfig     OK 
    Checking that SE Linux mode is not set to enforcing     OK
    
  2. 纠正任何未通过合理性检查的任务(带有crontab这些任务将在下一节讨论)。
  3. 运行以下命令,其中ip_address是运行脚本的主机的 IP 地址:
    /opt/aspera/acm/bin/acm4orchestrator ip_address
    检查输出,确保没有显示错误。

识别每个 Orchestrator 服务器上 ACM 的状态

以下命令可用于识别哪个 Orchestrator 服务器处于活动状态,哪个处于被动状态:
/opt/aspera/acm/bin/acmctl -i
有关使用此命令的更多信息,请参阅 在一个节点上禁用和重新启用 ACM

使用 VIP 与 Orchestrator 连接

如果负载平衡器在 Orchestrator 服务器前提供了虚拟 IP 地址 (VIP),且服务运行正常,则现在可以使用分配给 ACM 群集的 VIP 连接到 Orchestrator 应用程序。