排解邊緣路由器問題

Private Cloud v. 4.17.09 版本

Edge Router 是使用 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. 移除 .bad 後置字串的 /opt/nginx/conf.d 個資料夾 因此結尾是 .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 到 12.8 萬。
  4. 已移除 /opt/nginx/conf.d 目錄:
    rm -rf /opt/nginx/conf.d
  5. 重新啟動路由器:
    /opt/apigee/apigee-service/bin/apigee-service edge-router restart
  6. /opt/nginx/conf.d」中不會再顯示錯誤的設定檔 資料夾。