reihaneh
reihaneh

Reputation: 325

cassandra count (*) query error OperationTimedOut: errors={}, last_host=127.0.0.1?

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

Answers (3)

user1598922
user1598922

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

Gomes
Gomes

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

grzesiekw
grzesiekw

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

Related Questions