Redundant SQL

Garber, Neal Neal.Garber at energyeast.com
Fri Sep 18 04:05:07 CEST 2009


Thank you so much for your time Alan.

> Configure both modules:

Yup - I did that..

> And then list them both in the "instantiate" section

Yup - I eventually did that too..  My concern is that if I list 2 sql instances and both have readclients=yes and either one is down, then FR won't start.

I read another thread about this and it didn't seem like there was a way around this currently.  I would be willing to create an enhancement if you think it's a reasonable thing to do and if you would entertain the possibility of accepting the patch. If so, and you'd like to provide some guidance on how you'd like to see it implemented, let me know.  Or, I can propose something and ask for your feedback if you'd prefer.

> Then in the virtual server for the dynamic client, 
> list them in a redundant section:

Ugh - I had redundant in the instantiate.

One more thing..  I'm having trouble getting redundancy to work in the dynamic client virtual server:

authorize {
  redundant sqlha {
       sqlaugs
       sqlroch
  }

  if ("%{sqlha: SELECT nasname FROM nas 
  		WHERE nasname = '%{Packet-Src-IP-Address}'}") {
     update control {
         FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}"
         FreeRADIUS-Client-Shortname = "%{sqlha: SELECT shortname FROM nas 
  	    WHERE nasname = '%{Packet-Src-IP-Address}'}"
         FreeRADIUS-Client-Secret = "%{sqlha: SELECT secret FROM nas 
  	    WHERE nasname = '%{Packet-Src-IP-Address}'}"
         FreeRADIUS-Client-NAS-Type = "%{sqlha: SELECT type FROM nas 
  	    WHERE nasname = '%{Packet-Src-IP-Address}'}"
     }
  }
}

Note: query lines are split above for readability - they are not split in the config.

I've tried sqlha as a prefix, as shown above, which I now know is wrong because it has no xlate capability (if I'm reading the code correctly).  I also tried sqlroch and sqlaugs as a prefix.  If I use a prefix of a database that is down, then it never tries the 2nd choice for the assignment stmts (it does try the 2nd choice for the if stmt).  If I use the prefix of a database that is up, it works fine for assignment and if stmts.  I attached the debug output for all 3 tests.  For all 3 tests, sqlroch was up and sqlaugs was down.

Am I doing something wrong or is this a bug?  I thought about using an else block that uses the other sql module as a prefix; but, if that's needed, then what is the purpose of redundant?

Thanks again for your help.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sqlaugs - fails.txt
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090917/dda40a9e/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sqlha - fails.txt
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090917/dda40a9e/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sqlroch - works.txt
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090917/dda40a9e/attachment-0002.txt>


More information about the Freeradius-Users mailing list