Node.js client 2.0.2 how connect to multiple hosts


We initialize the lib using the Cluster constructor which accepts a connection string. How can we pass multiple hosts? For example if you have hosts:

var hosts = [

is there a way to pass this to Cluster c’tor?



after some debugging, it seems the correct connection sting would be:


can anyone confirm this?


Hey bojand,

This is correct, I suggest you omit the port number if you are not using non-default ports though.

Cheers, Brett