Floating IP does not work in pacemaker cluster

406 views Asked by At

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.

1

There are 1 answers

0
Naseer ud din On

To set up a floating IP in Ubuntu, you can use the if-up.d script. Here are the steps:

  1. Make sure the if-up.d script is installed on your Ubuntu system by running the following command:

sudo apt-get install ifupdown

  1. Create a new file in the if-up.d directory called floating_ip.sh using the following command:

sudo nano /etc/if-up.d/floating_ip.sh

  1. Add the following lines to the file, replacing <floating_ip> with the floating IP address that you want to use:

#!/bin/sh /sbin/ip addr add <floating_ip> dev eth0

  1. Save the file and exit the editor.

  2. Make the floating_ip.sh script executable by running the following command:

sudo chmod +x /etc/if-up.d/floating_ip.sh

  1. Restart the network interface by running the following command:

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.