Reputation: 325
when there is too many rows in cassandra table and I run following query in cqlsh:
select count(*) from tableA
i get this error:
OperationTimedOut: errors={}, last_host=127.0.0.1
how can i resolve this error?
Upvotes: 1
Views: 6714
Reputation: 71
For Cassandra 2.0.15+, 2.1.5+, use request_timeout option.
Edit ~/.cassandra/cqlshrc
[connection]
request_timeout = 20
Refer to this: https://docs.datastax.com/en/cql/3.1/cql/cql_reference/cqlshrc.html#clqshrc__cql-option
Upvotes: 4
Reputation: 3330
chris link is perfect, i had the same problem for counting the total no of records. one way is to use high limit and keep reducing it till the timeout error is resolved.
select count(*) from usertable limit 1000000;
Upvotes: 0
Reputation: 497
I think you can create cqlshrc file in ~/.cassandra and set client_timeout option in seconds.
~/.cassandra/cqlshrc
[connection]
client_timeout = 30
Upvotes: -1