從備份還原

您可以在備份該元件時,從您建立的檔案還原元件。如要這麼做,請使用 restore 指令。

請注意,restore 指令:

  • 如未指定檔案名稱,則會使用指定的備份檔案或取得最新的備份檔案。
  • 確保元件的資料目錄為空白。
  • 停止元件。還原後必須明確重新啟動元件。

本節說明如何使用 restore 指令。

如何從備份檔案還原元件:

  1. 確保下列目錄空白:
    /opt/apigee/data/component_name
    /opt/apigee/etc/component_name.d

    如果不是空白,請使用下列指令刪除其內容:

    rm -r /opt/apigee/data/component_name
    rm -r /opt/apigee/etc/component_name.d
  2. 使用下列指令還原先前的設定和資料:
    /opt/apigee/apigee-service/bin/apigee-service component_name restore backup_file

    在此情況下:

    • component_name 是元件的名稱。可能的值包括:
      • apigee-cassandra (Cassandra)
      • apigee-openldap (OpenLDAP)
      • apigee-postgresql (PostgreSQL 資料庫)
      • apigee-qpidd (魁北克)
      • apigee-sso (邊緣單一登入)
      • apigee-zookeeper (ZooKeeper)
      • edge-management-server (管理伺服器)
      • edge-management-ui (新版 Edge UI)
      • edge-message-processor (訊息處理器)
      • edge-postgres-server (Postgres 伺服器)
      • edge-qpid-server (快速伺服器)
      • edge-router (邊緣路由器)
      • edge-ui (傳統版 UI)
    • backup_file 是您在備份該元件時建立的檔案名稱。這個值不含路徑,但會包含「backup-」前置字串和副檔名。例如:backup-2019.03.17,14.40.41.tar.gz

    例如:

    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra restore backup-2019.03.17,14.40.41.tar.gz

    您可以選擇是否指定 backup_file。如果省略的話,Apigee 會使用 /opt/apigee/backup/component_name 中的最新檔案。

    restore 指令會重新套用備份的設定,並在備份產生時還原資料。

  3. 重新啟動元件,如以下範例所示:
    /opt/apigee/apigee-service/bin/apigee-service component_name start