summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2008-06-16 02:58:57 +0000
committerBill Marquette <billm@pfsense.org>2008-06-16 02:58:57 +0000
commit17623ab556ab149f01e10aa587a35816302ee91d (patch)
tree5a6bb1221b068f0375f284e4d179576b6fa45350 /etc/inc/config.inc
parent0551a3a89ffff608bfd7fffdd940eb4826357ae5 (diff)
downloadpfsense-17623ab556ab149f01e10aa587a35816302ee91d.zip
pfsense-17623ab556ab149f01e10aa587a35816302ee91d.tar.gz
Bring in relayd to perform server load balancing
Move gateway load balancing code into gwlb.inc - still uses slbd TODO: vs and pool status screens are currently broken...and wouldn't work with the gateway pools anyway, ultimately, the gateway pools need to move.
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc35
1 files changed, 35 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index b4f4eab..6ac373c 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -1225,6 +1225,41 @@ function convert_config() {
$config['version'] = "4.5";
}
+ /* Upgrade load balancer from slb to relayd */
+ /* Convert 4.5 -> 4.6 */
+ if ($config['version'] <= 4.5) {
+ if (is_array($config['load_balancer']['virtual_server']) && count($config['load_balancer']['virtual_server'])) {
+ $vs_a = &$config['load_balancer']['virtual_server'];
+ $pool_a = &$config['load_balancer']['lbpool'];
+ $pools = array();
+ /* Index pools by name */
+ if(is_array($pool_a)) {
+ for ($i = 0; isset($pool_a[$i]); $i++) {
+ if ($pool_a[$i]['type'] == "server") {
+ $pools[$pool_a[$i]['name']] = $pool_a[$i];
+ }
+ }
+ }
+ /* Convert sitedown entries to pools and re-attach */
+ for ($i = 0; isset($vs_a[$i]); $i++) {
+ if (isset($vs_a[$i]['sitedown'])) {
+ $pool = array();
+ $pool['type'] = 'server';
+ $pool['behaviour'] = 'balance';
+ $pool['name'] = "{$vs_a[$i]['name']}-sitedown";
+ $pool['desc'] = "Sitedown pool for VS: {$vs_a[$i]['name']}";
+ $pool['port'] = $pools[$vs_a[$i]['pool']]['port'];
+ $pool['servers'] = array();
+ $pool['servers'][] = $vs_a[$i]['sitedown'];
+ $pool['monitor'] = $pools[$vs_a[$i]['pool']]['monitor'];
+ $pool_a[] = $pool;
+ $vs_a[$i]['sitedown'] = $pool['name'];
+ }
+ }
+ }
+ $config['version'] = "4.6";
+ }
+
if ($prev_version != $config['version'])
write_config("Upgraded config version level from {$prev_version} to {$config['version']}");
}
OpenPOWER on IntegriCloud