本文件說明如何更新現有的 4.16.01 安裝作業,以便使用 Apigee 的最新 RPM 和支援檔案。這項程序會使用 update.sh 公用程式執行更新。
哪些 Edge 版本可以更新至最新的 4.16.01 版本
您只能將現有的 Apigee Edge 4.16.01.x 安裝版本更新至最新的 4.16.01 版本。
如果您目前執行的是 Edge 4.15.07.0x 以下版本,則必須先遷移至 4.16.01。如要瞭解如何從 4.15.07.0x 或更早版本遷移至 4.16.01 版,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
誰可以執行更新
執行更新的使用者應與原先安裝 Edge 的使用者相同,或以 root 身分執行。
安裝 Edge RPM 後,任何使用者都可以進行設定。
更新所需的磁碟空間
執行更新前,請確認磁碟至少有 1 GB 的可用空間。
自動傳播 4.16.01.x 的屬性設定
如果您透過編輯 /opt/apigee/customer/application 中的 .properties 檔案設定任何屬性,更新作業會保留這些值。
更新必要條件
升級 Apigee Edge 前,請先完成下列必要條件:
- 備份所有節點
為安全起見,建議您在更新前完整備份所有節點。請按照目前 Edge 版本的程序執行備份。
這樣一來,如果新版本無法正常運作,您就有備用方案。如要進一步瞭解備份,請參閱 Apigee Edge 4.16.01 作業指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。 - 確認 Edge 正在執行
使用下列指令,確認 Edge 在更新程序期間正常運作:
> /<inst_root>/apigee/apigee-service/bin/apigee-all status
處理更新失敗
如果更新失敗,您可以嘗試修正問題,然後再次執行 update.sh。您可以多次執行更新,系統會從上次中斷的地方繼續更新。
如果失敗時需要將更新復原至先前的版本,請參閱 Apigee FTP 網站 (ftp://ftp.apigee.com/) 提供的 Apigee Edge 4.16.01 安裝指南。
記錄更新資訊
根據預設,update.sh 公用程式會將記錄資訊寫入:
/opt/apigee/var/log/apigee-setup/update.log
如果執行 update.sh 公用程式的使用者無法存取該目錄,系統會將記錄寫入 /tmp 目錄,並命名為 update_username.log。
如果使用者無法存取 /tmp,update.sh 公用程式就會失敗。
零停機更新
零停機時間更新 (或滾動式更新) 可讓您更新 Edge 安裝,而不會關閉 Edge。
如要進行零停機時間升級,關鍵在於從負載平衡器中逐一移除各個路由器。接著,您要更新路由器和與路由器位於同一部機器上的任何其他元件,然後將路由器重新加入負載平衡器。
- 請按照下方「機器更新順序」一節所述,依正確順序更新安裝作業中的機器。
- 更新路由器時,請選取任一路由器,並將其設為無法連線,如「將路由器和訊息處理器設為無法連線」一節所述。
- 更新所選路由器,以及與路由器位於同一部機器上的所有其他 Edge 元件。 所有 Edge 設定都會在同一個節點上顯示路由器和訊息處理器。
- 讓路由器恢復連線。
- 對其餘路由器重複步驟 2 到 4。
- 繼續更新安裝作業中的其餘機器。
讓路由器和訊息處理器無法連線
在正式環境設定中,您會有多個路由器和訊息處理器,以達到最佳效能,而且您必須在更新前後啟用/停用這些路由器和訊息處理器的連線能力。
下列 API 呼叫會將節點設為可連線或無法連線:
> curl -u adminEmail:pWord -X POST "http://<ms_IP>:8080/v1/servers/UUID" -d "reachable=true|false"
其中 UUID 是訊息處理器或路由器的 UUID,而 reachable 則設為 true 或 false。
如要判斷路由器的 UUID,請使用下列 cURL 指令:
> curl http://<routerIP>:8081/v1/servers/self
如要判斷訊息處理器的 UUID,請使用下列 cURL 指令:
> curl http://<mpIP>:8082/v1/servers/self
更新前後請留意以下事項:
- 在合併的路由器和訊息處理器節點上:
- 更新前,請執行下列操作:
- 使用上述 API 呼叫,讓路由器無法連線。
- 讓訊息處理器無法連線。
- 更新後,請執行下列操作:
- 讓訊息處理器可供連線。
- 讓路由器可供連線。
- 更新前,請執行下列操作:
- 在單一路由器節點上:
- 請先確認路由器可連線,再進行更新。
- 更新後,請確保路由器可連線。
- 在單一訊息處理器節點上:
- 更新前,請先讓訊息處理器無法連線。
- 更新後,請讓訊息處理器可供連線。
使用靜音設定檔
您必須將自動設定檔傳遞至更新指令。自動設定檔應與您用來安裝 Edge 4.16.01 的檔案相同。
在具有外部網際網路連線的節點上更新 4.16.01 的程序
請按照下列程序更新節點上的 Edge 元件:
- 如有任何 CRON 工作設定為對 Cassandra 執行修復作業,請先停用,直到更新完成為止。
- 以 root 身分登入節點,安裝 Edge RPM
注意:雖然 RPM 安裝需要 root 存取權,但您可以在沒有 root 存取權的情況下執行 Edge 設定。 - 按照 Apigee Edge 4.16.01 安裝指南中的說明停用 SELinux,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/
- 清除所有 Yum 快取:
> sudo yum clean all - 將最新的 Edge bootstrap.sh 檔案下載至 /tmp/bootstrap.sh:
> curl https://software.apigee.com/bootstrap.sh -o /tmp/bootstrap.sh - 更新 Edge apigee-service 公用程式和依附元件:
> sudo bash /tmp/bootstrap.sh apigeeuser=uName apigeepassword=pWord
其中 uName:pWord 是您從 Apigee 收到的使用者名稱和密碼。如果省略 pWord,系統會提示您輸入。 - 使用 apigee-service 更新 apigee-setup 公用程式:
> /opt/apigee/apigee-service/bin/apigee-service apigee-setup update
這項 apigee-service 更新會在 <inst_dir>/apigee/apigee-setup/bin 中安裝 update.sh 公用程式。 - 請按照下方「機器更新順序」所述的順序,在節點上執行更新公用程式:
> /opt/apigee/apigee-setup/bin/update.sh -c component -f configFile
設定檔的唯一要求是「apigee」使用者必須能存取或讀取設定檔。例如,將檔案放在節點的 /tmp 目錄中。
使用「-c」選項指定要更新的元件。可能包含的元件如下:- ldap = OpenLDAP
- cs = Cassandra
- zk = Zookeeper
- qpid = qpidd
- ps = postgresql
- edge =Edge UI 以外的所有 Edge 元件:Management Server、訊息處理器、Router、QPID Server、Postgres Server
- ui = Edge UI
- all = 更新機器上的所有元件 (僅適用於 Edge aio 安裝設定檔或 API BaaS asa 安裝設定檔)
- e = ElasticSearch
- b = API BaaS Stack
- p = API BaaS 入口網站
- ebp = ElasticSearch、API BaaS Stack 和 API BaaS Portal 位於同一個節點
- 在訊息處理器上執行 apigee-validate 公用程式,測試更新。詳情請參閱 Apigee Edge 4.16.01 安裝指南,可前往 Apigee FTP 網站取得:ftp://ftp.apigee.com/
從本機存放區更新 4.16.01 的程序
如果 Edge 節點位於防火牆後方,或因其他原因而無法透過網際網路存取 Apigee 存放區,您可以從 Apigee 存放區的本機存放區或鏡像執行更新。
建立本機 Edge 存放區後,您可以透過下列兩種方式從本機存放區更新 Edge:
- 建立存放區的 .tar 檔案,將 .tar 檔案複製到節點,然後從 .tar 檔案更新 Edge。
- 在本機存放區的節點上安裝網路伺服器,讓其他節點可以存取。 Apigee 提供 Nginx 網路伺服器供您使用,您也可以使用自己的網路伺服器。
如要從本機 4.16.01 存放區更新:
- 請按照 Apigee Edge 4.16.01 安裝指南所述,確認您有本機 4.16.01 存放區,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/
- 更新本機存放區:
- 將最新的 Edge bootstrap.sh 檔案下載至 /tmp/bootstrap.sh:
> curl https://software.apigee.com/bootstrap.sh -o /tmp/bootstrap.sh - 執行同步處理:
> /opt/apigee/apigee-service/bin/apigee-service apigee-mirror sync --only-new-rpms
- 將最新的 Edge bootstrap.sh 檔案下載至 /tmp/bootstrap.sh:
-
如要從 .tar 檔案安裝 apigee-service:
- 在本機存放區的節點上,使用下列指令將本機存放區封裝成名為 /opt/apigee/data/apigee-mirror/apigee-4.16.01.tar.gz 的單一.tar 檔案:
> /opt/apigee/apigee-service/bin/apigee-service apigee-mirror package - 將 .tar 檔案複製到要更新 Edge 的節點。例如,將其複製到新節點上的 /tmp 目錄。
- 在新節點上,將檔案解壓縮至 /tmp 目錄:
> tar -xzf apigee-4.16.01.tar.gz
這個指令會在包含 .tar 檔案的目錄中建立名為 repos 的新目錄。例如 /tmp/repos。 - 以 root 身分登入節點,安裝 Edge RPM
注意:雖然 RPM 安裝需要 root 存取權,但您可以在沒有 root 存取權的情況下執行 Edge 設定。 - 按照 Apigee Edge 4.16.01 安裝指南中的說明停用 SELinux,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/
- 從 /tmp/repos 安裝 Edge apigee-service 公用程式和依附元件:
> sudo bash /tmp/repos/bootstrap.sh apigeeprotocol="file://" apigeerepobasepath=/tmp/repos
請注意,您在這個指令中加入了 repos 目錄的路徑。
- 在本機存放區的節點上,使用下列指令將本機存放區封裝成名為 /opt/apigee/data/apigee-mirror/apigee-4.16.01.tar.gz 的單一.tar 檔案:
-
如要使用 Nginx 網路伺服器安裝 apigee-service:
- 按照 Edge 4.16.01 安裝指南中「使用 Nginx 網路伺服器從存放區安裝」一節所述,設定 Nginx 網路伺服器。該指南可從 Apigee FTP 網站取得:ftp://ftp.apigee.com/
- 在遠端節點上,將 Edge bootstrap.sh 檔案下載至 /tmp/bootstrap.sh:
> /usr/bin/curl http://uName:pWord@remoteRepo:3939/bootstrap.sh -o /tmp/bootstrap.shwhere uName:pWord are the username and password you set above for the repo, and remoteRepo is the IP address or DNS name of the repo node.
- Log in to your node as root to install the Edge RPMs
Note: While RPM installation requires root access, you can perform Edge configuration without root access. - Disable SELinux as described in the Apigee Edge 4.16.01 Installation Guide, available on the Apigee FTP site: ftp://ftp.apigee.com/
- On the remote node, install the Edge apigee-service utility and
dependencies:
> sudo bash /tmp/bootstrap.sh apigeerepohost=remoteRepo:3939 apigeeuser=uName apigeepassword=pWord apigeeprotocol=http://
where uName:pWord are the repo username and password.
- If present, disable any CRON jobs configured to perform a repair operation on Cassandra until after the update completes.
- Use apigee-service to update the apigee-setup utility:
> /opt/apigee/apigee-service/bin/apigee-service apigee-setup update
This update to apigee-service installs the update.sh utility in <inst_dir>/apigee/apigee-setup/bin. - Run the update utility on your nodes in the order described below in "Order of machine
update" below:
> /opt/apigee/apigee-setup/bin/update.sh -c component -f configFile
The only requirement on the config file is that the configuration file must be accessible or readable by the "apigee" user. For example, put the file in the /tmp directory on the node.
Use the “-c” option to specify the component to update. The list of possible components includes:- ldap = OpenLDAP
- cs = Cassandr
- zk = Zookeeper
- qpid = qpidd
- ps = postgresql
- edge =All Edge components except Edge UI: Management Server, Message Processor, Router, QPID Server, Postgres Server
- ui = Edge UI
- all = update all components on machine (only use for an Edge aio installation profile or an API BaaS asa installation profile)
- e = ElasticSearch
- b = API BaaS Stack
- p = API BaaS Portal
- ebp = ElasticSearch, API BaaS Stack, and API BaaS Portal on the same node
- Test the update by running the apigee-validate utility on the Message Processor, as described in the Apigee Edge 4.16.01 Installation Guide, available on the Apigee FTP site: ftp://ftp.apigee.com/
Order of machine update
The order that you update the machines in an Edge installation is important. The most important considerations to an update are:
- You must update all Cassandra and ZooKeeper nodes before you update any other nodes.
- You must update all qpidd and postgresql nodes before you update any Router and Message Processor nodes.
- For any machine with multiple Edge components (Management Server, Message Processor, Router, QPID Server, Postgres Server), use the "-c edge" option to update them all at the same time.
- If a step specifies that it should be performed on multiple machines, perform it in the specified machine order.
- There is no separate step to update Monetization. It is updated when you specify the "-c edge" option.
- After you update a Router node, you must remove all files from the /opt/nginx/conf.d directory, and then restart the Router.
For a 1-host standalone installation
- Update machine 1:
> /opt/apigee/apigee-setup/bin/update.sh -c all -f configFile
- 刪除 /opt/nginx/conf.d 中的所有檔案:
> rm -f /opt/nginx/conf.d/* - 重新啟動 Edge Router:
> /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
2 主機獨立安裝
如需 Edge 拓撲和節點編號清單,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
- 在機器 1 上更新 Cassandra 和 ZooKeeper:
> /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
- 在機器 2 上更新 qpidd 和 postgresql:
> /opt/apigee/apigee-setup/bin/update.sh -c qpid,ps -f configFile
- 在機器 1 上更新 LDAP:
> /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
- 更新機器 2 和機器 1 上的 Edge 元件:
> /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
- 在節點 1 上:
- 刪除
/opt/nginx/conf.d中的所有檔案:> rm -f /opt/nginx/conf.d/*
- 重新啟動邊緣路由器:
> /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
- 刪除
- 更新機器 1 的 UI:
> /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile
5 主機叢集安裝
如需 Edge 拓撲和節點編號清單,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
- 在機器 1、2 和 3 上更新 Cassandra 和 ZooKeeper:
> /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
- 更新機器 4 和 5 上的 qpidd 和 postgresql:
> /opt/apigee/apigee-setup/bin/update.sh -c qpid,ps -f configFile
- 在機器 1 上更新 LDAP:
> /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
- 更新機器 4、5、1、2、3 上的 Edge 元件:
> /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
- 在節點 2 和 3 上:
- 刪除
/opt/nginx/conf.d中的所有檔案:> rm -f /opt/nginx/conf.d/*
- 重新啟動邊緣路由器:
> /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
- 刪除
- 更新機器 1 的 UI:
> /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile
如果是 9 主機叢集安裝
如需 Edge 拓撲和節點編號清單,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
- 在機器 1、2 和 3 上更新 Cassandra 和 ZooKeeper:
> /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
- 更新機器 6 和 7 上的 qpidd:
> /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile
- 更新機器 8 和 9 上的 postgresql:
> /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile
- 在機器 1 上更新 LDAP:
> /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
- 依序更新機器 6、7、8、9、1、4 和 5 上的 Edge 元件:
> /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
- 在節點 4 和 5 上:
- 刪除
/opt/nginx/conf.d中的所有檔案:> rm -f /opt/nginx/conf.d/*
- 重新啟動邊緣路由器:
> /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
- 刪除
- 更新機器 1 的 UI:
> /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile
13 主機叢集安裝
如需 Edge 拓撲和節點編號清單,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
- 在機器 1、2 和 3 上更新 Cassandra 和 ZooKeeper:
> /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
- 更新機器 12 和 13 上的 qpidd:
> /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile - 更新機器 8 和 9 上的 postgresql:
> /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile - 更新機器 4 和 5 上的 LDAP:
> /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
- 依序更新機器 12、13、8、9、6、7、10 和 11 上的 Edge 元件:
> /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
- 在節點 10 和 11 上:
- 刪除
/opt/nginx/conf.d中的所有檔案:> rm -f /opt/nginx/conf.d/*
- 重新啟動邊緣路由器:
> /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
- 刪除
- 更新機器 6 和 7 的 UI:
> /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile
12 主機叢集安裝
如需 Edge 拓撲和節點編號清單,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
- 更新 Cassandra 和 ZooKeeper:
- 在資料中心 1 的機器 1、2 和 3 上:
> /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
- 資料中心 2 的機器 7、8 和 9
> /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
- 在資料中心 1 的機器 1、2 和 3 上:
- 更新 qpidd:
- 資料中心 1 的機器 4、5
> /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile
- 資料中心 2 的機器 10、11
> /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile
- 資料中心 1 的機器 4、5
- 更新 postgresql:
- 資料中心 1 中的機器 6
> /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile
- 資料中心 2 的機器 12
> /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile
- 資料中心 1 中的機器 6
- 更新 LDAP:
- 資料中心 1 中的機器 1
> /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
- 資料中心 2 中的機器 7
> /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
- 資料中心 1 中的機器 1
- 更新 Edge 元件:
- 資料中心 1 中的機器 4、5、6、1、2、3
> /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
- 資料中心 2 中的機器 10、11、12、7、8、9
> /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
- 在節點 2、3、8 和 9 上:
- 刪除
/opt/nginx/conf.d中的所有檔案:> rm -f /opt/nginx/conf.d/*
- 重新啟動邊緣路由器:
> /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
- 刪除
- 資料中心 1 中的機器 4、5、6、1、2、3
- 更新 UI:
- 資料中心 1 中的機器 1
> /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile
- 資料中心 2 的機器 7
> /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile
- 資料中心 1 中的機器 1
適用於 7 主機 API BaaS 安裝
如需 Edge 拓撲和節點編號清單,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
- 更新機器 5、6 和 7 上的 Cassandra:
> /opt/apigee/apigee-setup/bin/update.sh -c cs -f configFile
- 在機器 1、2 和 3 上更新 ElasticSearch 和 API BaaS 堆疊:
> /opt/apigee/apigee-setup/bin/update.sh -c e,b -f configFile
- 在機器 4 上更新 API BaaS 入口網站:
> /opt/apigee/apigee-setup/bin/update.sh -c p -f configFile
10 主機 API BaaS 安裝
如需 Edge 拓撲和節點編號清單,請參閱 Apigee Edge 4.16.01 安裝指南,該指南可在 Apigee FTP 網站取得:ftp://ftp.apigee.com/。
- 在機器 8、9 和 10 上更新 Cassandra:
> /opt/apigee/apigee-setup/bin/update.sh -c cs -f configFile
- 在機器 1、2 和 3 上更新 ElasticSearch:
> /opt/apigee/apigee-setup/bin/update.sh -c e -f configFile
- 更新機器 4、5 和 6 上的 API BaaS 堆疊:
> /opt/apigee/apigee-setup/bin/update.sh -c b -f configFile
- 在機器 7 上更新 API BaaS 入口網站:
> /opt/apigee/apigee-setup/bin/update.sh -c p -f configFile
非標準安裝
如果您採用非標準安裝,請按照下列順序更新 Edge 元件:
- ZooKeeper
- Cassandra
- qpidd
- postgresql
- LDAP
- Edge,也就是所有節點上的「-c edge」設定檔,順序為:Qpid、Postgres、Management Server、訊息處理器、Router。
- 在所有路由器節點上:
- 刪除
/opt/nginx/conf.d中的所有檔案:> rm -f /opt/nginx/conf.d/*
- 重新啟動邊緣路由器:
> /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
- 刪除
- UI