Database Repair

Correct issues with database

The commands listed below from least to most destructive will fix issues that can occur if the database is corrupted.

Clear Message Cache

Clearing the message cache removes and recreates the database collection used for internal communication between hosts. When the internal host communication isn't working servers may fail to start and connections my become unstable. Clearing this collection should not require stopping hosts. This can be run without impacting server availability. Hosts will automatically reset the messaging cursor shortly after running the command and resume internal messaging.

sudo pritunl clear-message-cache

Clear All Cache Data

When there is additional corruption in the database all cached data can be removed. This removes all temporary data like connection states and records for recently used authentication nonces. This data is referred to as secondary data and can be cleared with the commands below. The message cache will also be cleared when running this command. All hosts should be stopped before running this command.

sudo systemctl stop pritunl
sudo pritunl destroy-secondary
sudo systemctl start pritunl

Full Database Repair

The full database repair is the most extensive repair command and the only command that will result in configuration changes. This command will clear the client IP pools resulting in client static IP addresses being reassigned. If specific client IP addresses were relied on for networking those configurations will need to be updated. Additionally the system logs will be removed from the database, auditing history will not be removed. This command will also clear the message cache and remove all secondary cache data. All hosts should be stopped before running this command.

sudo systemctl stop pritunl
sudo pritunl repair-database
sudo systemctl start pritunl

Last updated