Hello Stack overflow community!
I need some help in figuring out the proper way to establish connections with the help of express cassandra orm model in nodejs for my multi dc (total dc =2 ) cassandra setup.
We are currently using only 1 dc with express cassandra and so for the same we just give 2 seed node ip addresses in as contact points for express cassandra as shown below
models.setDirectory(__dirname + '/models').bind(
{
clientOptions: {
contactPoints: cassandraContactPoints,
protocolOptions: { port: 9042 },
keyspace: 'keyspace_name',
queryOptions: { consistency: models.consistencies.one }
},
ormOptions: {
defaultReplicationStrategy: {
class: 'NetworkTopologyStrategy',
replication_factor: 2,
},
createKeyspace: false,
dropTableOnSchemaChange: false
}
},
function (err) {
if (err) {
throw err;
} else {
console.log('connection established');
postDBConnection(models, 'keyspace name again');
}
}
Thing to note here is that we specify cassandraContactPoints as an array of just 2 nodes of our existing dc.
Since we are moving forward with a separate DC for analytical purposes, I would like to know if we should be giving the ip addresses of the new DC in the same array i.e. cassandraContactPoints ? We plan to use LOCAL_QUORAM and want our analytical apps to use only the analytical dc for all reads and writes.
I have tried reading the source for express cassandra and 'cassandra driver' modules but I am unable to figure out the solution>
Any help here would be extremely appreciated!