0

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);
    });
};
Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Karthik
  • 188
  • 2
  • 12
  • Could you post the error description for "apollo.model.save.dberror"? Without it it's difficult to guess what happened. – Masum Sep 03 '19 at 23:38
  • @Masum : The description is this: Error during save query on DB -> NoHostAvailableError: All host(s) tried for query failed. First host tried, :: OperationTimedOutError: The host : did not reply before timeout 12000 ms. The host seems all ok as we do not have any issues from the server side. Also when we check for a single message (item) to be inserted it works well. – Karthik Sep 04 '19 at 07:14
  • @Masum Any information that you have on this? – Karthik Sep 10 '19 at 12:54
  • have a look at this discussion: https://stackoverflow.com/questions/49156978/express-cassandra-operationtimedouterror-while-creating-tables – Masum Sep 10 '19 at 15:22
  • Thanks @Masum. I ll take a look & get back. – Karthik Sep 11 '19 at 14:53

1 Answers1

0

The Node.js driver returns NoHostAvailableError after it has tried all hosts and none of them were available.

The OperationTimedOutError means that driver attempted to contact a node but never got a reply. This is a different error to a read or write timeout which is a response returned by the coordinator node.

OperationTimedOutError indicates that the nodes are unresponsive, usually because they are overloaded. You will need to review the logs and if you're seeing lots of GC activity and/or lots of dropped mutations/reads/messages then the nodes cannot keep up with the load and you need to consider increasing the capacity of your cluster by adding more nodes. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23