Differences
This shows you the differences between two versions of the page.
| en:dpi:dpi_components:platform:dpi_admin:admin_db [2024/09/26 15:29] – создано - внешнее изменение 127.0.0.1 | en:dpi:dpi_components:platform:dpi_admin:admin_db [2025/07/17 07:25] (current) – elena.krasnobryzh | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Database | + | ====== Database |
| {{indexmenu_n> | {{indexmenu_n> | ||
| - | UDR (built-in database, user data repository) | + | Up to version 14, only one built-in database is used: **UDR (User Data Repository)**, |
| - | **List of database tables** | + | 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. | ||
| - | ^ Table ^ Purpose ^ | + | <note warning> |
| - | |bindings| login and address binding| | + | |
| - | |bindings_multi| login and address binding for multu-subscribers (with several IPs)| | + | |
| - | |policing| Subscriber policing setting| | + | |
| - | |profile_names| Names of profiles| | + | |
| - | |profiles| Profiles of services and policing| | + | |
| - | |services| Subscriber services setting| | + | |
| - | |vchannel_policing| Channel policing setting| | + | |
| - | |ip_props| BRAS subscriber properties| | + | |
| - | ==== Activating the built-in database ==== | + | **List of Tables |
| + | ^ Table ^ Purpose | ||
| + | | bindings | ||
| + | | bindings_multi | ||
| + | | ip_props | ||
| + | | policing | ||
| + | | profile_names | ||
| + | | profiles | ||
| + | | services | ||
| + | | vchannel_policing | Policing settings for channels | ||
| - | <note important> | + | **SDR Structure**\\ |
| + | In the SDR directory / | ||
| + | * fdpi.mdb: general data | ||
| + | * bras.mdb: data related | ||
| + | * router.mdb: data related to router mode | ||
| + | Contents of these DBs for version 14: | ||
| - | UDR is activated by the configuration parameter in **/// | + | fdpi.mdb: |
| + | | ||
| + | | ||
| - | < | + | bras.mdb: |
| + | * l2tp_server_props - L2TP servers served by BRAS and their properties (rules set using CLI commands in l2tp server group) | ||
| - | The created database is located in the **///var/db/dpi//** directory | + | router.mdb: |
| + | | ||
| + | | ||
| - | < | + | < |
| - | < | + | |
| - | and handle further manipulations in the copied database.</ | + | |
| - | ==== Enlarging | + | Backup: save copies of .mdb files from the SDR directory (preferably when fastDPI is stopped) |
| + | Restore: copy .mdb files to the SDR directory | ||
| - | By default, the database size is limited | + | ==== Activation of Built-in UDR ==== |
| - | < | + | <note important> |
| - | will set the DB size of 2GB. | + | UDR is activated using the configuration parameter in the file **/// |
| + | < | ||
| + | udr=1 | ||
| + | </ | ||
| + | The created database is located in the directory **/// | ||
| - | < | + | < |
| + | < | ||
| + | and then perform further manipulations on the DB copy. | ||
| + | </ | ||
| - | ==== Database recovery with data transfer | + | ==== Increasing the Size of UDR and SDR DB ==== |
| + | 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: | ||
| + | < | ||
| + | sets the DB size to 2GB | ||
| - | Stop the fastDPI | + | <note>The built-in DB does not require administration and is fault-tolerant. |
| - | <code>service fastdpi stop</code> | + | However, in rare cases the built-in DB has been corrupted. |
| + | In this case, the following actions are possible:</note> | ||
| - | Run the script | + | ==== DB Recovery with Data Migration ==== |
| - | < | + | Stop fastDPI < |
| rm -rf / | rm -rf / | ||
| mkdir -p / | mkdir -p / | ||
| Line 53: | Line 78: | ||
| rm / | rm / | ||
| mv / | mv / | ||
| - | cp -f / | + | cp -f / |
| - | Start the fastDPI | + | ==== Deleting |
| - | < | + | \\ Stop fastDPI< |
| - | + | ||
| - | ==== Deleting | + | |
| - | + | ||
| - | Stop the fastDPI | + | |
| - | < | + | |
| - | + | ||
| - | Delete | + | |
| - | < | + | |
| - | + | ||
| - | Start the fastDPI | + | |
| - | < | + | |
| - | + | ||
| - | Reload all the settings into the database | + | |
| ===== Experimental Section ===== | ===== Experimental Section ===== | ||
| - | ==== Restoring a database to the fdpi_ctrl command format ==== | ||
| - | Stop the fastDPI | + | ==== DB Recovery in fdpi_ctrl Command Format ==== |
| - | < | + | |
| - | Run the script | + | Stop fastDPI < |
| - | < | + | mdb_dump -p -a -f dump.sh / |
| - | /bin/rm / | + | /bin/rm / |
| + | chmod +x dump.sh | ||
| + | ./dump.sh | ||
| + | </ | ||
| - | Start the fastDPI | + | ==== Recovery of Individual DB Tables in fdpi_ctrl Command Format ==== |
| - | < | + | |
| - | Run the script | + | Stop fastDPI < |
| - | < | + | for table in $(mdb_dump -l / |
| - | ./ | + | |
| - | + | ||
| - | ==== Restoring certain tables to the fdpi_ctrl command format ==== | + | |
| - | + | ||
| - | Stop the fastDPI | + | |
| - | < | + | |
| - | + | ||
| - | Run the script | + | |
| - | < | + | |
| mdb_dump -p -f dump.$table.sh -s $table /var/db/dpi | mdb_dump -p -f dump.$table.sh -s $table /var/db/dpi | ||
| done | done | ||
| - | /bin/rm / | + | /bin/rm / |
| - | + | service fastdpi start </ | |
| - | Start the fastDPI | + | chmod +x dump.bindings.sh |
| - | < | + | ./ |
| + | </ | ||
| - | Choose and run the scripts you need, **for example** | ||
| - | < | ||
| - | ./ | ||