復原 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 的使用者,或以根層級執行的使用者相同。

根據預設,Edge 元件會以使用者「apigee」的形式執行。在某些情況下,您可能會以不同使用者的身分執行 Edge 元件。舉例來說,如果路由器需要存取特殊權限通訊埠 (例如 1000 以下的通訊埠),您就必須以根層級或有權存取這些通訊埠的使用者的身分執行路由器。或者,您也可以以單一使用者的身分執行某個元件,並以其他使用者的身分執行另一個元件。

含有常用程式碼的元件

下列 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 Router,除瞭解除安裝 edge-gateway 元件群組之外,您還必須刪除 /opt/nginx/conf.d 檔案的內容:
      cd /opt/nginx/conf.d
      rm -rf *
  5. 解除安裝 apigee-setup 4.19.06 版本:
    /opt/apigee/apigee-service/bin/apigee-service apigee-setup uninstall
  6. 安裝 apigee-service 公用程式及其依附元件的 4.19.01、4.18.05 或 4.18.01 版本。以下範例會安裝 apigee-service 的 4.18.01 版:
    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. 針對您要復原的元件的每個託管節點,重複執行這項程序。