Backup Guide
This guide will cover how you can backup Morio configuration and data.
Types of data
We will cover the following types of data in this guide:
Configuration
We strongly recommend to backup your configuration. Or — even better — to store it in Git and use tooling like Ansible to deploy it on your systems.
Backup procedure
To backup the data, all you have to do is make a copy of the /etc/morio/moriod folder.
You should also backup /etc/system/systemd/moriod.service if you have customized it in any way.
Make sure to do this on all Morio nodes
Data
Backing up data in Morio falls apart into several categories:
- Persistent data
- Transient data pane data in the broker
- Ephemeral data in the cache
The broker data is transient, Morio is not intended as long-term storage, so you should make sure you are routing the data from the broker to your data lake using the connector service.
The cache data is entirely ephemeral.
Backup procedure
Full data backup
The persistent data is data that is stored inside containers, but mapped to folders on the host OS.
All of Morio’s persistent data is stored under /var/lib/morio/moriod.
So make a backup of that folder.
Database backup
In addition, it is worthwhile to use the database-spefic backup procedure to extract a clean copy of the database contents.
On any broker node, run the following commands to backup the database data:
sudo docker exec -it morio-db sh -c "mkdir -p /etc/rqlite/backup && echo \".backup /etc/rqlite/backup/$(date +'%Y-%m-%d_%H-%M').sqlite3\" | rqlite"
This will write a backup file to /etc/rqlite/backup inside the container,
which is mapped as /etc/morio/moriod/db/backup on the host OS.
So make sure to include the file in your backup.
The command above will name the backup file as
%Y-%m-%d_%H-%M.sqlite3, feel free to change the command to suit your needs.
Logs
There is typically no need to backup logs, in particular we recommend shipping them off-box with Morio.
Backup procedure
If you want to backup the logs, you can make a backup of /var/log/morio/moriod.