Update control with redundant sql query
Hi, I use the policy configs to provide redundant and load-balance to update the pool-name. It´s work fine! But I have same questions... - Is it the correct way to do it? Is it the better way, considering a performance in high usage? - Why the virtual module created in the policy and control update always return "notfound" ? +- entering group authorize {...} ++- entering policy update_ctlr_PN {...} +++- entering redundant-load-balance group redundant-load-balance {...} ++++- entering policy update01_Pool-Name {...} ... expand: select poolname from radpoolname where nasipaddress="%{NAS-IP-Address}" -select poolname from radpoolname where nasipaddress="X.X.X.X" rlm_sql (sql01): Reserving sql socket id: 4 sql_xlat finished rlm_sql (sql01): Released sql socket id: 4 expand: %{sql01:select poolname from radpoolname where nasipaddress="%{NAS-IP-Address}"} -pool01 +++++[control] returns notfound ++++- policy update_ctlr_PN1 returns notfound +++- redundant-load-balance group redundant-load-balance returns notfound ++- policy update_ctlr_PN returns notfound The policy.conf policy { update_ctlr_PN1 { update control { Pool-Name := "%{sql01:select poolname from radpoolname where nasipaddress=\"%{NAS-IP-Address}\"}" } } update_ctlr_PN2 { update control { Pool-Name := "%{sql02:select poolname from radpoolname where nasipaddress=\"%{NAS-IP-Address}\"}" } } update_ctlr_PN { redundant-load-balance { update_ctlr_PN1 update_ctlr_PN2 } } } Server conf: ... authorize { update_ctlr_PN pap chap sql01 } ... Thank you.
On Fri, Jun 29, 2012 at 12:09 AM, lscrlstld <lscrlstld@gmail.com> wrote:
Hi,
I use the policy configs to provide redundant and load-balance to update the pool-name.
It´s work fine!
Does it?
The policy.conf policy { update_ctlr_PN1 { update control { Pool-Name := "%{sql01:select poolname from radpoolname where nasipaddress=\"%{NAS-IP-Address}\"}" } } update_ctlr_PN2 { update control { Pool-Name := "%{sql02:select poolname from radpoolname where nasipaddress=\"%{NAS-IP-Address}\"}" } } update_ctlr_PN { redundant-load-balance { update_ctlr_PN1 update_ctlr_PN2 } } }
last time I check the "%{sql" block does NOT return an error if the sql server is dead. So your "load-balance" part definitely works, but I wouldn't be so sure about the "redundant" part. Try killing one of the sql servers and see what happens. IIRC I had to explicitly hack a query so it would return some value (e.g. NOTFOUND, or whatever) when it would usually return zero rows. That way, if the "%{sql" block returns an empty string, I know something is wrong and I need to ask the next server. That method works, but it doesn't provide load balance. -- Fajar
participants (2)
-
Fajar A. Nugraha -
lscrlstld