您正在查看 Apigee Edge 文档。
转到
Apigee X 文档。 info
问题
通过 Edge 界面或 Management API 部署 API 代理修订版本失败,并显示超时 错误。
错误消息
Click to change deployment status. The revision is deployed and traffic can flow, but flow may be impaired. Error: Call timed out; either server is down or server is not reachable
可能的原因
导致此问题的典型原因如下:
| 原因 | 详细信息 | 数据范围: |
| 网络连接问题 | 由于网络 连接问题或防火墙规则,管理服务器和消息处理器之间的通信失败。 | 仅限私有云用户 |
| API 代理软件包过大 | 如果 API 代理软件包过大,消息处理器可能需要很长时间才能激活,从而导致 RPC 超时。 | 私有云和公有云用户 |
网络连接问题
注意 :只有 Edge 私有云用户才能执行以下步骤。如果您使用的是 Edge 公有云,请与 Apigee Edge 支持团队联系。
诊断
- 使用以下
Management API 调用获取显示错误的特定 API 的部署状态:
curl -v http://<management-server-IPaddress>:<port#>/organizations/<orgname>/environments/<envname>/apis/<apiname>/deployments -u <username>
显示错误的示例输出:
{ "error": "Call timed out; either server is down or server is not reachable", "status": "error", "type": [ "message-processor" ], "uUID": "ebbc1078-cbde-4a00-a7db-66a3c1b2b748" }, { "status": "deployed", "type": [ "message-processor" ], "uUID": "204e2b7e-52f7-46d9-b458-20f9bfb51e6d" }, { "status": "deployed", "type": [ "router" ], "uUID": "967e63c6-ee95-47c0-9608-f4a32638fb1e" }, { "status": "deployed", "type": [ "router" ], "state" : "error" }
上面的示例输出显示,错误发生在 UUID 为“
ebbc1078-cbde-4a00-a7db-66a3c1b2b748”的消息处理器 之一上。 - 根据 API 代理的部署状态输出,使用显示错误的相应 UUID 登录到每个消息处理器,然后执行以下步骤:
- 检查消息处理器是否在端口 4528 上进行监听:
netstat -an | grep LISTEN | grep 4528
如果消息处理器未在端口 4528 上进行监听,请重新启动消息 处理器:
/opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
- 使用上述第 1 步中显示的 Management API 调用,重新检查 API 代理的部署状态。如果没有错误,则表示问题已解决。
- 检查消息处理器是否在端口 4528 上进行监听:
- 如果问题仍然存在,请使用以下步骤测试从管理服务器到端口 4528 上的消息
处理器连接:
- 如果 telnet 可用,请使用 telnet:
telnet <MessageProcessor_IP> 4528
- 如果 telnet 不可用,请使用 netcat 检查连接,如下所示:
nc -vz <MessageProcessor_IP> 4528
- 如果您收到“Connection Refused”(连接被拒绝)或“Connection timed out”(连接超时)响应,请与您的网络运营团队联系。
- 如果 telnet 可用,请使用 telnet:
- 使用以下步骤测试从消息处理器到端口 4526 上的管理服务器的连接:
- 如果 telnet 可用,请使用 telnet:
telnet <management-server-IP> 4526
- 如果 telnet 不可用,请使用 netcat 检查连接,如下所示:
nc -vz <management-server-IP> 4526
- 如果您收到“Connection Refused”(连接被拒绝)或“Connection timed out”(连接超时)响应,请与您的 网络运营团队联系。
- 如果 telnet 可用,请使用 telnet:
- 与您的网络运营团队合作,并执行以下操作:
- 确保在管理服务器和消息 处理器上都允许使用 RPC 协议。
- 移除管理服务器 和消息处理器之间设置的所有防火墙限制或安全规则,以允许连接到管理服务器上的端口 4526,以及从管理服务器到消息处理器上的端口 4528 的连接。
- 重新检查部署状态(请参阅上面的第 1 步)。如果您没有看到任何错误,则 表示错误已解决。
- 如果问题仍然存在,请检查消息处理器上是否存在网络问题。如果存在网络问题,重新启动显示超时错误的特定消息处理器(根据部署状态输出)可能会解决该问题:
/opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
- 如果问题仍然存在,请检查管理服务器日志,路径为:
(
/opt/apigee/var/log/edge-management-server/logs/system.log)。管理服务器日志中的示例调用超时错误
2016-05-17 09:29:56,448 org:myorg env:prod qtp281969267-360792 ERROR DISTRIBUTION - RemoteServicesConfigEventHandler.configureServers() : exception for server with uuid e1381db7-d83b-4752-ae04-2de33f07e555 : cause = RPC Error 504: Call timed out communication error = true com.apigee.rpc.RPCException: Call timed out at com.apigee.rpc.impl.AbstractCallerImpl.handleTimeout(AbstractCallerImpl.java:64) ~[rpc-1.0.0.jar:na] at com.apigee.rpc.impl.RPCMachineImpl$OutgoingCall.handleTimeout(RPCMachineImpl.java:483) ~[rpc-1.0.0.jar:na] at com.apigee.rpc.impl.RPCMachineImpl$OutgoingCall.access$000(RPCMachineImpl.java:402) ~[rpc-1.0.0.jar:na] at com.apigee.rpc.impl.RPCMachineImpl$OutgoingCall$1.run(RPCMachineImpl.java:437) ~[rpc-1.0.0.jar:na] at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:532) ~[netty-all-4.0.0.CR1.jar:na] at io.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:430) ~[netty-all-4.0.0.CR1.jar:na] at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:371) ~[netty-all-4.0.0.CR1.jar:na] at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_79]
如果您观察到与上例中所示类似的错误,请增加管理服务器上的 RPC 超时,以便在出现任何网络速度减慢的情况下,管理服务器有时间连接到消息处理器。
分辨率
注意 :只有 Edge 私有云用户才能执行以下步骤。如果您使用的是 Edge 公有云,请与 Apigee Edge 支持团队联系。
- 请执行以下步骤来增加 RPC 超时:
- 在管理服务器机器上创建文件
/opt/apigee/customer/application/management-server.properties(如果该文件尚不存在)。 - 将以下行添加到此文件中:
conf_cluster_rpc.connect.timeout=<time in seconds>
默认 RPC 超时值为 10,建议将其增加到 40 秒。设置方式如下:
conf_cluster_rpc.connect.timeout=40
- 确保此文件的所有者为 apigee:
chown apigee:apigee /opt/apigee/customer/application/management-server.properties
- 重新启动管理服务器:
/opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
- 如果您有多个管理服务器,请在所有 管理服务器上重复上述步骤。
- 在 Edge 界面中或使用 Edge Management API 调用部署 API 代理。如果 API 代理部署时没有任何问题,则表示问题已解决。
- 在管理服务器机器上创建文件
- 如果问题仍然存在,请从管理服务器和消息处理器收集
tcpdump 命令。在每个服务器上启用 tcpdump
命令,然后从界面
或使用 Management API 启动 API 代理的部署:
- 从管理服务器运行以下 tcpdump 命令:
tcpdump -i any -s 0 host <message-processor-IP address> -w <File name>
- 从消息处理器运行以下 tcpdump 命令:
tcpdump -i any -s 0 host <management-server-IP address> -w <File name>
- 与 Apigee Edge 支持团队联系,以获取有关 分析 tcpdump 和进一步排查问题的帮助。
- 从管理服务器运行以下 tcpdump 命令:
API 代理软件包过大
诊断
- 检查出现部署错误的 API 代理软件包的大小。
- 如果大小相当大(10MB 或更大),则消息 处理器很可能需要更多时间来激活 API 代理。
- 如果 API 代理软件包大小超过 15 MB,请前往 API 代理软件包大于 15MB。
分辨率
注意 :只有 Edge 私有云用户才能执行以下步骤。如果您使用的是 Edge 公有云,请与 Apigee Edge 支持团队联系。
增加管理服务器上的 RPC 超时,以便消息处理器有足够的时间来 激活大型 API 代理软件包。请执行以下步骤来增加 RPC 超时 值:
- 在管理服务器机器上创建
/opt/apigee/customer/application/management-server.properties文件 (如果该文件尚不存在)。 - 将以下行添加到此文件中:
conf_cluster_rpc.connect.timeout=<time in seconds>
默认 RPC 超时值为 10,建议将其增加到 40 秒。 设置方式如下:
conf_cluster_rpc.connect.timeout=40
- 确保此文件的所有者为 apigee:
chown apigee:apigee /opt/apigee/customer/application/management-server.properties
- 重新启动管理服务器:
/opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
- 如果您有多个管理服务器,请在所有管理 服务器上重复上述步骤。
如果问题仍然存在,请与 Apigee Edge 支持团队 联系以获取 进一步的帮助。