title: Redis sentinel implmentation over the internet
body: <p>I'm trying to implement redis sentinel in which there are two seperate
  environments where master and replica redis will be running. The two
  enviroments i.e. <code>Primary</code> and <code>Backup</code> will communicate through internet. Each
  environment will have 2 nodes and each node will have one pod which contains
  redis+sentinel processes. The following architecture represents the same.</p>
  <p>Let's consider a scenario, if <code>Master Redis (Node 1)</code> goes down then sentinel
  will invoke <code>fail-over</code> process and make one of the replica as Master Redis.
  In such case, suppose <code>Node 3</code> replica becomes master redis. So far all works
  as expected. Now when Node 1 becomes available then its redis will start as
  Master, after sentinels communication redis will act as replica. <strong>Ideally,
  redis should bind on <code>1.2.3.4:30001</code> but it is binding on private IP of node
  i.e. <code>192.168.x.x</code>.</strong></p>
  <p>My question is why this is happening and as per my understanding sentinel is
  responsible for config rewrites and asking <code>Node 1 redis</code> to become replica
  redis so how sentinel is taking private IP rather than public IP.</p>
  <p>Hopefully, I have properly conveyed my problem to you. if you need any futher
  information feel free to comment.</p>
  <p><a href="https://i.stack.imgur.com/Gwokd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gwokd.png" alt="Redis Sentinel Architecture" /></a></p>