回滚 Apigee Edge 4.19.06

如果您在更新到 Edge 4.19.06 期间遇到错误,可以回滚导致错误的组件,然后再次尝试更新。

您可以将 Edge 4.19.06 回滚到以下功能发布版本:

  • 版本 4.19.01
  • 版本 4.18.05
  • 版本 4.18.01

在以下两种情况下,您可能需要执行回滚:

  1. 回滚到先前的功能版本。例如,从 4.19.06 到 4.18.05。
  2. 回滚到同一版本中之前的更新版本。例如,从 4.19.01.02 到 4.19.01.01。

如需了解详情,请参阅 Apigee Edge 发布流程

谁可以执行回滚

执行回滚的用户应与最初更新 Edge 的用户相同,或以 root 身份运行的用户相同。

默认情况下,Edge 组件以用户“apigee”的身份运行。在某些情况下,您可能以不同的用户身份运行 Edge 组件。例如,如果路由器必须访问特权端口(例如低于 1000 的端口),则必须以 root 用户或有权访问这些端口的用户身份运行路由器。或者,您也可以以一个用户身份运行一个组件,以另一个用户身份运行另一个组件。

使用通用代码的组件

以下 Edge 组件共用相同的代码。因此,如需回滚某个节点上的任何一个组件,您必须回滚该节点上的所有这些组件。

  • edge-management-server(管理服务器)
  • edge-message-processor(消息处理器)
  • edge-router(路由器)
  • edge-postgres-server(Postgres 服务器)
  • edge-qpid-server(Qpid 服务器)

例如,如果您在节点上安装了管理服务器、路由器和消息处理器,如需回滚其中任何一个,您必须全部回滚。

回滚到先前的功能版本

如需回滚到先前的功能版本,请在托管相应组件的每个节点上执行以下操作:

  1. 下载您要回滚到的版本的 bootstrap.sh 文件:

    • 如需回滚到 4.19.01,请下载 bootstrap_4.19.01.sh
      curl https://software.apigee.com/bootstrap_4.19.01.sh -o /tmp/bootstrap_4.19.01.sh 
    • 如需回滚到 4.18.05,请下载 bootstrap_4.18.05.sh
      curl https://software.apigee.com/bootstrap_4.18.05.sh -o /tmp/bootstrap_4.18.05.sh 
    • 如需回滚到 4.18.01,请下载 bootstrap_4.18.01.sh
      curl https://software.apigee.com/bootstrap_4.18.01.sh -o /tmp/bootstrap_4.18.01.sh 
  2. 停止组件以进行回滚:
    1. 如需回滚节点上的任何使用通用代码的组件,您必须停止所有组件,如以下示例所示:
      /opt/apigee/apigee-service/bin/apigee-service edge-management-server stop
      /opt/apigee/apigee-service/bin/apigee-service edge-router stop
      /opt/apigee/apigee-service/bin/apigee-service edge-message-processor stop
      /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server stop
      /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
    2. 如需回滚节点上的任何其他组件,请仅停止该组件:
      • /opt/apigee/apigee-service/bin/apigee-service component stop
  3. 如果您要回滚创收功能,请从所有管理服务器和消息处理器节点中卸载该应用:
    /opt/apigee/apigee-service/bin/apigee-service edge-mint-gateway uninstall
  4. 卸载组件以在节点上回滚:
    1. 如需回滚节点上使用通用代码的组件,您必须卸载 edge-gateway 组件组来将其全部卸载,如以下示例所示:
      /opt/apigee/apigee-service/bin/apigee-service edge-gateway uninstall
    2. 如需回滚节点上的任何其他组件,请仅卸载该组件,如以下示例所示:
      /opt/apigee/apigee-service/bin/apigee-service component uninstall

      其中 component 是组件名称。

    3. 如需回滚边缘路由器,除了卸载 edge-gateway 组件组外,您还必须删除 /opt/nginx/conf.d 文件的内容:
      cd /opt/nginx/conf.d
      rm -rf *
  5. 卸载 4.19.06 版的 apigee-setup
    /opt/apigee/apigee-service/bin/apigee-service apigee-setup uninstall
  6. 安装 4.19.01、4.18.05 或 4.18.01 版 apigee-service 实用程序及其依赖项。以下示例会安装 4.18.01 版 apigee-service
    sudo bash /tmp/bootstrap_4.18.01.sh apigeeuser=uName apigeepassword=pWord

    其中,uNamepWord 是您从 Apigee 收到的用户名和密码。如果省略 pWord,系统会提示您输入。

    如果您收到错误消息,请务必在第 1 步中下载 bootstrap.sh 文件。

  7. 安装 apigee-setup
    /opt/apigee/apigee-service/bin/apigee-service apigee-setup install
  8. 安装旧版组件:
    /opt/apigee/apigee-setup/bin/setup.sh -p component -f configFile

    其中,component 是要安装的组件,configFile 是要安装旧版本的配置文件。

  9. 如果您要回滚 Qpid,请清空 iptables:
    sudo iptables -F
  10. 对托管要回滚的组件的每个节点重复此过程。

回滚到先前的更新版本

如需将某个组件回滚到特定版本的版本,请在托管该组件的每个节点上执行以下操作:

  1. 下载特定的组件版本:
    /opt/apigee/apigee-service/bin/apigee-service component_version install

    其中,component_version 是要安装的组件和更新版本。例如:

    /opt/apigee/apigee-service/bin/apigee-service edge-ui-4.18.01-0.0.3749 install

    如果您使用的是 Apigee 在线代码库,则可以使用以下命令确定可用的组件版本:

    yum --showduplicates list comp

    例如:

    yum --showduplicates list edge-ui
  2. 使用 apigee-setup 安装组件:
    /opt/apigee/apigee-setup/bin/setup.sh -p comp -f configFile

    例如:

    /opt/apigee/apigee-setup/bin/setup.sh -p ui -f configFile

    请注意,安装时仅指定组件名称,而非版本。

  3. 对托管要回滚的组件的每个节点重复此过程。