What is virtual ip

From Kolmisoft Wiki
Jump to navigationJump to search

Virtual IP is needed in redundant solutions.

Virtual IP is the IP which can be assigned to any of two redundant servers.

Virtual IP is controlled by Hearbeat service. Heartbeat service is bringing up Virtual IP on MAIN server or on BACKUP server based on state of MAIN server.

IP which you will provide to customer is Virtual IP, and customer will be sending calls to it.

Example:

We have two servers with following IPs configured on them:

Server1 192.168.1.1 (this is our MAIN server)

Server2 192.168.1.2 (this is our BACKUP server)

Virtual IP is 192.168.1.3

Now, before Heartbeat configuration if we check IP configurations on each of server we will see:


On MAIN server:

# ip a show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether 01:01:01:01:01:01 brd ff:ff:ff:ff:ff:ff
   inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0
      valid_lft forever preferred_lft forever

On BACKUP server:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether 01:01:01:01:01:01 brd ff:ff:ff:ff:ff:ff
   inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
      valid_lft forever preferred_lft forever

and this is how servers should look like, before Heartbeat configuration which is done by Kolmisoft.


After Heartbeat service configuration (which is done by Kolmisoft), it looks like that:

In case when MAIN server is up and running:


On MAIN server:

# ip a show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether 01:01:01:01:01:01 brd ff:ff:ff:ff:ff:ff
   inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0
      valid_lft forever preferred_lft forever
   inet 192.168.1.3/24 brd 192.168.1.255 scope global secondary eth0
      valid_lft forever preferred_lft forever

On BACKUP server:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether 01:01:01:01:01:01 brd ff:ff:ff:ff:ff:ff
   inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
      valid_lft forever preferred_lft forever


In case when MAIN server is down:

On MAIN server:

(nothing to show because it is down)

On BACKUP server:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether 01:01:01:01:01:01 brd ff:ff:ff:ff:ff:ff
   inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
      valid_lft forever preferred_lft forever
   inet 192.168.1.3/24 brd 192.168.1.255 scope global secondary eth0
      valid_lft forever preferred_lft forever


So as you see Virtual IP is always assigned to working server, and in this way customers can always send calls to IP 192.168.1.3 and have working services.