java - Operation Time Out Error in cqlsh console of cassandra -
i have 3 nodes cassandra cluster , have created 1 table has more 2,000,000 rows.
when execute (select count(*) userdetails
) query in cqlsh, got error:
operationtimedout: errors={}, last_host=192.168.1.2
when run count function less row or limit 50,000 works fine.
count(*) pages through data. select count(*) userdetails
without limit expected timeout many rows. details here: http://planetcassandra.org/blog/counting-key-in-cassandra/
you may want consider maintaining count yourself, using spark, or if want ball park number can grab jmx.
to grab jmx can little tricky depending on data model. number of partitions grab org.apache.cassandra.metrics:type=columnfamily,keyspace={{keyspace}},scope={{table}},name=estimatedcolumncounthistogram
mbean , sum 90 values (this nodetool cfstats
outputs). give number exist in sstables make more accurate can flush or try estimate number in memtables memtablecolumnscount
mbean
Comments
Post a Comment