LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: LVS with two node cluster.

To: ssic-linux-devel <ssic-linux-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: LVS with two node cluster.
Cc: lvs-users <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
From: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxx>
Date: 06 May 2003 18:35:51 +0530
Hi,

The below two patches add the /proc/sys/net/ipv4/vs/loadbalance which
will enable  loadbalancing  on a particular machine. This is useful when
one is setting up a two node LVS cluster with both the node acting as
director node and real server.

For openssi the below patches are need to get clustewide IP working. 
I will update the ipvs patch for openssi later. 

I am marking this mail to lvs list also, since this can be used for lvs
setups other than openssi.

-aneesh 


 diff -ru linux-2.4.18-ssi-working/net/ipv4/ipvs/ip_vs_core.c
linux-2.4.18-ssi/net/ipv4/ipvs/ip_vs_core.c
--- linux-2.4.18-ssi-working/net/ipv4/ipvs/ip_vs_core.c Tue Apr 15
20:40:54 2003
+++ linux-2.4.18-ssi/net/ipv4/ipvs/ip_vs_core.c Wed May  7 01:31:34 2003
@@ -1030,6 +1030,13 @@
        int ret;
 
        /*
+        * Accept the packet if /proc/sys/net/ipv4/vs/loadbalancing
+        * is 1 
+        */
+       if(!sysctl_ip_vs_loadbalance) {
+               return NF_ACCEPT;
+       }
+       /*
         *      Big tappo: only PACKET_HOST (nor loopback neither mcasts)
         *      ... don't know why 1st test DOES NOT include 2nd (?)
         */
Binary files linux-2.4.18-ssi-working/net/ipv4/ipvs/ip_vs_core.o and
linux-2.4.18-ssi/net/ipv4/ipvs/ip_vs_core.o differ
diff -ru linux-2.4.18-ssi-working/net/ipv4/ipvs/ip_vs_ctl.c
linux-2.4.18-ssi/net/ipv4/ipvs/ip_vs_ctl.c
--- linux-2.4.18-ssi-working/net/ipv4/ipvs/ip_vs_ctl.c  Tue Apr 15
20:40:54 2003
+++ linux-2.4.18-ssi/net/ipv4/ipvs/ip_vs_ctl.c  Wed May  7 02:20:26 2003
@@ -79,6 +79,7 @@
 int sysctl_ip_vs_expire_nodest_conn = 0;
 int sysctl_ip_vs_sync_threshold = 3;
 int sysctl_ip_vs_nat_icmp_send = 0;
+int sysctl_ip_vs_loadbalance = 0;
 
 #ifdef CONFIG_IP_VS_DEBUG
 static int sysctl_ip_vs_debug_level = 0;
@@ -1412,6 +1413,9 @@
          &proc_dointvec},
         {NET_IPV4_VS_NAT_ICMP_SEND, "nat_icmp_send",
          &sysctl_ip_vs_nat_icmp_send, sizeof(int), 0644, NULL,
+         &proc_dointvec},
+        {NET_IPV4_VS_LOADBALANCE, "loadbalance",
+         &sysctl_ip_vs_loadbalance, sizeof(int), 0644, NULL,
          &proc_dointvec},
         {0}},
        {{NET_IPV4_VS, "vs", NULL, 0, 0555, ipv4_vs_table.vs_vars},


--- linux-2.4.18-ssi-working/include/net/ip_vs.h        Thu Apr 17 00:38:00
2003
+++ linux-2.4.18-ssi/include/net/ip_vs.h        Wed May  7 01:36:42 2003
@@ -317,6 +317,7 @@
        NET_IPV4_VS_EXPIRE_NODEST_CONN=23,
        NET_IPV4_VS_SYNC_THRESHOLD=24,
        NET_IPV4_VS_NAT_ICMP_SEND=25,
+       NET_IPV4_VS_LOADBALANCE=26,
        NET_IPV4_VS_LAST
 };
 
@@ -702,6 +703,7 @@
 extern int sysctl_ip_vs_expire_nodest_conn;
 extern int sysctl_ip_vs_sync_threshold;
 extern int sysctl_ip_vs_nat_icmp_send;
+extern int sysctl_ip_vs_loadbalance;
 extern atomic_t ip_vs_dropentry;
 extern struct ip_vs_stats ip_vs_stats;
 


<Prev in Thread] Current Thread [Next in Thread>