Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra DataStax Driver NoHostAvailableException during large batch insert

I have a single node instance of Cassandra. I have been using batch statements to insert a lot of data into it using the datastax driver in Java.

After a certain point during the insert I am presented with a NoHostAvailableException, however I can still connect to the node through cql and execute statements. The Cassandra logs warned me that the batches were too large, when I lowered the size down to the recommended level I still get the same error and there appears to be no other errors in the Cassandra log file.

Has anyone encountered this error before, I feel like there is something in the cassandra.yaml that I am missing.

like image 214
scrineym Avatar asked Jan 09 '23 17:01

scrineym


1 Answers

I had very similar issues of those you have, and resolved it here: Cassandra cluster with bad insert performance and insert stability.

The bottom solution is that you are just overloading your node, and that batch inserts are, controversially, not faster than async inserts. Of course, you should limit your async inserts with some technique. Also, make sure your network can support your insert. I was connected to a low-powered switch and about half of my problems vanished when I changed the route towards I connect my server (which is a few rooms from me).

If it does not help, you should use multiple nodes, depending on your insert rate.

like image 165
Aleksandar Stojadinovic Avatar answered Jan 26 '23 23:01

Aleksandar Stojadinovic