Recently in rel 2.1.4 you fixed and issue for replicated databases that allow readclients=yes option in sql.conf. This worked great if ALL databases are up and running. The issue happens if radiusd can't connect to a database and process cannot start even though it can read NAS info from sql2 if sql1 is down. Could you please check if you can still enable readclients=yes but allow radiusd to start if at least one of sql1 or sql2 is UP? Thanks for your reply. -- View this message in context: http://www.nabble.com/sql.conf-failover-readclients%3Dyes-tp23103617p2310361... Sent from the FreeRadius - User mailing list archive at Nabble.com.
Just adding debugging messages: 1) When readclients=no radiusd starts even if sql2 is down rlm_sql_unixodbc: Connection failed rlm_sql (sql2): Failed to connect DB handle #0 rlm_sql (sql2): starting 1 rlm_sql (sql2): starting 2 rlm_sql (sql2): starting 3 rlm_sql (sql2): starting 4 rlm_sql (sql2): starting 5 rlm_sql (sql2): starting 6 rlm_sql (sql2): starting 7 rlm_sql (sql2): starting 8 rlm_sql (sql2): starting 9 rlm_sql (sql2): starting 10 rlm_sql (sql2): starting 11 rlm_sql (sql2): starting 12 rlm_sql (sql2): starting 13 rlm_sql (sql2): starting 14 rlm_sql (sql2): starting 15 rlm_sql (sql2): Failed to connect to any SQL server. Module: Instantiating sql1 sql sql1 { 2) When readclients=yes radiusd cannot start when sql2 is down since it calls generate_sql_clients even after connection returned "fail" rlm_sql_unixodbc: Connection failed rlm_sql (sql2): Failed to connect DB handle #0 rlm_sql (sql2): starting 1 rlm_sql (sql2): starting 2 rlm_sql (sql2): starting 3 rlm_sql (sql2): starting 4 rlm_sql (sql2): starting 5 rlm_sql (sql2): starting 6 rlm_sql (sql2): starting 7 rlm_sql (sql2): starting 8 rlm_sql (sql2): starting 9 rlm_sql (sql2): starting 10 rlm_sql (sql2): starting 11 rlm_sql (sql2): starting 12 rlm_sql (sql2): starting 13 rlm_sql (sql2): starting 14 rlm_sql (sql2): starting 15 rlm_sql (sql2): Failed to connect to any SQL server. rlm_sql (sql2): Processing generate_sql_clients -- View this message in context: http://www.nabble.com/sql.conf-failover-readclients%3Dyes-tp23103617p2310663... Sent from the FreeRadius - User mailing list archive at Nabble.com.
Guys, Please tell me not to change code and ignore SQL errors during startup time when your read NAS table. Could you please take a look at this question again? We need functionality when one of the redundant databases is down to still continue and be able to start RADIUS dameon and read NAS information from another redundant database Thanks a lot! -- View this message in context: http://www.nabble.com/sql.conf-failover-readclients%3Dyes-tp23103617p2315851... Sent from the FreeRadius - User mailing list archive at Nabble.com.
Alan, Could you please add this as a feature request for the next release and solve it properly? The major issue is that if we ignore error of NAS table loading at startup time then it will never recover and load NAS when DB becomes availlable again in runtime. But al least in this case if it succeeds to read NAS info from the redundant database then it will cache it and continue loading other modules. As far as I understand to add/modify NAS information in runtime we still need to recycle radiusd process as even HUP does not help. What do you think if we comment out this code until the real solution comes? rlm_sql.c if (inst->config->do_clients){ if (generate_sql_clients(inst) == -1){ radlog(L_ERR, "Failed to load clients from SQL."); #if 0 /* ignore DB connect failure */ rlm_sql_detach(inst); return -1; #endif } } Alan DeKok-2 wrote:
leopold wrote:
Please tell me not to change code and ignore SQL errors during startup time when your read NAS table.
The only way to fix this is to change the source code of the server.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- View this message in context: http://www.nabble.com/sql.conf-failover-readclients%3Dyes-tp23103617p2316246... Sent from the FreeRadius - User mailing list archive at Nabble.com.
leopold wrote:
Could you please add this as a feature request for the next release and solve it properly?
I have a long list of new features, and a short amount of time.
The major issue is that if we ignore error of NAS table loading at startup time then it will never recover and load NAS when DB becomes availlable again in runtime.
That requires *more* code. "try to load at startup, but if that fails, try to load again later". The main problem is that if it can't load the clients at startup, then there is the chance that it will ignore *all* clients. I understand that you want this feature, but will you answer all of the questions from people who configure one SQL server.. and then get surprised when they have no RADIUS clients, because the SQL server is down?
But al least in this case if it succeeds to read NAS info from the redundant database then it will cache it and continue loading other modules. As far as I understand to add/modify NAS information in runtime we still need to recycle radiusd process as even HUP does not help.
No. You can dynamically add clients. See raddb/sites-available/dynamic-clients.
What do you think if we comment out this code until the real solution comes? rlm_sql.c
<shrug> If it works for you, use it. You have access to the source code. And with git, it is *trivial* to keep local branches with your local changes. Alan DeKok.
participants (2)
-
Alan DeKok -
leopold