RPC Timeout in Cassandra

2019-07-04 06:17发布

问题:

I get the following error:

cqlsh:dev> SELECT DISTINCT id FROM raw_data;
Request did not complete within rpc_timeout.

This is a special query that I'll never make again, I don't care how long it takes, and I don't want to change my schema (since I'll never make the query again...).

How can I increase rpc_timeout for this one query?

I have tried adding LIMIT 9999 and ALLOW FILTERING, and it doesn't help. I expect less than 1000 rows in the result. The query works on another Cassandra cluster with half as much data.

Edit: as it turns out, this particular command succeeded after I ran nodetool compact, but what I'm more interested in the general case of temporarily increasing rpc_timeout for one query.

回答1:

increase the read request time in cassandra.yaml file under /cassandra/conf

read_request_timeout_in_ms: 30000

change this restart server and execute your query, might be your problem get resolved.