排查边缘路由器问题

Edge for Private Cloud v. 4.17.09

边缘路由器是使用 Nginx 路由器实现的。在边缘升级过程中或更改路由器配置时,您可能会看到 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-service edge-router restart
  6. 您应该不会再在 /opt/nginx/conf.d 文件夹中看到不良配置文件。