title: Unable to connect to redis db which is on machine-A and i am trying to connect to it from machine-b
body: <p>I am trying to run my express App in which i am using redis for my 
      session management. For this i am using two machines as my 
      servers(machine-a and machine-b). so my redis db I've configured 
     in machine-a and from that machine my app works fine. but when i am 
     enabling my machine-b there i am unable to connect to the redis db 
     which is in machine-a. i am unable to find how should i get 
     connected to redis db from machine-b.</p>
  
  <p>I have tried giving IP addresses like 127.0.0.1, then port number 
     6379
     and then network IP address.</p>
  
  <p>Below is the code, and the same code is written in machine-b too. </p>
  
  <pre><code>const express = require('express');
  const session = require('express-session');
  const bodyParser = require('body-parser');
  const redis = require('redis');
  const redisStore = require('connect-redis')(session);
  const client = redis.createClient();
  const router = express.Router();
  const app = express();
  
  app.use(session({
      secret: 'ssshhhhh',
     // create new redis store.
     store: new redisStore({ host: 'localhost', port: 6379, client: 
            client, ttl: 260 }),
     saveUninitialized: false,
     resave: false
  }));
  
  
  app.listen(3000, () =&gt; {
      console.log('listen 3000');
      console.log(`App Started on PORT 3000}`);
  });
  </code></pre>
  
  <p>I just want to get connected to the redis db which is in machine-a 
      form machine-b.</p>