4 minute read
LambdaStack backup design document with details
Affected version: 0.7.x
Goals
This document is extension of high level design doc: LambdaStack backup design document and describes more detailed, operational point-of-view of this case. Document does not include Kubernetes and Kafka stack
Components
lsbackup application
Example use:
Where -b
is path to build folder that contains Ansible inventory and -t
contains target path to store backup.
backup
runs tasks from ansible backup role
build_dir
contains cluster's ansible inventory
target_path
location to store backup, see Storage section below.
Consider to add disclaimer for user to check whether backup location has enough space to store whole backup.
Storage
Location created on master node to keep backup files. This location might be used to mount external storage, like:
- Amazon S3
- Azure blob
- NFS
- Any external disk mounted by administrator
In cloud configuration blob or S3 storage might be mounted directly on every machine in cluster and can be configured by LambdaStack. For on-prem installation it's up to administrator to attach external disk to backup location on master node. This location should be shared with other machines in cluster as NFS.
Backup scripts structure:
Role backup
Main role for backup
contains ansible tasks to run backups on cluster components.
Tasks:
-
Elasticsearch & Kibana
1.1. Create local location where snapshot will be stored: /tmp/snapshots 1.2. Update elasticsearch.yml file with backup location
```bash path.repo: ["/tmp/backup/elastic"] ```
1.3. Reload configuration 1.4. Register repository:
1.5. Take snapshot:
This command will create snapshot in location sent in step 1.2
1.5. Backup restoration:
Consider options described in opendistro documentation
1.6. Backup configuration files:
-
Monitoring
2.1.1 Prometheus data
Prometheus
delivers solution to create data snapshot. Admin access is required to connect to application api with admin privileges. By default admin access is disabled, and needs to be enabled before snapshot creation. To enable admin access--web.enable-admin-api
needs to be set up while starting service:Snapshot creation:
By default snapshot is saved in data directory, which is configured in Prometheus service configuration file as flag:
Which means that snapshot directory is creted under:
After snapshot admin access throuh API should be reverted.
Snapshot restoration process is just pointing
--storage.tsdb.path
parameter to snaphot location and restart Prometheus.2.1.2. Prometheus configuration
Prometheus configurations are located in:
2.2. Grafana backup and restore
Copy files from grafana home folder do desired location and set up correct permissions:
2.3 Alert manager
Configuration files are located in:
File
alertmanager.yml
should be copied in step 2.1.2 if exists -
PostgreSQL
3.1. Basically PostgreSQL delivers two main tools for backup creation: pg_dump and pg_dumpall
pg_dump
create dump of selected database:pg_dumpall
- create dump of all databases of a cluster into one script. This dumps also global objects that are common to all databases like: users, groups, tablespaces and properties such as access permissions (pg_dump does not save these objects)3.2. Database resotre: psql or pg_restore:
3.3. Copy configuration files:
-
RabbitMQ
4.1. RabbitMQ definicions might be exported using API (rabbitmq_management plugins need to be enabled):
Import backed up definitions:
or add backup location to configuration file and restart rabbitmq:
4.2 Backing up RabbitMQ messages To back up messages RabbitMQ must be stopped. Copy content of rabbitmq mnesia directory:
Restoration: place these files to similar location
4.3 Backing up configuration:
Copy
/etc/rabbitmq/rabbitmq.conf
file -
HAProxy
Copy /etc/haproxy/
to backup location
Copy certificates stored in /etc/ssl/haproxy/
location.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.