title: Connection to Redis cluster failed
body: <p>I have setup Redis cluster in <a href="http://console.developers.google.com" rel="nofollow noreferrer">Google compute Engine</a> by <a href="https://cloud.google.com/solutions/redis/click-to-deploy?hl=en" rel="nofollow noreferrer">click to deploy</a> option. Now i want to connect to this redis server from my node js code using 'ioredis' here is my code to connect to single instance of redis</p>
  
  <pre><code>var Redis = require("ioredis");
  
  var store = new Redis(6379, 'redis-ob0g');//to store the keys
  var pub =   new Redis(6379, 'redis-ob0g');//to publish a message to all workers
  var sub =   new Redis(6379, 'redis-ob0g');//to subscribe a message 
  
  var onError = function (err) {
      console.log('fail to connect to redis ',err);
  };
  store.on('error',onError);
  pub.on('error',onError);
  sub.on('error',onError);
  </code></pre>
  
  <p>And it worked. Now i want to connect to redis as cluster, so i change the code as</p>
  
  <pre><code>/**
   * list of server in replica set
   * @type {{port: number, host: string}[]}
   */
  var nodes =[
      {   port: port,    host: hostMaster},
      {   port: port,    host: hostSlab1},
      {   port: port,    host: hostSlab2}
  ];
  var store =  new Redis.Cluster(nodes);//to store the keys
  var pub =   new Redis.Cluster(nodes);//to publish a message to all workers
  var sub =    new Redis.Cluster(nodes);//to subscribe a message channel
  </code></pre>
  
  <p>Now it throw this error:
  <a href="https://i.stack.imgur.com/ImC0x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ImC0x.png" alt="enter image description here"></a></p>
  
  <p>Here is my Redis cluster in my google compute console:</p>
  
  <p><a href="https://i.stack.imgur.com/kOp0U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kOp0U.png" alt="enter image description here"></a></p>