wiki:how-to/puppet/backups

backupninja

Puppet uses the m_backupninja class to tell servers how to make backups. This class is standard for all of our server manifests, and controls rdiff and rsync backups. In standard manifests, a version of this stanza exists, which changes based on which backup servers the server writes to.:

if ( $::fqdn == "luisa.mayfirst.org" ) or ( $::fqdn == "banks.mayfirst.org" ) {                                          
  m_backupninja::server::configure_node { "acholonu": }
}

specify backup time

Under most circumstances our cronjob for backups are randomly assigned to the servers. However, in some cases it makes sense to have the backup occur at a specific time. If you need to specify the time of backups for a server you can do that by adding backup_start_hour => "NUMBER_BETWEEN_0_AND_23" to the m_minimal declaration in the server's manifest.

  • Example from acholonu
      class { "m_minimal":                       
        location => "xo",                 
        backup_rdiff_target => "luisa.mayfirst.org",      
        backup_rsync_target => "banks.mayfirst.org",      
        backup_start_hour => "21",        
        caching_dns_ips => [ "209.234.253.224", "209.234.253.197" ]
      }    
    

mysql backups

In addition servers can backup mysql databases. By default MOSHes backup all mysql databases, and any server can be required to make daily mysql backups.

standard mysql backups

The standard mysql backup requires a single directive in the manifest file that looks like:

class { "m_backupninja::mysql": }

This stanza says, "Do a full backup of all mysql databases." However, this is not always ideal as some of these databases can grow quite large due to caching and indexing tables, particularly for Drupal databases.

truncated mysql backups

If you need to reduce the size of mysql backups, you can do so by changing the m_backupninja stanza to:

class { "m_backupninja::mysql_diet" }

This stanza uses a different backup script which calls the mf-mysql-dump script, and this removes caching and other tables from the mysqldump to ease the weight of the actual dump. If you run into problems with mysql dumps for Drupal sites, this is a good option for avoiding those problems.

Last modified 5 years ago Last modified on Jul 22, 2014, 4:31:18 PM