回滚 Apigee Edge 4.50.00

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

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

  • 版本 4.19.06
  • 版本 4.19.01
  • 版本 4.18.05

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

  1. 回滚到之前的 Feature Release。例如,从 4.50.00 降级到 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.06,请下载 bootstrap_4.19.06.sh:
      curl https://software.apigee.com/bootstrap_4.19.06.sh -o /tmp/bootstrap_4.19.06.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 
  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 路由器,除了卸载 edge-gateway 组件组之外,您还必须删除 /opt/nginx/conf.d 文件的内容:
      cd /opt/nginx/conf.d
      rm -rf *
  5. 卸载 4.50.00 版 apigee-setup:
    /opt/apigee/apigee-service/bin/apigee-service apigee-setup uninstall
  6. 安装 4.19.01 或 4.18.05 版本的 apigee-service 实用程序及其依赖项。以下示例安装 4.18.05 版本的 apigee-service:
    sudo bash /tmp/bootstrap_4.18.05.sh apigeeuser=uName apigeepassword=pWord

    其中,uName 和 pWord 是您从 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.05-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. 对托管要回滚的组件的每个节点重复此过程。