节前将oracle数据迁移到cassandra后,查询表的总记录数(千万级以上),总会报超时错误,找了下相关资料,需要更改配置文件里的相关超时参数。
1、ReadTimeout-1200
cqlsh:spacewalk> select count(*) from rhnpackagecapability;
ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes‘ responses] message="Operation timed out - received only 1 responses." info={‘received_responses‘: 1, ‘required_responses‘: 1, ‘consistency‘: ‘ONE‘}
cqlsh:spacewalk> exit
遇到此报错,只需增加以下几个参数的值:
[[email protected] ~]# vi /etc/cassandra/default.conf/cassandra.yaml
read_request_timeout_in_ms: 600000
range_request_timeout_in_ms: 600000
slow_query_log_timeout_in_ms: 600000
[[email protected] ~]# systemctl restart cassandra
修改完成后,重启cassandra服务。再次查询,结果如下图:
2、Client request timeout
系统默认的客户端请求时间是10秒,如果遇到此报错,需增加客户端请求超时。如下:
[[email protected] ~]# vi .cassandra/cqlshrc
...
[connection]
request_timeout = 600
....
后续遇到类似错误还会继续更新此博文。
原文地址:https://blog.51cto.com/candon123/2440776
时间: 2024-10-12 19:44:57