如果在更新至 Edge 4.19.06 時發生錯誤,可以復原導致錯誤的元件,然後再次嘗試更新。
您可以將 Edge 4.19.06 復原至下列發布版本:
- 4.19.01 版
- 4.18.05 版
- 4.18.01 版
您可能需要在以下兩種情況下執行復原:
- 復原至先前的功能版本。例如從 4.19.06 降級至 4.18.05。
- 復原至同一版本中的前一個更新版本。例如從 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 伺服器)
舉例來說,如果您在節點上安裝了管理伺服器、路由器和訊息處理器,則必須復原這三個元件,才能復原其中任何一個元件。
復原至先前的功能版本
如要復原至先前的功能版本,請在託管元件的每個節點上執行下列操作:
-
下載要復原版本的
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
- 如要復原至 4.19.01,請下載
- 停止要復原的元件:
- 如要復原節點上具有通用程式碼的任何元件,您必須停止所有元件,如以下範例所示:
/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 - 如要復原節點上的任何「其他」元件,請只停止該元件:
/opt/apigee/apigee-service/bin/apigee-service component stop
- 如要復原節點上具有通用程式碼的任何元件,您必須停止所有元件,如以下範例所示:
- 如要復原 Monetization,請從所有管理伺服器和訊息處理器節點解除安裝:
/opt/apigee/apigee-service/bin/apigee-service edge-mint-gateway uninstall
- 解除安裝元件,在節點上復原:
- 如要復原節點上具有通用程式碼的任何元件,您必須解除安裝
edge-gateway元件群組,才能解除安裝所有元件,如以下範例所示:/opt/apigee/apigee-service/bin/apigee-service edge-gateway uninstall
- 如要復原節點上的任何其他元件,請只解除安裝該元件,如下例所示:
/opt/apigee/apigee-service/bin/apigee-service component uninstall
其中 component 是元件名稱。
- 如要復原 Edge Router,除了要解除安裝
edge-gateway元件群組,還必須刪除/opt/nginx/conf.d檔案的內容:cd /opt/nginx/conf.d
rm -rf *
- 如要復原節點上具有通用程式碼的任何元件,您必須解除安裝
- 解除安裝 4.19.06 版
apigee-setup:/opt/apigee/apigee-service/bin/apigee-service apigee-setup uninstall
- 安裝 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
其中 uName 和 pWord 是您從 Apigee 收到的使用者名稱和密碼。如果省略 pWord,系統會提示您輸入。
如果收到錯誤訊息,請確認您已在步驟 1 下載
bootstrap.sh檔案。 - 安裝
apigee-setup:/opt/apigee/apigee-service/bin/apigee-service apigee-setup install
- 安裝舊版元件:
/opt/apigee/apigee-setup/bin/setup.sh -p component -f configFile
其中 component 是要安裝的元件,configFile 是舊版設定檔。
- 如果您要復原 Qpid,請清除 iptables:
sudo iptables -F
- 針對託管要復原元件的每個節點,重複執行這項程序。
復原至先前的更新版本
如要將元件復原至特定版本,請在託管該元件的每個節點上執行下列操作:
- 下載特定元件版本:
/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
- 使用
apigee-setup安裝元件:/opt/apigee/apigee-setup/bin/setup.sh -p comp -f configFile
例如:
/opt/apigee/apigee-setup/bin/setup.sh -p ui -f configFile
請注意,安裝時只需指定元件名稱,不需指定版本。
- 針對託管要復原元件的每個節點,重複執行這項程序。