如何設定邊緣

Private Cloud v4.18.01 專用 Edge

如要在安裝後設定 Edge,請使用 .properties 檔案和 Edge 公用程式的組合。適用對象 舉例來說,如要在 Edge UI 上設定 TLS/SSL,請編輯 .properties 檔案, 資源。如要變更 .properties 檔案,您必須重新啟動 受影響的 Edge 元件

Apigee 是編輯 .properties 檔案的技術,稱為 config。基本上,包含設定的程式碼是一種鍵/值查詢工具,以 .properties 檔案。使用以下程式碼加入程式碼: 設定,金鑰稱為「符記」。因此如要設定 Edge .properties 檔案。

含有設定的程式碼可讓 Edge 元件設定與 產品,讓安裝團隊根據安裝拓撲覆寫這些設定 並讓客戶覆寫他們選擇的任何房源

如果您將報表視為階層結構,請依照客戶的設定方式排列設定 將設定覆寫安裝團隊的所有設定 Apigee:

  1. 客戶
  2. 安裝程式
  3. Apigee

如何使用 .properties 檔案

客戶只能修改 .properties /opt/apigee/customer/application 目錄。每個元件在目錄中都有專屬的 .properties 檔案。 例如 router.propertiesmanagement-server.properties

舉例來說,如要建立 .properties 檔案:

  1. 以任何使用者身分在編輯器中建立檔案。
  2. 擁有該檔案的擁有者為 apigee:apigee,或是因為您變更過使用者 透過 apigee 使用者執行 Edge 服務,並將檔案放在 正在執行 Edge 服務

如要設定元件的屬性,請編輯對應的 .properties 檔案,即可設定符記。 然後重新啟動元件:

> /opt/apigee/apigee-service/bin/apigee-service component restart

例如,在編輯 router.properties 後,重新啟動路由器:

> /opt/apigee/apigee-service/bin/apigee-service edge-router restart

升級 Edge 時,命名空間中的 .properties 檔案, /opt/apigee/customer/application 已讀取到目錄也就是說,升級作業會保留您在 元件。

.properties 檔案的位置

Edge 的 .properties 檔案有三個頂層目錄 元件:安裝擁有者和客戶預設位置如下所示 資料表:

警告:Edge 客戶只能修改位於以下位置的 .properties 檔案: /opt/apigee/customer.當您時 可以在元件和安裝目錄下檢視檔案,而非修改任何檔案。

擁有者

預設權杖根目錄

元件

/opt/apigee/<prefix>-<component>/conf

在哪? /<prefix>-<component> 可識別元件,例如 Edge-router 或 apigee-cassandra

安裝

/opt/apigee/token

客戶

/opt/apigee/customer

判斷符記目前的值

在元件的 .properties 檔案中設定符記之前, 您可以先使用以下指令判斷目前的值:

> /opt/apigee/apigee-service/bin/apigee-service comp configure -search token

其中 comp 是元件名稱,而 token 是要檢查的權杖。

這個指令會搜尋 .properties 檔案階層來判斷 憑證目前的值

舉例來說,如要檢查 conf_http_HTTPRequest.line.limit 權杖目前的值,您可以 路由器:

> /opt/apigee/apigee-service/bin/apigee-service edge-router configure -search conf_http_HTTPRequest.line.limit

輸出內容應如下所示:

Found key conf_http_HTTPRequest.line.limit, with value, 4k, in /opt/apigee/edge-router/token/default.properties

在 .properties 檔案中設定權杖

如要覆寫權杖的值:

  1. 編輯 .properties 檔案: 設定符記值如果檔案不存在,則建立該檔案。
  2. 重新啟動元件。
  3. 請檢查權杖值。

舉例來說,如要設定 Edge Router 的要求行限制:

  1. 編輯 /opt/apigee/customer/application/router.properties 檔案來設定 conf_http_HTTPRequest.line.limit 符記:

    conf_http_HTTPRequest.line.limit=8k
  2. 重新啟動邊緣路由器:

    > /opt/apigee/apigee-service/bin/apigee-service Edge-router 重新啟動
  3. 檢查權杖的值:

    > /opt/apigee/apigee-service/bin/apigee-service Edge-router Configuration -search conf_http_HTTPRequest.line.limit

設定可使用多個值的符記

部分符記會取得以半形逗號分隔的值清單。例如 conf_security_rbac.restricted.resources 權杖 會使用受限制的 URI 清單,如此只有 sysadmin 才能呼叫這些 URI。為了瞭解 conf_security_rbac.restricted.resources 值:

> cd /opt/apigee/edge-management-server
> grep -ri "conf_security_rbac.restricted.resources" *

輸出結果會包含以下內容:

token/default.properties:conf_security_rbac.restricted.resources=/environments,/environments/*,/environments/*/virtualhosts,/environments/*/virtualhosts/*,/pods,/environments/*/servers,/rebuildindex,/users/*/status

若要設定會使用值清單的符記,請將任何新值附加至 .properties 檔案中的符記。 因此,如要將 URI /myuri/* 新增至 conf_security_rbac.restricted.resources, 編輯 /opt/apigee/customer/application/management-server.properties 檔案,如下所示:

conf_security_rbac.restricted.resources=/environments,/environments/*,/environments/*/virtualhosts,/environments/*/virtualhosts/*,/pods,/environments/*/servers,/rebuildindex,/users/*/status,/myuri/*

找出權杖

在大部分的情況下,本指南會指出需要設定的符記。不過,如果您需要 如要判斷用於覆寫屬性的符記,請在元件的 source 資料夾中執行 grep

舉例來說,如果您知道在先前的 Edge 版本中已設定 session.maxAge 屬性,但想知道 用來設定的憑證值,然後為 /opt/apigee/edge-ui/source 目錄中的屬性 grep

> grep -ri "session.maxAge" /opt/apigee/edge-ui/source

您應該會看到以下格式的結果:

/opt/apigee/edge-ui/source/conf/application.conf:session.maxAge={T}conf_application_session.maxage{/T}

{T}{/T} 標記之間的字串是指您在 .properties 檔案。

設定目前已加註的憑證 出局

有些權杖在 Edge 設定檔中已加上註解。如果您嘗試設定的符記 註解排除,系統會忽略這項設定。

如要設定註解排除的符記,請採用特殊語法,格式如下:

conf/file.extension+propertyName=propertyValue

例如,您想在「訊息」上設定名為 HTTPClient.proxy.host 的屬性。 處理器。接著,針對下列項目的 grep: 屬性來決定其符記:

> cd /opt/apigee/edge-message-processor
> grep -ri "HTTPClient.proxy.host" *

grep 指令會傳回 產生包含符記值的表單。請注意屬性名稱的註解方式 以 # 前置字串表示:

source/conf/http.properties:#HTTPClient.proxy.host={T}conf_http_HTTPClient.proxy.host{/T}
token/default.properties:conf_http_HTTPClient.proxy.host=
conf/http.properties:#HTTPClient.proxy.host=

如要設定屬性,請編輯 /opt/apigee/customer/application/message-processor.properties 將屬性設為:

conf/http.properties+HTTPClient.proxy.host=myhost.name.com

請注意屬性名稱的前置字串為 conf/http.properties+、位置和名稱 設定檔的「+」部分。

重新啟動訊息處理器後,請檢查檔案 /opt/apigee/edge-message-processor/conf/http.properties

> cat /opt/apigee/edge-message-processor/conf/http.properties

檔案結尾會顯示屬性集,格式如下:

conf/http.properties:HTTPClient.proxy.host=myhost.name.com