將 Apigee Edge 4.16.01.x 更新至 4.16.01 版

本文件說明如何更新現有 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。請參閱 Apigee ftp 網站提供的 Apigee Edge 4.16.01 安裝指南,網址為 ftp://ftp.apigee.com/,瞭解如何從 4.15.07.0x 以下版本遷移至 4.16.01 版。

誰可以執行更新

執行更新的使用者必須與原先安裝 Edge 的使用者,或以根層級執行的使用者相同。

安裝 Edge RPM 後,任何使用者都能設定。

要更新的磁碟空間需求

在執行更新之前,請先確認您至少有 1 GB 的可用磁碟空間。

從 4.16.01.x 自動傳播資源設定

如果您在 /opt/apigee/customer/application 編輯 .properties 檔案來設定任何屬性,更新作業會保留這些值。

更新必要條件

升級 Apigee Edge 之前,請先考量下列必要條件:

  • 備份所有節點
    為了安全起見,建議您在更新之前先對所有節點執行完整的備份。請根據目前版本的 Edge 執行備份程序。

    這可讓您擬定備份方案,以免更新至新版本無法正常運作。如要進一步瞭解備份,請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 作業指南ftp://ftp.apigee.com/
  • 確保 Edge 仍在運作
    使用下列指令,確保 Edge 在更新程序期間處於運作狀態:

    > /<inst_root>/apigee/apigee-service/bin/apigee-all status

處理失敗的更新

如果更新失敗,您可以嘗試修正問題,然後再次執行 update.sh。您可以多次執行更新,系統會從上次中斷的地方繼續更新。

如果失敗需要您復原為前一個版本,請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南ftp://ftp.apigee.com/

記錄更新資訊

根據預設,update.sh 公用程式會將記錄資訊寫入至:

/opt/apigee/var/log/apigee-setup/update.log

如果執行 update.sh 公用程式的使用者無法存取該目錄,系統會將記錄以名為 update_username.log 的檔案寫入 /tmp 目錄。

如果使用者無法存取 /tmpupdate.sh 公用程式就會失敗。

零停機時間更新

零停機時間更新或滾動式更新可讓您在不降低 Edge 的情況下更新 Edge 安裝。

升級零停機的關鍵就是從負載平衡器一次移除一個路由器。接著,您要更新路由器和同一部機器上的任何其他元件,然後再將路由器加回負載平衡器。

  1. 按照「機器更新順序」中的說明,按照正確的安裝順序更新機器。
  2. 當您要更新路由器時,請選取任一路由器,並將其設為無法連線至該路由器,詳情請參閱下一節「將路由器與訊息處理器無法連線」一節。
  3. 在與路由器相同的機器上,更新所選路由器和所有其他 Edge 元件。 所有邊緣設定都會在同一節點上顯示路由器和訊息處理器。
  4. 重新連線至路由器。
  5. 針對其餘的路由器重複步驟 2 到步驟 4。
  6. 繼續更新安裝檔中剩餘的任何機器。

將路由器和訊息處理器設為無法連線至路由器和訊息處理器

在實際工作環境設定中,您會使用多個路由器和訊息處理器來達到最佳效能,並在更新前/後啟用/停用這些路由器和訊息處理器的可連性。

下列 API 呼叫會將節點設為可連線或無法連線:

> curl -u adminEmail:pWord -X POST "http://<ms_IP>:8080/v1/servers/UUID" -d "reachable=true|false"

其中 UUID 是訊息處理器或路由器的 UUID,可連線至 True 或 False。

如果您需要判斷路由器的 UUID,請使用下列 cURL 指令:

> curl http://<routerIP>:8081/v1/servers/self

如果您需要判斷訊息處理器的 UUID,請使用下列 cURL 指令:

> curl http://<mpIP>:8082/v1/servers/self

請在更新前/後處理下列事項:

  • 在合併的路由器和訊息處理器節點上:
    • 更新前,請執行下列步驟:
      1. 使用上述 API 呼叫,讓路由器無法連上路由器。
      2. 將無法連上「訊息處理器」。
    • 更新後,請執行下列步驟:
      1. 將訊息處理器設為可連線。
      2. 確定路由器可連線。
  • 在單一路由器節點上:
    • 更新前,請將路由器設為可連線。
    • 更新完成後,請將路由器恢復連線。
  • 在單一訊息處理器節點上:
    • 更新前,請讓訊息處理器無法存取。
    • 更新完成後,請讓訊息處理器可連上。

使用無訊息設定檔

您必須將無訊息設定檔傳送至更新指令。靜音設定檔應該與用於 Instal Edge 4.16.01 時所用的設定檔相同。

在具備外部網際網路連線的節點上更新 4.16.01 的程序

請使用以下程序更新節點上的 Edge 元件:

  1. 如有的話,請停用所有設定在 Cassandra 上執行修復作業的 CRON 工作,直到更新完成為止。
  2. 以根層級登入節點即可安裝 Edge RPM
    注意:雖然 RPM 安裝作業需要 Root 存取權,但您可以在沒有 Root 存取權的情況下執行 Edge 設定。
  3. 按照 Apigee Edge 4.16.01 安裝指南所述,停用 SELinux。詳情請參閱 Apigee FTP 網站:ftp://ftp.apigee.com/
  4. 清除所有 Yum 快取:
    > sudo yum clean all
  5. 將最新的 Edge bootstrap.sh 檔案下載至 /tmp/bootstrap.sh:
    > curl https://software.apigee.com/bootstrap.sh -o /tmp/bootstrap.sh
  6. 更新 Edge apigee-service 公用程式和依附元件:
    > sudo bash /tmp/bootstrap.sh apigeeuser=uName apigeepassword=pWord

    其中 uName:pWord 是從 Apigee 取得的使用者名稱和密碼。如果省略 pWord,系統會提示您輸入。
  7. 使用 apigee-service 更新 apigee-setup 公用程式:
    > /opt/apigee/apigee-service/bin/apigee-service apigee-setup update
    更新版 apigee-service 會安裝 <inst_dir>/apigee/apigee-setup/bin 中的 update.sh 公用程式。
  8. 按照以下「機器更新順序」所述順序,在節點上執行更新公用程式:
    > /opt/apigee/apigee-setup/bin/update.sh -c 元件 -f configFile
    設定檔的唯一規定是,設定檔必須可供「apigee」使用者存取或讀取。例如,將檔案放在節點上的 /tmp 目錄中。
    使用「-c」選項指定要更新的元件。可能的元件清單包括:
    • ldap = OpenLDAP
    • cs = Cassandr
    • zk = Zookeeper
    • qpid = qpidd
    • ps = postgresql
    • edge =所有 Edge 元件,邊緣 UI 除外:管理伺服器、訊息處理器、路由器、QPID 伺服器、Postgres 伺服器
    • ui = Edge UI
    • all = 更新機器上的所有元件 (僅用於 Edge aio 安裝設定檔或 API BaaS 式安裝設定檔)
    • e = ElasticSearch
    • b = API BaaS 堆疊
    • p = API BaaS 入口網站
    • ebp = ElasticSearch、API BaaS 堆疊和 API BaaS 入口網站位於同一個節點
  9. 按照 Apigee Edge 4.16.01 安裝指南中的 Apigee Edge 4.16.01 安裝指南所述,在 Apigee FTP 網站中執行 apigee-validate 公用程式,藉此測試更新:ftp://ftp.apigee.com/

從本機存放區更新 4.16.01 的程序

如果 Edge 節點受到防火牆保護,或以其他方式禁止透過網際網路存取 Apigee 存放區,您可以從 Apigee 存放區的本機存放區或鏡像執行更新。

建立本機 Edge 存放區後,您可以透過兩種方式從本機存放區更新 Edge:

  • 建立存放區的 .tar 檔案,將 .tar 檔案複製到節點,然後從 .tar 檔案更新 Edge。
  • 在含有本機存放區的節點中安裝網路伺服器,方便其他節點存取。 Apigee 提供 Nginx 網路伺服器供您使用,或者您也可以使用自己的網路伺服器。

如要從本機 4.16.01 存放區更新,請按照下列步驟操作:

  1. 確保有本機 4.16.01 存放區,如 Apigee Edge 4.16.01 安裝指南所述。您可以前往 Apigee FTP 網站:ftp://ftp.apigee.com/
  2. 更新本機存放區:
    1. 將最新的 Edge bootstrap.sh 檔案下載至 /tmp/bootstrap.sh
      > curl https://software.apigee.com/bootstrap.sh -o /tmp/bootstrap.sh
    2. 執行同步處理作業:
      > /opt/apigee/apigee-service/bin/apigee-service apigee-platform sync --only-new-rpms
  3. 如要從 .tar 檔案安裝 apigee-service:
    1. 在本機存放區的節點上,使用下列指令將本機存放區封裝至名為 /opt/apigee/data/apigee-mirror/apigee-4.16.01.tar.gz 中的單一.tar 檔案:
      /opt/apigee/data/apigee-mirror/apigee-4.16.01.tar.gz
    2. 將 .tar 檔案複製到您要更新 Edge 的節點。例如,將其複製到新節點上的 /tmp 目錄。
    3. 在新節點上,解壓縮檔案至 /tmp 目錄:
      > tar -xzf apigee-4.16.01.tar.gz
      這個指令會在包含 .tar 檔案的目錄中建立名為「repos」的新目錄。例如 /tmp/repos。
    4. 以根層級登入節點即可安裝 Edge RPM
      注意:雖然 RPM 安裝作業需要 Root 存取權,但您可以在沒有 Root 存取權的情況下執行 Edge 設定。
    5. 按照 Apigee Edge 4.16.01 安裝指南所述,停用 SELinux。詳情請參閱 Apigee FTP 網站:ftp://ftp.apigee.com/
    6. 從 /tmp/repos 安裝 Edge apigee-service 公用程式和依附元件:
      > sudo bash /tmp/repos/bootstrap.sh apigeeprotocol="file://" apigeerepobasepath=/tmp/repos
      請注意,你在這個指令中會包含存放區目錄的路徑。
  4. 如要使用 Nginx 網路伺服器安裝 apigee-service:
    1. 依 Apigee FTP 網站 (ftp://ftp.apigee.com/) 的「使用 Nginx 網路伺服器從存放區安裝」所述,設定 Nginx 網路伺服器。
    2. 在遠端節點上,將 Edge Bootstrap.sh 檔案下載至 /tmp/bootstrap.sh:
      > /usr/bin/curl http://uName:pWord@remoteRepo:3939/bootstrap.sh -o /tmp/bootstrap.sh
                

      where 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.

    3. 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.
    4. Disable SELinux as described in the Apigee Edge 4.16.01 Installation Guide, available on the Apigee FTP site: ftp://ftp.apigee.com/
    5. 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.
  5. If present, disable any CRON jobs configured to perform a repair operation on Cassandra until after the update completes.
  6. 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.
  7. 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
  8. 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

  1. Update machine 1:
    > /opt/apigee/apigee-setup/bin/update.sh -c all -f configFile
  2. 刪除 /opt/nginx/conf.d 中的所有檔案:
    > rm -f /opt/nginx/conf.d/*
  3. 重新啟動 Edge 路由器:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service Edge-router restart

適用於 2 主機的獨立安裝作業

請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南,以便查看邊緣拓撲和節點編號的清單:ftp://ftp.apigee.com/

  1. 在機器 1 上更新 Cassandra 和 ZooKeeper:
    > /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
  2. 在機器 2 上更新 qpidd 和 postgresql:
    > /opt/apigee/apigee-setup/bin/update.sh -c qpid,ps -f configFile
  3. 更新機器 1 上的 LDAP:
    > /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
  4. 更新機器 2 和機器 1 上的 Edge 元件:
    > /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
  5. 在節點 1 上:
    1. 刪除 /opt/nginx/conf.d 中的任何檔案:
      > rm -f /opt/nginx/conf.d/*
    2. 重新啟動 Edge Router:
      > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
  6. 更新機器 1 上的 UI:
    > /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile

5 主機叢集安裝作業

如需 Edge 拓撲和節點編號清單,請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南ftp://ftp.apigee.com/

  1. 在機器 1、2 和 3 上更新 Cassandra 和 ZooKeeper:
    > /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
  2. 在機器 4 和 5 上更新 qpidd 和 postgresql:
    > /opt/apigee/apigee-setup/bin/update.sh -c qpid,ps -f configFile
  3. 更新機器 1 上的 LDAP:
    > /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
  4. 更新機器 4、5、1、2、3 上的 Edge 元件:
    > /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
  5. 在節點 2 和 3 上:
    1. 刪除 /opt/nginx/conf.d 中的任何檔案:
      > rm -f /opt/nginx/conf.d/*
    2. 重新啟動 Edge Router:
      > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
  6. 更新機器 1 上的 UI:
    > /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile

9 主機叢集安裝作業

請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南,以便查看邊緣拓撲和節點編號的清單:ftp://ftp.apigee.com/

  1. 在機器 1、2 和 3 上更新 Cassandra 和 ZooKeeper:
    > /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
  2. 在機器 6 和機器 7 上更新 qpidd:
    > /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile
  3. 在機器 8 和機器 9 上更新 postgresql:
    > /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile
  4. 更新機器 1 上的 LDAP:
    > /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
  5. 依序更新機器 6、7、8、9、1、4 和 5 上的 Edge 元件:
    > /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
  6. 在節點 4 和 5 上:
    1. 刪除 /opt/nginx/conf.d 中的任何檔案:
      > rm -f /opt/nginx/conf.d/*
    2. 重新啟動 Edge Router:
      > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
  7. 更新機器 1 上的 UI:
    > /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile

13 主機叢集安裝作業

請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南,以便查看邊緣拓撲和節點編號的清單:ftp://ftp.apigee.com/

  1. 在機器 1、2 和 3 上更新 Cassandra 和 ZooKeeper:
    > /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
  2. 在機器 12 和 13 上更新 qpidd:
    >
        /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile
  3. 在機器 8 和機器 9 上更新 postgresql:
    >
        /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile
  4. 更新機器 4 和機器 5 上的 LDAP:
    > /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
  5. 依序更新機器 12、13、8、9、6、7、10 和 11 上的 Edge 元件:
    > /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
  6. 在節點 10 和 11 上:
    1. 刪除 /opt/nginx/conf.d 中的任何檔案:
      > rm -f /opt/nginx/conf.d/*
    2. 重新啟動 Edge Router:
      > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
  7. 更新機器 6 和機器 7 上的 UI:
    > /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile

12 主機叢集安裝作業

請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南,以便查看邊緣拓撲和節點編號的清單:ftp://ftp.apigee.com/

  1. 更新 Cassandra 和 ZooKeeper:
    1. 在資料中心 1 的機器 1、2 和 3 中:
      > /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
    2. 位於資料中心 2 的機器 7、8 和 9
      > /opt/apigee/apigee-setup/bin/update.sh -c cs,zk -f configFile
  2. 更新 qpidd 的值:
    1. 機器 4,5 在資料中心 1
      > /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile
    2. 資料中心 2 中的機器 10、11
      > /opt/apigee/apigee-setup/bin/update.sh -c qpid -f configFile
  3. 更新 postgresql:
    1. 資料中心 6 中的機器 1
      > /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile
    2. 資料中心 2 中的機器 12
      > /opt/apigee/apigee-setup/bin/update.sh -c ps -f configFile
  4. 更新 LDAP:
    1. 資料中心 1 中的機器 1
      > /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
    2. 資料中心 2 中的機器 7
      > /opt/apigee/apigee-setup/bin/update.sh -c ldap -f configFile
  5. 更新 Edge 元件:
    1. 資料中心 4、5、6、1、2、3 中的機器 1
      > /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
    2. 資料中心 2 中的機器 10、11、12、7、8、9
      > /opt/apigee/apigee-setup/bin/update.sh -c edge -f configFile
    3. 在節點 2、3、8 和 9 上:
      1. 刪除 /opt/nginx/conf.d 中的任何檔案:
        > rm -f /opt/nginx/conf.d/*
      2. 重新啟動 Edge Router:
        > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
  6. 更新 UI:
    1. 資料中心 1 的機器 1
      > /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile
    2. 資料中心 2 中的機器 7
      > /opt/apigee/apigee-setup/bin/update.sh -c ui -f configFile

適用於 7 主機 API BaaS 安裝作業

請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南,以便查看邊緣拓撲和節點編號的清單:ftp://ftp.apigee.com/

  1. 在機器 5、6 和 7 上更新 Cassandra:
    > /opt/apigee/apigee-setup/bin/update.sh -c cs -f configFile
  2. 在機器 1、2 和 3 上更新 ElasticSearch 和 API BaaS 堆疊:
    > /opt/apigee/apigee-setup/bin/update.sh -c e,b -f configFile
  3. 在機器 4 上更新 API BaaS 入口網站:
    > /opt/apigee/apigee-setup/bin/update.sh -c p -f configFile

為 10 個主機 API BaaS 安裝

請參閱 Apigee FTP 網站提供的 Apigee Edge 4.16.01 安裝指南,以便查看邊緣拓撲和節點編號的清單:ftp://ftp.apigee.com/

  1. 在機器 8、9 和 10 上更新 Cassandra:
    > /opt/apigee/apigee-setup/bin/update.sh -c cs -f configFile
  2. 在機器 1、2 和 3 上更新 ElasticSearch:
    > /opt/apigee/apigee-setup/bin/update.sh -c e -f configFile
  3. 在機器 4、5 和 6 上更新 API BaaS 堆疊:
    > /opt/apigee/apigee-setup/bin/update.sh -c b -f configFile
  4. 在機器 7 上更新 API BaaS 入口網站:
    > /opt/apigee/apigee-setup/bin/update.sh -c p -f configFile

非標準安裝

如果不是標準安裝,請按照下列順序更新 Edge 元件:

  1. ZooKeeper
  2. Cassandra
  3. 克皮德
  4. postgresql
  5. LDAP
  6. 邊緣,代表按照順序中所有節點的「-c 邊緣」設定檔:Qpid、Postgres、管理伺服器、訊息處理器、路由器。
  7. 在所有路由器節點上:
    1. 刪除 /opt/nginx/conf.d 中的任何檔案:
      > rm -f /opt/nginx/conf.d/*
    2. 重新啟動 Edge Router:
      > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restart
  8. UI