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?
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?
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
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;
I think you can create cqlshrc file in ~/.cassandra and set client_timeout option in seconds.
~/.cassandra/cqlshrc
[connection]
client_timeout = 30