skmahawar
skmahawar

Reputation: 311

Helenus isn't able to connect

I am developing an application in nodejs with cassandra driver using helenus. the version of helenus is 0.6.10.

This is app.js.

var helenus = require('helenus');

var pool = new helenus.ConnectionPool({
    hosts: ['localhost:9160'],
    keyspace: 'test_dev',
    user: '',
    password: ''
});
pool.connect(function(err, keyspace) {
    if (err) throw err;
    console.log('Listening on port 3000....');
});
pool.on('error', function(err) {
    if (err) throw err;
});

When we call pool.connect then it is throwing following error in the callback.

error name : "HelenusNoAvailableNodesException"

error message: "Could Not Connect To Any Nodes"

When i have gone through the troubleshooting the problem. I have found that onDescribe method in Connection.prototype.use method is being throwing an error which is "NotFoundException".

What i am doing wrong? Any help.

Upvotes: 3

Views: 275

Answers (1)

Russ Bradberry
Russ Bradberry

Reputation: 10865

First check your Cassandra version. If you are running Cassandra 1.2 or greater, you should really be using the Datastax NodeJS Driver. There really isn't any reason to be using Thrift in 1.2 or greater as the performance and features of CQL greatly outweigh Thrift. Also, while the Thrift server is still available for use, no development effort is given to it.

If you are absolutely sure you need to be using Thrift then first ensure the keyspace exists. Helenus requires a keyspace to connect to, so if the keyspace is not present it will not be able to connect to any nodes. If the keyspace exists then run:

nodetool statusthrift

if it says anything other than running then run nodetool enablethrift and try again.

If thrift is running then I would check the interface configured in your cassandra.yaml. The rpc_address should match the interface you are connecting to from the client. If you unsure of the interface then just set it to 0.0.0.0. The rpc_port should be 9160. After changing any settings in the cassandra.yaml you will need to restart the cassandra service on each of the nodes in the cluster.

Upvotes: 3

Related Questions