In redhat clustering (HA), Due to lack of knowledge on clustering, If the master node fails the virtual ip will be shifted to slave and the second node becomes the master, how the shifting of virtual ip happens, correct me if i am wrong? (ASssumes that vip is assigned to active node), in real time how this is implemented?
I think you are consedering Virtual IP as a physical node IP rather than its just an alias IP to any node.
Lets assume you have a Public IP and two Apache server (with Private IP address) are behind this public IP. So all the request will come to the public IP. Both Apache server are being continuously monitored with HA hearbeat if one server goes down then the other server just brings up the ethernet to assign the public IP to it. As you run ifup on some server to add another interface IP.
This is not the technical defination to describe the process of fail-over though it is to understand.