Recover Trisul from a full disk and stop it filling again
| Field | Value |
|---|---|
| App Note ID | AN-010 |
| Audience | Trisul admins, NOC and network engineers, ISP operators |
| Applies to | All product modes (PCAP steps apply only where packets are stored) |
Summary
When the Trisul disk reaches 100%, Trisul stops working and the web interface may not respond. You recover by mounting a new volume and moving one or more data directories to it, either with the relocate context command or by hand with a symbolic link left in the old location. You then check free space with df, restart the web server and the Trisul components, and tune the SlicePolicy on the Probe and the Hub so the disk does not fill again.
The problem
Trisul writes packet captures on the Probe and metrics, flows and alerts on the Hub. Both keep data for a fixed window that you size when you install Trisul. If traffic grows, or the window was sized for a larger disk than the one you have, the disk fills up. At 100% Trisul stops working and you may not be able to open the web interface, so you cannot fix it from the UI.
You need to free space quickly without deleting the data you keep for investigations, and then change the retention settings so the problem does not return.
How it works
By default Trisul stores all its data under /usr/local/var. Each context has its own data directory on each node. For the default context the directory name is context0; a named context uses context_<name>.
| Node | Data | Directory for the default context | Retention is set by |
|---|---|---|---|
| Probe | Packet captures (PCAP) | /usr/local/var/lib/trisul-probe/domain0/probe0/context0/caps | Disk space: FileSizeMB × SliceCount |
| Hub | Metrics, flows, alerts | /usr/local/var/lib/trisul-hub/domain0/hub0/context0/meters | Days: SliceCount with a DAILY slice window |
Both directories hold three storage areas: oper, ref and archive. Trisul writes new slices in oper. As slices age they slide into ref, then into archive, and are then deleted as the SlicePolicy specifies. A storage area can live on another volume: Trisul moves slices into it in the same way.
To free space you move one or more of these areas to a new volume. There are two ways:
relocate contextintrisulctl_probeortrisulctl_hubmoves the whole data directory of a context (Probe: packet captures, configuration database and logs; Hub: the database slices, configuration database and logs) to the new volume and rewrites the paths in the configuration file.- Move by hand: you move one storage area, for example
archive, to the new volume and leave a symbolic link with the same name in the old location. Trisul keeps using the old path.
With the default Probe SlicePolicy the archive area holds 0 slices (8 in oper, 8 in ref). On a default install most packet data is in oper and ref, so moving archive alone may free little space.
Reference: Configure Retention Policy, Relocate Trisul Database
Figure: Storage areas before and after a manual move (Part C)
Slices slide from oper to ref to archive. After a manual move, each archive path is a symbolic link (dashed) to a directory on the new volume, and Trisul keeps writing through it.
Prerequisites
- Root shell access to the Probe node and the Hub node. On a single-node install they are the same server.
- A new disk or partition with enough free space for the data you will move.
- For
relocate context: the target directory must already exist, and its file system must have at least 1.1 times the current size of the context data free. The move can take a long time on a large database, so run it inside ascreenortmuxsession. - For a manual move: stop the context first, as
relocate contextdoes before it moves data. Runtrisulctl_huband enterstop context default.
Procedure
Part A is needed in every case. Then use Part B (one command per node) or Part C (move storage areas by hand). Finish with Part D so the disk does not fill again.
Part A – Mount a new volume
- Create a new partition with enough space.
- Mount it, for example on
/mnt/trisul_extra.
Part B – Move all data of a context with relocate context
This moves the oper, ref and archive areas of a Probe context, with its configuration database and logs, in one step.
- On the Probe node, start the Probe control utility:
/usr/local/bin/trisulctl_probe
- Run
relocate contextfor the context. For the default context:
relocate context domain0 probe0 default
- The command stops the context if it is running, then shows the current location and size and asks for the new location. Enter the mount point of the new volume:
Current DB Root is at : /usr/local/var
Current size : 5.67 MB
-----------------------------------------------------------------------------
Enter new location (enter to quit) : /mnt/trisul_extra
- Review the summary and type
YESat theConfirm (Enter YES/no) ? :prompt. Do not interrupt the move. - On a single-node install, also relocate the Hub data. Start
/usr/local/bin/trisulctl_huband run:
relocate context domain0 hub0 default
- Restart the context. In
trisulctl_hub, run:
restart context default
quit
- Restart the web server:
systemctl restart webtrisuld
Check: The command ends with ** Successfully relocated context [context0] to [/mnt/trisul_extra/]. Run df to confirm the old disk has space again.
Part C – Move storage areas by hand
Move one storage area at a time and check the result after each move.
- Move the Probe
archivearea to the new volume and leave a symbolic link in its place:
cd /usr/local/var/lib/trisul-probe/domain0/probe0/context0/caps/
mv archive /mnt/trisul_extra/probe_archive
ln -sf /mnt/trisul_extra/probe_archive archive
- Run
dfand check how much disk is now free. - If not enough disk is free, repeat step 1 for the
refarea:
cd /usr/local/var/lib/trisul-probe/domain0/probe0/context0/caps/
mv ref /mnt/trisul_extra/probe_ref
ln -sf /mnt/trisul_extra/probe_ref ref
- Run
dfagain. If more space is still needed, repeat step 1 for theoperarea in the same way.
Check: If disk usage has dropped to about 70–80%, you can stop here and skip step 5.
- If you still need space, move the Hub
archivearea to the new volume and leave a symbolic link in its place:
cd /usr/local/var/lib/trisul-hub/domain0/hub0/context0/meters/
mv archive /mnt/trisul_extra/hub_archive
ln -sf /mnt/trisul_extra/hub_archive archive
- Restart the web server:
systemctl start webtrisuld
- Start the Trisul components. Run
trisulctl_huband enterstart context default.
Part D – Tune the SlicePolicy so the disk does not fill again
Set retention so that the data fits on the disk with room to spare.
- On the Probe, open
/usr/local/etc/trisul-probe/domain0/probe0/context0/trisulProbeConfig.xmlas root. Packet storage isFileSizeMB(the size of each PCAP file, maximum 8000) multiplied by the totalSliceCountofOperational,ReferenceandArchive. The default is 1000 MB × (8 + 8 + 0) = 16 GB. LowerFileSizeMBor the slice counts to fit your disk. - Restart the Probe from Context: default → Admin Tasks → Start/Stop Tasks.
- On the Hub, open
/usr/local/etc/trisul-hub/domain0/hub0/context0/trisulHubConfig.xmlas root. InSlicePolicy, eachSliceCountis a number of days with the defaultDAILYwindow. The default is 32 + 32 + 32 = 96 days. Lower the counts to keep fewer days. - Save the file. You do not need to restart the Hub: the
trisul_archivertask runs every night at 12:00 AM and applies the new slice counts. - Optional: set
UsageRedMarkto a percentage to get an alert when disk usage crosses it. In the Probe template it is90for each packet storage area; on the Hub it is blank (disabled) by default.
Reference: Trisul Probe Configuration: SlicePolicy, Trisul Hub Configuration: SlicePolicy
For large deployments, also follow these practices:
- Run Trisul for 3–4 days to measure data growth per day, and size the disks from that. Context: default → Admin Tasks → Storage Status shows the disk space used per day.
- Prefer the XFS file system over EXT4, because it supports a large number of inodes.
- Use LVM, so you can expand a full volume by adding disk capacity.
- Use RAID-0 for Probe PCAPs, for higher write performance, and RAID-5 for the Hub, for resilience.
- In large enterprises, mount
archiveon a NAS if you have one. - Use PCAP pruning rules, for example to stop storing video streaming packets.
Verify the result
- Run
dfon each node. Usage on the original disk should be well below 100%. At about 70–80% you can stop moving data. - Open the web interface. Log in as
adminand check on Context: default → Admin Tasks → Start/Stop Tasks that the Hub and the Probe are running. - Open Context: default → Admin Tasks → Storage Status. In Storage Pools, check Disk Free for each pool. After the nightly archiver run, Configured Days shows the Hub retention you set in Part D.
Troubleshooting
| Symptom or message | Cause | Fix |
|---|---|---|
The target directory does not exist, please create the directory and retry 'reloc context..' | The location you entered for relocate context does not exist | Create and mount the directory, then run the command again. |
Not enough space on new directory. Need <size> available <size> | The new file system has less than 1.1 times the current size of the context data free | Use a larger volume, or move single storage areas by hand (Part C). |
Error: Invalid context <name> in :<domain>/<node> | The context name is wrong | Use default for the default context, or the name of the named context. |
X ERROR! Unable to find mount point/root directory : <path> | The current data root of the context is not reachable | Mount the directory and retry, or migrate the configuration files manually. |
Moving the Probe archive area freed almost no space | With the default Probe SlicePolicy, archive holds 0 slices | Move ref, and then oper if needed (Part C, steps 3 and 4). |
| The Hub disk keeps filling although the slice counts fit | DeleteMode Type in trisulHubConfig.xml is MANUAL, which disables automatic deletion of old slices | Set Type back to AUTO (the default). If you use TRASH, set TrashLocation and consider MaxTrashDiskPercentage. |
Limitations
- Moving data frees space but does not change retention. Without Part D the disk fills again.
- Lowering a
SliceCountdeletes the oldest slices for good. AnArchiveSliceCountof 0 means slices are deleted when they leaveref. - A lower Hub
SliceCounttakes effect at the next nightly archiver run (12:00 AM), not immediately. relocate contextmoves the whole context. To move only one storage area, use Part C.- The paths in Part C are for the default context. A named context uses
context_<name>in place ofcontext0.
Related
- Relocate Trisul Database
- Configure Retention Policy
- Storage Status
- Start and Stop Trisul
- Trisul Probe Configuration and Trisul Hub Configuration
- Controlling Packet Storage
- Glossary: OPER, REF, and ARCHIVE, Retention Policy, Context
- AN-009 – Tune database usage