Sql redundancy

Paul ensoniqpb at gmail.com
Thu Mar 12 13:03:26 CET 2015


Hi,
I have configured 2 sql instances (db1 and db2) used in authorize and
accounting sections. Freeradius v3.0.4.

/etc/raddb/mods-available/sql (the entire file):
sql db1{
        driver = "rlm_sql_mysql"
        dialect = "mysql"
        server = "172.16.20.6"
        port = 3306
        login = "radius"
        password = "xxx"
        radius_db = "radius"
        acct_table1 = "radacct"
        acct_table2 = "radacct"
        postauth_table = "radpostauth"
        authcheck_table = "radcheck"
        groupcheck_table = "radgroupcheck"
        authreply_table = "radreply"
        groupreply_table = "radgroupreply"
        usergroup_table = "radusergroup"
        delete_stale_sessions = yes
        pool {
                start = 5
                min = 4
                max = ${thread[pool].max_servers}
                spare = 3
                uses = 0
                lifetime = 0
                idle_timeout = 60
        }
        client_table = "nas"
        $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}
sql db2{
        driver = "rlm_sql_mysql"
        dialect = "mysql"
        server = "172.16.20.14"
        port = 3306
        login = "radius"
        password = "xxx"
        radius_db = "radius"
        acct_table1 = "radacct"
        acct_table2 = "radacct"
        postauth_table = "radpostauth"
        authcheck_table = "radcheck"
        groupcheck_table = "radgroupcheck"
        authreply_table = "radreply"
        groupreply_table = "radgroupreply"
        usergroup_table = "radusergroup"
        delete_stale_sessions = yes
        pool {
                # Number of connections to start
                start = 5
                min = 4
                max = ${thread[pool].max_servers}
                spare = 3
                uses = 0
                lifetime = 0
                idle_timeout = 60
        }
        client_table = "nas"
        $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}

/etc/raddb/sites-enabled/pppoe_null (irrelevant portions omitted):
server srv_null {
 authorize {
  (...)
  redundant {
   db1
   db2
  }
  (...)
 }

 accounting {
  redundant {
   db1
   db2
  }
  (...)
 }
 (...)
}


I need fully redundant sql config:
1. Freeradius should start with only one or both sql servers available
2. Freeradius should operate with only one or both sql servers available

I can't start fr with only one sql server available. When I shut down
db2 server, I see:
(...)
rlm_sql (db1): Opening additional connection (0)
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (db1): Opening additional connection (1)
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (db1): Opening additional connection (2)
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (db1): Opening additional connection (3)
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (db1): Opening additional connection (4)
rlm_sql_mysql: Starting connect to MySQL server
(...)
rlm_sql (db2): Opening additional connection (0)
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Couldn't connect socket to MySQL server
radius at 172.16.20.14:radius
rlm_sql_mysql: Mysql error 'Can't connect to MySQL server on
'172.16.20.14' (111)'
rlm_sql_mysql: Socket destructor called, closing socket
rlm_sql (db2): Opening connection failed (0)
rlm_sql (db2): Removing connection pool
/etc/raddb/mods-enabled/sql[33]: Instantiation failed for module "db2"

Of course I can start fr with both sql reached.

Is it possible to start fr with the only one sql available?

-- 
Regards,
Paul


More information about the Freeradius-Users mailing list