排解邊緣路由器問題

Edge for Private Cloud 4.17.05 版

Edge 路由器是使用 Nginx 路由器實作。在 Edge 升級程序中,或變更路由器設定時,您可能會看到 Nginx 設定錯誤。發生這些錯誤時,Edge 會將導致問題的 Nginx 設定檔寫入 /opt/nginx/conf.d。接著,您可以使用 Nginx configtest 工具判斷錯誤原因。

舉例來說,您檢查 /opt/nginx/conf.d,並看到下列檔案:

-rw-r--r-- 1 apigee apigee 522 Jul 20 08:41 0-default.conf.bad 
-rw-r--r-- 1 apigee apigee 577 Jul 20 08:42 0-fallback.conf 
-rw-r--r-- 1 apigee apigee 1062 Jul 20 08:18 0-map.conf 
-rw-r--r-- 1 apigee apigee 1887 Jul 20 08:42 custorg_test_default.conf.bad

請注意,有幾個檔案的後置字串為 .bad。

這類錯誤通常是因為您對 /opt/apigee/customer/application/router.properties 檔案或虛擬主機進行了不正確的變更。例如,您新增了以下內容:

conf_load_balancing_load.balancing.driver.proxy.busy.buffer.size=32k 

不允許這個值。

如何修正這類錯誤:

  1. 從 /opt/nginx/conf.d 資料夾中的檔案名稱移除 .bad 後置字串,讓檔案名稱以 .conf 結尾。
  2. 執行 Nginx configtest 工具,顯示失敗原因:
    > /opt/nginx/scripts/apigee-nginx configtest

    您會看到以下形式的輸出內容:
    nginx: [emerg] "proxy_busy_buffers_size" must be equal to or greater than the maximum of the value of "proxy_buffer_size" and one of the "proxy_buffers" in /opt/nginx/conf/nginx.conf:47
  3. 編輯 /opt/apigee/customer/application/router.properties,將 conf_load_balancing_load.balancing.driver.proxy.busy.buffer.size 設為 128k。
  4. 移除 /opt/nginx/conf.d 資料夾:
    > rm -rf /opt/nginx/conf.d
  5. 重新啟動路由器:
    > /opt/apigee/apigee-service/bin/apigee-servce edge-router restart
  6. /opt/nginx/conf.d 資料夾中應該不會再出現錯誤的設定檔。