1

I am having problems with cassandra driver for nodejs - helenus. I crated function loop that insert records into table, and I am calling with ab tool. The problem is after 10-20 insert the driver throws error:

This is the coffee code:

helenus = require 'helenus'

pool = new helenus.ConnectionPool(
  hosts: ["mybalancer:9160"]
  keyspace: "stats"
  timeout: 90000
)

pool.on "error", (err) ->
    console.error err.name, err.message

pool.connect (err, keyspace) ->
    if err
      throw (err)
    else
      vals = [uuid.v4(), uuid.v4()]
      #insert_statement = "INSERT INTO test2 (id, name) values(%s, %s)"
      console.log(vals)
      pool.cql insert_statement, vals, (err, results) ->
        console.log err, results

And This is the error:

/home/udev/development/project/U/hubber/app/controllers/event_logger_cassandra.js:98
        throw err;
              ^
HelenusNoAvailableNodesException: Could Not Connect To Any Nodes
    at replyNotAvailable (/home/udev/development/project/U/hubber/node_modules/helenus/lib/pool.js:16:25)
    at onConnect (/home/udev/development/project/U/hubber/node_modules/helenus/lib/pool.js:98:9)
    at /home/udev/development/project/U/hubber/node_modules/helenus/lib/pool.js:120:7
    at null.<anonymous> (/home/udev/development/project/U/hubber/node_modules/helenus/lib/connection.js:199:5)
    at EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (/home/udev/development/project/U/hubber/node_modules/helenus/node_modules/helenus-thrift/lib/thrift/connection.js:56:10)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:830:16
    at process._tickCallback (node.js:415:13)

I have cassandra cluster of three nodes(large servers on amazon) behind load balancer. I have monitor on the servers and the nodes are always up and work fine.

What do I missing here?

Thanks.

Meir
  • 91
  • 2
  • 6

0 Answers0