Cassandra optimization of query optimization timeout

After the pre-holiday migrate oracle data to cassandra, the total number (more than ten million) record lookup table, there will always report a timeout error to find the next relevant information, we need to change the configuration file of the relevant parameters timeout.

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

Encounter this error, simply increase the value of the following parameters:

[root@db03 ~]# 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
[root@db03 ~]# systemctl restart cassandra

After editing, cassandra restart the service. Query again, the results as shown below:
Cassandra optimization of query optimization timeout

2、Client request timeout

The default client request time is 10 seconds, if you encounter this error, the need to increase the client request timeout. as follows:

[root@db03 ~]# vi .cassandra/cqlshrc 
...
[connection]
request_timeout = 600
....

Subsequent encounter similar error will continue to update this blog.

Guess you like

Origin blog.51cto.com/candon123/2440776