MySQL Fail Over Error When 1 DB is Down
Hi there, I can't get FreeRADIUS to ignore error and continue processing when 1 DB is down even when it can connect to the other DB. Below is my config. # radiusd.conf instantiate { ... redundant redundant_sql { sql1 sql2 handled } } modules { ... $INCLUDE sql1.conf $INCLUDE sql2.conf } # sql1.conf sql sql1 { database = "mysql" … } # sql2.conf sql sql2 { ... database = "mysql" } # sites-enabled/default authorize { redundant_sql } accounting { redundant_sql } session { redundant_sql } post-auth { redundant_sql Post-Auth-Type REJECT { redundant_sql attr_filter.access_reject } } bregards, det
When I shutdown one of the DB, it generates an error. How do I tell freeradius to ignore that and proceed if it can connect to at least one of the DB? /etc/freeradius/sql2.conf[22]: Instantiation failed for module "sql2" /etc/freeradius/radiusd.conf[75]: Failed to find module "sql2". /etc/freeradius/radiusd.conf[75]: Failed to parse "sql2" entry. /etc/freeradius/sites-enabled/default[1]: Errors parsing authorize section. ________________________________ From: Det Det <det.explorer@yahoo.com> To: FreeRadius mailing list <freeradius-users@lists.freeradius.org> Sent: Monday, August 29, 2011 2:05 PM Subject: MySQL Fail Over Error When 1 DB is Down Hi there, I can't get FreeRADIUS to ignore error and continue processing when 1 DB is down even when it can connect to the other DB. Below is my config. # radiusd.conf instantiate { ... redundant redundant_sql { sql1 sql2 handled } } modules { ... $INCLUDE sql1.conf $INCLUDE sql2.conf } # sql1.conf sql sql1 { database = "mysql" … } # sql2.conf sql sql2 { ... database = "mysql" } # sites-enabled/default authorize { redundant_sql } accounting { redundant_sql } session { redundant_sql } post-auth { redundant_sql Post-Auth-Type REJECT { redundant_sql attr_filter.access_reject } } bregards, det - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Really? What is the failover feature for? I can specify multiple DBs but if FreeRADIUS cannot connect to at least one of the DBs it will have an error and will not be able to start. There is no way to get around this? That is use first DB if first DB is up. If second DB is down and first DB is up, don't bother, continue to operate, and vice versa, so long as it still has a DB to use. I saw this link but I can't get it to work. It is using the rlm_always module. http://wiki.freeradius.org/Fail-over thanks, det ________________________________ From: Alan DeKok <aland@deployingradius.com> To: Det Det <det.explorer@yahoo.com>; FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Sent: Monday, August 29, 2011 6:21 PM Subject: Re: MySQL Fail Over Error When 1 DB is Down Det Det wrote:
When I shutdown one of the DB, it generates an error. How do I tell freeradius to ignore that and proceed if it can connect to at least one of the DB?
You don't. The only way to change this is via source code patches. Alan DeKok.
Det Det wrote:
Really?
<sigh> If you think I'm lying, why ask questions?
What is the failover feature for?
Read the docs. It's explained.
I can specify multiple DBs but if FreeRADIUS cannot connect to at least one of the DBs it will have an error and will not be able to start. There is no way to get around this?
And again... what did my message say? Did you read it?
That is use first DB if first DB is up. If second DB is down and first DB is up, don't bother, continue to operate, and vice versa, so long as it still has a DB to use. I saw this link but I can't get it to work. It is using the rlm_always module.
Fail-over is for when something goes wrong while the server is running. Alan DeKok.
Hi, Sorry, I honestly don't mean it that way. I just want to clarify some of that thoughts/concepts. I understand now what you mean by this.
Fail-over is for when something goes wrong while the server is running.
Thanks, Det Sent from my iPad On Aug 29, 2011, at 9:34 PM, Alan DeKok <aland@deployingradius.com> wrote:
Det Det wrote:
Really?
<sigh> If you think I'm lying, why ask questions?
What is the failover feature for?
Read the docs. It's explained.
I can specify multiple DBs but if FreeRADIUS cannot connect to at least one of the DBs it will have an error and will not be able to start. There is no way to get around this?
And again... what did my message say? Did you read it?
That is use first DB if first DB is up. If second DB is down and first DB is up, don't bother, continue to operate, and vice versa, so long as it still has a DB to use. I saw this link but I can't get it to work. It is using the rlm_always module.
Fail-over is for when something goes wrong while the server is running.
Alan DeKok.
When I shutdown one of the DB, it generates an error. How do I tell freeradius to ignore that and proceed if it can connect to at least one of the DB? /etc/freeradius/sql2.conf[22]: Instantiation failed for module "sql2"
Both databases must be up at the time of radiusd startup. This seems reasonable; if you have no redundancy, wouldn't you want to know? Either one may go down while radiusd is running. It looks like you could force a radiusd startup to "succeed" if one database fails to instantiate, but then it would never retry the connection, and you would be solely dependent on the database(s) that were available at startup. Bottom line, don't start your radius server unless both databases are up. On many Linux platforms, you could add an appropriate wrapper script at /etc/sysconfig/radiusd to block startup, or perhaps to move a configuration specific to the situation into place. I think you're better off doing redundancy a layer up, though, like _->radius1 ->db1 NAS<_ X | ->radius2 ->db2 i.e., if db1 is down, go ahead and allow radius1 to return failure to the NAS, which will then fail over to radius2.
Thanks so much! I understand it now. And thanks for the suggestions and additional inputs. BRegards, Det Sent from my iPad On Aug 29, 2011, at 10:56 PM, Rich Graves <rgraves@carleton.edu> wrote:
When I shutdown one of the DB, it generates an error. How do I tell freeradius to ignore that and proceed if it can connect to at least one of the DB? /etc/freeradius/sql2.conf[22]: Instantiation failed for module "sql2"
Both databases must be up at the time of radiusd startup. This seems reasonable; if you have no redundancy, wouldn't you want to know?
Either one may go down while radiusd is running.
It looks like you could force a radiusd startup to "succeed" if one database fails to instantiate, but then it would never retry the connection, and you would be solely dependent on the database(s) that were available at startup.
Bottom line, don't start your radius server unless both databases are up. On many Linux platforms, you could add an appropriate wrapper script at /etc/sysconfig/radiusd to block startup, or perhaps to move a configuration specific to the situation into place.
I think you're better off doing redundancy a layer up, though, like
_->radius1 ->db1 NAS<_ X | ->radius2 ->db2
i.e., if db1 is down, go ahead and allow radius1 to return failure to the NAS, which will then fail over to radius2. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (4)
-
Alan DeKok -
Det Det -
det.explorer@yahoo.com -
Rich Graves