Setting up RADIUS to send accounting packets to multiple database servers simultaneously

Matthew Newton mcn at freeradius.org
Tue Aug 2 10:06:55 UTC 2022



On 02/08/2022 10:09, Sea Gull wrote:
> I would like to set up RADIUS to send accounting packets to a local
> MySQL database and a remote PostgreSQL database. From the research that I
> did, this does not seem to be possible unless having them set redundant to
> each other. Is there a possible way to achieve this, please?

Copy the sql module instance (/etc/raddb/mods-enabled/sql). Call one 
(for example) sql_local and the other sql_remote, and configure them 
appropriately - the local one for the mysql instance and the remote one 
for the postgresql instance:

   sql sql_local {
     ...
   }

   sql sql_remote {
     ...
   }

then call them both - rather than

   sql

do

   sql_local
   sql_remote


> I have started by setting up RADIUS to write accounting packets to the
> remote PostgreSQL, which was successful. However, I needed to test that if
> the remote database is unavailable, RADIUS will still start up.
> Unfortunately, although I did the change below, RADIUS will not start if
> the PostgreSQL database is not available. How is it possible to accomplish
> this, if not as shown below, please?
> 
>          pool {
>                  #  Connections to create during module instantiation.
>                  #  If the server cannot create specified number of
>                  #  connections during instantiation it will exit.
>                  #  Set to 0 to allow the server to start without the
>                  #  database being available.
>                  start = 0

You've not set that - or at least not in the correct place. The debug 
output still shows the pool with "start = 5". Make sure you edit the 
pool section in /etc/raddb/mods-enabled/sql.

-- 
Matthew


More information about the Freeradius-Users mailing list