Move postgres to zippy.
This commit is contained in:
@@ -3,11 +3,17 @@ job "postgres-backup" {
|
||||
type = "batch"
|
||||
|
||||
periodic {
|
||||
cron = "22 22 * * * *"
|
||||
crons = ["22 22 * * * *"]
|
||||
prohibit_overlap = true
|
||||
}
|
||||
|
||||
group "db" {
|
||||
# Run on primary storage node (zippy) where postgres runs
|
||||
constraint {
|
||||
attribute = "${meta.storage_role}"
|
||||
value = "primary"
|
||||
}
|
||||
|
||||
task "backup" {
|
||||
driver = "raw_exec"
|
||||
|
||||
@@ -21,7 +27,7 @@ job "postgres-backup" {
|
||||
data = <<EOH
|
||||
set -e
|
||||
/run/current-system/sw/bin/nomad alloc exec -job -task=postgres postgres \
|
||||
pg_dumpall -U postgres > /data/compute/appdata/db-backups/postgresql/backup.sql && \
|
||||
pg_dumpall -U postgres > /data/services/db-backups/postgresql/backup.sql && \
|
||||
echo "last_success $(date +%s)" | \
|
||||
/run/current-system/sw/bin/curl --data-binary @- http://pushgateway.service.consul:9091/metrics/job/postgres_backup
|
||||
EOH
|
||||
|
||||
Reference in New Issue
Block a user