cassandra - 客户端和服务器端超时设置的区别
问题描述
按照这个流程:Cassandra read_request_timeout_in_ms 为外部(客户端)请求设置,我知道在服务器端设置超时是不够的,我们还需要在客户端设置。
在客户端和服务器端设置超时有什么区别?
例子 :
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.
有人可以清楚地解释两者之间的目的和区别吗?
解决方案
在服务器端(即在 cassandra.yaml 中)设置超时与使用 SocketOptions.setReadTimeoutMillis 设置驱动程序(也称为客户端)超时不同。他们都单独工作。一个不会超越另一个。通常,您应该将驱动程序超时设置为略大于服务器端超时。
- 如果 Cassandra 节点可访问且正常工作,但它无法在 cassandra.yaml 中提到的读取时间内响应,它将引发异常,驱动程序将获得相同的异常。如果已配置,驱动程序可能会重试。
- 如果 Cassandra 节点由于某种原因没有响应,驱动程序不能无限期地等待。那是驱动程序超时启动并在 Cassandra 没有响应时引发异常的时候。
推荐阅读
- office365 - 有没有一种方法可以让我(作为管理员)将邮件强制发送到 Outlook 重点收件箱而不是其他?
- c - 如何初始化包含另一个结构的结构?
- python - 如何在python中使用for循环从用户那里获取多个输入?
- python - 如何清空单独列表中列表列表中的所有项目
- r - 使用 R 从 powerpoint 中删除图形、图像和数据帧
- php - LARAVEL "mkdir(): 没有这样的文件或目录" 发送邮件
- python - 从文本文件中提取片段
- react-transition-group - TransitionGroup 需要 486 秒来移除 500 个组件
- python - numpy - einsum vs naive implementation 运行时执行
- asp.net-mvc - 如何重定向到带有哈希参数的 url 的 ASP.net MVC 操作