Up to version 14, only one built-in database is used: UDR (User Data Repository), intended for persistent storage of data about services, policing, and other FastDPI settings.
Starting from version 14, UDR is split into UDR and SDR. The split occurs automatically during the version upgrade.
SDR (System Data Repository) is intended for storing FastDPI settings not related to subscribers.
It can be considered a continuation of fastdpi.conf. No special SDR activation is required – the necessary .mdb files are created automatically when the corresponding mode is enabled in fastdpi.conf.
List of Tables in UDR
Table | Purpose |
---|---|
bindings | Link between login and address |
bindings_multi | Link between login and address for multi-subscriber (multiple IPs) |
ip_props | BRAS subscriber properties |
policing | Policing settings for subscribers |
profile_names | Profile names |
profiles | Service and policing profiles |
services | Subscriber service settings |
vchannel_policing | Policing settings for channels |
SDR Structure
In the SDR directory /var/db/dpisdr, depending on the enabled modes, the database files are located:
Contents of these DBs for version 14:
fdpi.mdb:
bras.mdb:
router.mdb:
Backup: save copies of .mdb files from the SDR directory (preferably when fastDPI is stopped) Restore: copy .mdb files to the SDR directory
UDR is activated using the configuration parameter in the file /etc/dpi/fastdpi.conf
udr=1
The created database is located in the directory /var/db/dpi
mdb_copy /var/db/dpi ./DB
and then perform further manipulations on the DB copy.
By default, the size of the UDR and SDR DB is limited to 1GB. If your number of policing profiles exceeds 1 million, you need to increase the default size:
udr_size=2147483648
sets the DB size to 2GB
Stop fastDPI
service fastdpi stop
Run the script
rm -rf /var/db/dpi.recover/* mkdir -p /var/db/dpi.recover/tmp for table in $(mdb_dump -l /var/db/dpi); do mdb_dump -f /var/db/dpi.recover/tmp/dump.$table.load -s $table /var/db/dpi mdb_load -f /var/db/dpi.recover/tmp/dump.$table.load /var/db/dpi.recover done rm /var/db/dpi/lock.mdb mv /var/db/dpi/data.mdb /var/db/dpi.recover/data.mdb.backup cp -f /var/db/dpi.recover/data.mdb /var/db/dpi/
Start fastDPI
service fastdpi start
Stop fastDPI
service fastdpi stop
Delete DB
/bin/rm /var/db/dpi/*
Start fastDPI
service fastdpi start
Reload all settings into the DB using your own scripts
Stop fastDPI
service fastdpi stop
Run the script
mdb_dump -p -a -f dump.sh /var/db/dpi /bin/rm /var/db/dpi/*
Start fastDPI
service fastdpi start
Run the script
chmod +x dump.sh ./dump.sh
Stop fastDPI
service fastdpi stop
Run the script
for table in $(mdb_dump -l /var/db/dpi); do mdb_dump -p -f dump.$table.sh -s $table /var/db/dpi done /bin/rm /var/db/dpi/*
Start fastDPI
service fastdpi start
Select the required scripts and run them, example
chmod +x dump.bindings.sh ./dump.bindings.sh