Closed Bug 1032408 Opened 10 years ago Closed 8 years ago

Add check_postgres_backups to puppet

Categories

(Data & BI Services Team :: DB: MySQL, task)

x86
macOS
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mpressman, Assigned: mpressman)

References

Details

(Whiteboard: [data: monitoring help])

Add check to puppet
Assignee: server-ops-database → mpressman
Depends on: 914218
The check is in puppet committed in revision 89748. Next step is to add the check to the service group
Whiteboard: [ monitoring ]
Whiteboard: [ monitoring ] → [data: monitoring]
Product: mozilla.org → Data & BI Services Team
Looks like the check is in modules/nrpe/files/plugins/check_postgres_backups and it's using the old-style "check that a file has all the right stuff in it."

However, on backup4 in phx, that file doesn't exist:
[root@backup4.db.phx1 ~]# cat /var/run/backup-status
cat: /var/run/backup-status: No such file or directory

In addition, we no longer check backups that way - we directly connect to the database instances and check raw and sql backups, in 2 separate checks.

Compare how these checks are run:
check_raw_backups_dd
check_sql_backups_dd

They rely on a file with all the instance names in them; I'm not sure if the postgres backups have an equivalent.
Whiteboard: [data: monitoring] → [data: monitoring help]
phx backups live on backup4.db.phx1.mozilla.com:
/data/backups/INSTANCE/pgdumps/VERSION/main/DBNAME-db-DATE.dump

e.g.
/data/backups/generic/pgdumps/9.2/main/air_mozilla_org-db-20160611.dump

AND
/data/backups/INSTANCE/pgbasebackups/VERSION/DATE

e.g. 
/data/backups/generic/pgbasebackups/9.2/2016072003
So, we need 2 checks - one for pgdumps and one for pgbasebackups. Created bugs 1288800 and 1288801 for those checks, for the MOC.

I have started the puppetization of backups - for right now, I have made /etc/sysconfig/postgres-backup-clusters, ensured the /data structure exists (e.g. /data/INSTANCE/pgdumps and /data/INSTANCE/pgbasebackups) and /usr/local/bin/backup_postgres.sh.

Will continue next week with the puppetization of backups, since that's also needed for the onboarding documentation.
puppetized base backup script to /usr/local/bin, and the cron and variable scripts for the base backups in /etc/cron.d/ and /usr/local/bin. Need to see if they worked tomorrow, not sure they all will, some variables are hard-coded and I ran out of time to make sure they all are right.
pgbasebackups are puppetized appropriately. Will check they worked automatically overnight.

Working on pgdump puppetization now.
pgdump puppetized.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
adding :arr as a cc, as the pgdump puppetization necessitated puppetagain1 to be the master, as documented https://mana.mozilla.org/wiki/display/BIDW/How+to+onboard+a+new+Postgres+server#HowtoonboardanewPostgresserver-Backups
You need to log in before you can comment on or make changes to this bug.