I have 2 VPS with Ubuntu OS 20 and I have 2 IPs in one server and 1 IP in the second server.
Server 1-> 173.248.. & 173.248.. Server 2-> 173.248..
I want to set up one IP as a floating IP. How do I do that? Actually, I want to create a cluster in the Ubuntu server for the HTTP server. If one server goes down HTTP server is up from the second server. I have set up a server with Pacemaker and corosync. IP moves to a second server when service is down in one server, but I am not able to ping or access the IP when it moves to the second server.
Let me know of you need any other information.
Thank you.
I want to create HA cluster to keep alive HTTP service active. Floating IP move to new server but I don't able to ping it.
To set up a floating IP in Ubuntu, you can use the if-up.d script. Here are the steps:
sudo apt-get install ifupdown
sudo nano /etc/if-up.d/floating_ip.sh
#!/bin/sh /sbin/ip addr add <floating_ip> dev eth0
Save the file and exit the editor.
Make the floating_ip.sh script executable by running the following command:
sudo chmod +x /etc/if-up.d/floating_ip.sh
sudo ifdown eth0 && sudo ifup eth0
After completing these steps, the floating IP should be active on your system. If you are still unable to ping the floating IP, make sure that the network interface is up and running and that there are no firewall rules blocking access to the IP.