I am currently using Cassandra 3.11 having 3 node cluster & consistency of one, along with NodeJS express cassandra client 2.3.0. I am using the method saveAsync
for storing the model data. But I am getting an error : apollo.model.save.dberror
Error during save query on DB -> NoHostAvailableError: All host(s) tried for query failed. \
First host tried, <ip>:<port>: OperationTimedOutError: The host <ip>:<port> \
did not reply before timeout 12000 ms.
I am unable to verify what is causing this error. This happens for most of the records & only few of them are getting through. I am inserting this data reading from a kafka topic & pushing it to cassandra after few validations. The data rate is around 200 per second.
Tried googling & searching in stack-overflow but unable to get any details around it. Sample code.
SomeData.insert = function (data) {
data = transformData(data); // Basically cleans & normalizes the data to suit the model
let any_data = new ExpressCassandra.instance.data_store(data);
return any_data.saveAsync()
.catch(function(err){
return Promise.reject(err);
});
};