ECONNREFUSED使用node.js连接到远程Cassandra数据库

时间:2016-05-06 20:56:32

标签: node.js express cassandra datastax datastax-startup

我正在使用express-cassandra版本0.5.4连接到我托管的aws cassandra db。我有权访问,但无论我改变什么,我都会获得ECONNREFUSED

以下是express-cassandra连接的片段,这是非常标准的文档。

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()); });

1 个答案:

答案 0 :(得分:2)

尝试这些设置

更改rpc_address:0.0.0.0 broadcast_rpc_address:1.2.3.4

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