客户端和服务器端的超时设置之间的差异

问题描述 投票:2回答:1

根据这个流程:Cassandra read_request_timeout_in_ms set up for external(Client) request,我知道在服务器端设置超时不仅仅是足够的,我们也需要在客户端设置。

在客户端和服务器端设置超时有什么区别?

示例:

          Setting the request time out in server side in Cassandra (cassandra.yaml)
                                 VS
          Setting the request time out in client side in Cassandra driver 

编辑:

driver read timeout: the driver did not receive any response from the current coordinator within SocketOptions.setReadTimeoutMillis. It invokes onRequestError on the retry policy with an OperationTimedOutException to decide what to do.
server read timeout: the driver did receive a response, but that response indicates that the coordinator timed out while waiting for other replicas. It invokes onReadTimeout on the retry policy to decide what to do.

有人可以清楚地解释两者之间的目的和区别。

谢谢, 掠夺

apache cassandra cassandra-3.0
1个回答
0
投票

在服务器端设置超时,即cassandra.yaml,与使用SocketOptions.setReadTimeoutMillis设置驱动程序(也称为客户端)超时不同。它们都是单独工作的。一个人不会超越对方。通常,您应将驱动程序超时设置为略大于服务器端超时。

  1. 如果Cassandra节点可以访问并且工作但是它无法在cassandra.yaml中提到的读取时间内响应,它将抛出异常并且驱动程序将获得相同的异常。如果已配置,驱动程序可能会重试。
  2. 如果Cassandra节点由于某种原因没有响应,则驱动程序无法无限期地等待。如果Cassandra没有响应,那就是当驱动程序超时启动并抛出异常时。
© www.soinside.com 2019 - 2024. All rights reserved.