RADSQLRELAY(8) FreeRADIUS helper program RADSQLRELAY(8)NAME
radsqlrelay - relay SQL queries to a central database server
SYNOPSIS
radsqlrelay [-?] [-d sql_driver] [-b database] [-f file] [-h host] [-u user] [-P port] [-p password] [-1] [-x] file_path
DESCRIPTION
radsqlrelay tails a SQL logfile and forwards the queries to a database server. Used to replicate accounting records to one (central) data-
base, even if the database has extended downtime.
The SQL logfile is created by the rlm_sql_log module. The module must be configured in the radiusd server before you can use radsqlrelay.
OPTIONS
-? Print usage help information.
-d sql_driver
Driver to use: mysql, pg, oracle.
-b database
Name of the database to use.
-f file
Read password from file, instead of command line.
-h host
Connect to host.
-u user
User for login.
-P port
Port number to use for connection.
-p password
Password to use when connecting to server.
-1 One-shot mode: push the file to database and exit.
-x Turn on debugging.
file_path
The pathname of the SQL logfile to use.
NOTES
Oracle driver
The command "radsqlrelay -d oracle -b db.domain.tld sql-relay" reads the database description stored in $TNS_ADMIN/tnsnames.ora:
db.domain.tld =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db.domain.tld)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = <DB SID>)
)
)
SEE ALSO rlm_sql_log(5)AUTHOR
Nicolas Baradakis <nicolas.baradakis@cegetel.net>
19 June 2005 RADSQLRELAY(8)
Check Out this Related Man Page
RADRELAY(8) FreeRADIUS Daemon RADRELAY(8)NAME
radrelay -- Deprecated command.
DESCRIPTION
The functions of radrelay have been added to radiusd. One benefit is that one instance of radiusd can read multiple detail files, among
others.
The rlm_sql_log module does something similar, but for SQL queries. See it's man page for details.
REPLICATION FOR BACKUPS
Many sites run multiple radius servers; at least one primary and one backup server. When the primary goes down, most NASes detect that and
switch to the backup server.
That will cause your accounting packets to go the the backup server - and some NASes don't even switch back to the primary server when it
comes back up.
The result is that accounting records are missed, and/or the administrator must jump through hoops in order to combine the different detail
files from multiple servers. It also means that the session database ("radutmp", used for radwho and simultaneous use detection) gets out
of sync.
We solve this issue by "relaying" packets from one server to another, so they both have the same set of accounting data.
See raddb/sites-available/buffered-sql for more information.
BUFFERING FOR HIGH-LOAD SERVERS
If the RADIUS server suddenly receives a many accounting packets, there may be insufficient CPU power to process them all in a timely man-
ner. This problem is especially noticable when the accounting packets are going to a back-end database.
Similarly, you may have one database that tracks "live" sessions, and another that tracks historical accounting data. In that case,
accessing the first database is fast, as it is small. Accessing the second database many be slower, as it may contain multiple gigabytes
of data. In addition, writing to the first database in a timely manner is important, while data may be written to the second database with
a few minutes delay, without any harm being done.
See raddb/sites-available/copy-to-home-server for more information.
SEE ALSO radiusd(8), rlm_sql_log(5)AUTHOR
The FreeRADIUS Server Project
23 October 2007 RADRELAY(8)