debian sibilancias / cassandra / nodejs

i try to use node-cassandra-cql to communicate with cassandra(1.1.12) but when i try a simple connexion :

node connect.js

connect.js source :

  var cql = require('node-cassandra-cql');

var client = new cql.Client({hosts: ['localhost'], keyspace: 'LIBRE'});

client.execute('SELECT * FROM Persons', [],

  function(err, result) {

if (err) {
    console.log('execute failed', err);

} else {
    for (var i = 0; i < result.rows.length; i++) {
        //console.log('id=' + result.rows[i].get('id') + ' test_value=' + result.rows[i].get('test_value'));
    console.log(result.rows[i].get('Name'));    
    }

    process.exit(0);
    }

  }
);

it return an error :

execute failed { [PoolConnectionError] name: 'PoolConnectionError', info: 'Represents a error while trying to connect the pool, all the connections failed.', individualErrors: [ { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } ], stack: 'undefined\n (event loop)\n at Client.execute (/var/www/clients/client1/web1/web/node_modules/node-cassandra-cql/index.js:189:9)\n at Object. (/var/www/clients/client1/web1/web/connect.js:6:8)\n at Module._compile (module.js:456:26)\n at Object.Module._extensions..js (module.js:474:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Function.Module.runMain (module.js:497:10)\n at startup (node.js:119:16)\n at node.js:906:3', query: 'SELECT * FROM Persons' }

i try to specify a port (9160) but it's the same issue.

gracias por tu ayuda

Simon

preguntado el 28 de mayo de 14 a las 13:05

1 Respuestas

Como se indica en el descripción, node-cassandra-cql (and the rest of drivers that use the Cassandra binary protocol) only works with Cassandra 1.2 or above.

contestado el 28 de mayo de 14 a las 16:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.