node.jsexpresscassandradatastaxdatastax-startup

ECONNREFUSED connecting to remote Cassandra db with node.js


I'm using express-cassandra version 0.5.4 to connect to my hosted aws cassandra db. I am authorized to access, but no matter what I change I'm getting ECONNREFUSED

Here is the snippet for express-cassandra that's connecting, which is pretty standard right from the docs.

models.setDirectory(__dirname + '/../models').bind({ clientOptions: { contactPoints: [process.env.Cluster1Pub,process.env.Cluster2Pub,process.env.Cluster3Pub], protocolOptions: {port: 9042}, keyspace: process.env.keyspace }, ormOptions: { defaultReplicationStrategy : { class: 'NetworkTopologyStrategy', replication_factor: 3 }, dropTableOnSchemaChange: false, dontCreateKeyspace: true } },function(err) { if(err) console.log(err.message); else console.log(models.timeuuid()); });


Solution

  • Try these settings

    Change rpc_address: 0.0.0.0 broadcast_rpc_address: 1.2.3.4

    Reference: "All host(s) tried for query failed" Error