Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Interfaces don't failover in cluster #99

Open
Glen-afk opened this issue Mar 10, 2021 · 3 comments
Open

Virtual Interfaces don't failover in cluster #99

Glen-afk opened this issue Mar 10, 2021 · 3 comments

Comments

@Glen-afk
Copy link

Hello,

I've built a pair of Zevenet CE servers and configured them as a cluster. When I shutdown the Primary server the cluster IP correctly fails over to the Backup server. I can run a continuous ping and see a single drop and then it is reachable again. I've created some additional Virtual Interfaces with unique IPs I want to use for services in a LSLB l4xnat farm. When I shutdown the Primary server a ping of the IPs for these Virtual Interfaces drops and doesn't recover until the Primary server is powered on. What am I missing here that could be causing this?

Config example:
Server1
eth0 IP: 172.16.0.1

Server2
eth0 IP: 172.16.0.2

Cluster Virtual Interface
IP 172.16.0.3

Virtual Interfaces for services
IP 172.16.0.4
IP 172.16.0.5

@a-stoyanov
Copy link

a-stoyanov commented Aug 23, 2021

Heya,

I've recently had to deploy a 2-node 5.11 CE cluster and ran into the same issue.
After some troubleshooting I found the zevenet-ce-cluster (1.3) package does not implement any gratuitous arp update procedures when the cluster master is failed over, which is really silly.
What this means is the arp tables of all on link neighbours including the next hop router are not updated when the virtual IPs are switched over. Ucarp does this natively only for the $cluster_ip. Any other virtual IPs are failed over but no garp is broadcast for the mac address change.

I added an extra one-liner to fix this in the cluster master startup script.

Create a new shell script:
nano /root/garp-update.sh

#!/bin/bash
#Print all bound IPs and execute arping garp (excludes link-local and loopback)
ip address | awk '/inet/ {print $2}' | grep -ve ^::1 -e ^127 -e ^fe80 | awk -F '/' '{print $1}' | while read line ; do arping -c 2 -U $line ; done

Make executable:
chmod +x /root/garp-update.sh

Edit the cluster startup script:
nano /usr/local/zevenet/app/ucarp/sbin/zevenet-ce-cluster-start

Add the extra 5th step to the startup script to execute the new shell script:

#!/usr/bin/perl

print "Executing Zevenet Cluster transtion to MASTER...\n";
#1 we wait for 1 second to the first replication
sleep (1);
#2 we start zevenet service
my $exec=system("/etc/init.d/zevenet start");
#3 update cluster status
my $exec=system("echo master > /etc/zevenet-ce-cluster.status");
#4 start zeninotify
my $exec=system("nohup /usr/local/zevenet/app/zeninotify/zeninotify.pl >/dev/null 2>&1 &");
#5 send gratuitous arp update for all bound IPs (excluding link-local and loopback)
my $exec=system("/root/garp-update.sh");

Zevenet devs should really add this fix in the next release.
@cano-devel @adanmarin-zevenet

@emiliocampos-zevenet
Copy link
Contributor

emiliocampos-zevenet commented Aug 24, 2021 via email

@dboc
Copy link

dboc commented May 30, 2022

Hello,

@a-stoyanov I used your script, it worked in Zevenete 5.12 . Thanks

I noticed that Zevenet 5.12 only send ping with the physical IP to the gateway, you could see it here in Code:

sub sendGPing # ($pif)

sub sendGPing    # ($pif)
{
	&zenlog( __FILE__ . ":" . __LINE__ . ":" . ( caller ( 0 ) )[3] . "( @_ )",
			 "debug", "PROFILING" );
	my ( $pif ) = @_;
	my $if_conf = &getInterfaceConfig( $pif );
	my $gw      = $if_conf->{ gateway };

	if ( $gw )
	{
		my $ping_bin = &getGlobalConfiguration( 'ping_bin' );
		my $pingc    = &getGlobalConfiguration( 'pingc' );
		my $ping_cmd = "$ping_bin -c $pingc -I $if_conf->{addr} $gw";

		&zenlog( "Sending $pingc ping(s) to gateway $gw from $if_conf->{addr}",
				 "info", "NETWORK" );
		&logAndRunBG( "$ping_cmd" );
	}
}

I do not know if all the cases needs to send ping for all Virtual Interfaces, but in my case i needed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants