User Tools

Site Tools


ariel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ariel [2014/11/24 01:14] (current)
0.0.0.0 created
Line 1: Line 1:
 +====== Ariel ======
  
 +[[Category:​Hosts]]
 +[[Category:​Hosts/​Gentoo]]
 +[[Category:​VMware]]
 +
 +===== Overview =====
 +  * Type: Virtual machine
 +  * Location: [[Badger]]
 +  * URL: http://​ariel.jellybean.sihnon.net/​
 +  * Provides:
 +    * Backup server
 +
 +  * Specification
 +    * 256Mb Ram
 +    * 2x 100Mb Ethernet
 +    * 20Gb Virtual Disk
 +    * Serial port (mapped to [[Badger]]:<​tt>/​mnt/​vms/​serials/​ariel</​tt>​)
 +
 +===== Filesystems =====
 +{| class="​wikitable"​ cellspacing="​10"​
 +|+ Filesystems
 +|- 
 +! Device
 +! Size
 +! Filesystem
 +! Mount point
 +! UUID
 +! Notes
 +|-
 +| /dev/sda1
 +| 128Mb
 +| ext2
 +| /boot
 +| bb61e803-7c8e-4d0f-82fb-3193c08eae8a
 +|
 +|-
 +| /dev/sda2
 +| 256Mb
 +| swap
 +| //none//
 +| cf067b46-b24f-4a20-87ee-d87663171369
 +|
 +|-
 +| /dev/sda3
 +| 19Gb
 +| lvm
 +| //none//
 +
 +
 +|- 
 +| /​dev/​mapper/​system-home
 +| 1Gb
 +| ext3
 +| /home
 +| aa0b9d4c-5d99-4cf4-b2bf-178f92d92c28
 +
 +|-
 +| /​dev/​mapper/​system-root
 +| 8Gb
 +| ext3
 +| /
 +| 71336918-f31d-4756-a965-1476cd67b687
 +
 +|-
 +| /​dev/​mapper/​system-var
 +| 10Gb
 +| ext3
 +| /var
 +| 3cb9ca13-2d68-4faa-b93a-75037520cfa3
 +
 +|}
 +
 +===== Installation =====
 +Ariel was installed using the [[Gentoo/​Template]] VMware image.
 +
 +==== Installed software ====
 +Also see:
 +  * [[Gentoo/​VMware]]
 +
 +=== Backups ===
 +  * {{Package|direct=yes|app-arch/​par}}
 +  * {{Package|direct=yes|app-backup/​backuppc}} {{USEFlag|{{EnableFlag|samba}} {{EnableFlag|vhosts}}}}
 +  * {{Package|direct=yes|dev-lang/​perl}} {{USEFlag|{{EnableFlag|ithreads}}}}
 +  * {{Package|direct=yes|sys-devel/​libperl}} {{USEFlag|{{EnableFlag|ithreads}}}}
 +  * {{Package|direct=yes|sys-fs/​reiserfsprogs}}
 +  * {{Package|direct=yes|www-apache/​mod_perl}} {{USEFlag|{{EnableFlag|threads}}}}
 +
 +===== Configuration =====
 +==== Network ====
 +{| class="​wikitable"​ cellspacing="​10"​
 +|+ Network adapters
 +|- 
 +! Hardware
 +! Driver
 +! Device
 +! Mac
 +! IP
 +! DHCP/Static
 +|-
 +| AMD PCnet32
 +| pcnet32
 +| eth0
 +| 00:​0c:​29:​64:​fd:​b4
 +
 +| //none//
 +|- 
 +| AMD PCnet32
 +| pcnet32
 +| eth1
 +| 00:​0c:​29:​6a:​fd:​be
 +
 +| dhcp
 +|}
 +
 +==== iSCSI ====
 +Follow the instructions on [[ISCSI]] to mount a 100GB drive from [[Badger]] into <​tt>/​backups</​tt>​.
 +
 +==== NFS ====
 +Backups will be archived over to [[Athens]] in case of hardware failure on Ariel or Badger. Mount <​tt>​athens.jellybean.sihnon.net:/​raid/​backups/​archives</​tt>​ by adding the following line to fstab.
 +{{File|/​etc/​fstab|<​syntax lang="​fstab">​
 +  - NFS mounts
 +athens.jellybean.sihnon.net:/​raid/​backups/​archives ​ /​backups/​archives ​  nfs acl,​nfsvers=3,​noatime ​  0 0
 +</​syntax>​}}
 +
 +Ensure that Ariel has permissions to access the exported filesystem using Athens'​ [[https://​athens.jellybean.sihnon.net/​|webui]].
 +
 +Then start nfsmount, and ensure it autostarts on boot:
 +{{Root|<​source lang="​bash">​
 +/​etc/​init.d/​nfsmount start
 +rc-update add nfsmount default
 +</​source>​}}
 +
 +==== BackupPC ====
 +Having installed perl and libperl with thread support, several perl modules may need to be recompiled to be compatible. Re-emerge the following packages:
 +  * {{Package|direct=yes|dev-perl/​File-RsyncP}}
 +  * {{Package|direct=yes|perl-core/​Compress-Zlib}}
 +  * {{Package|direct=yes|perl-core/​Compress-Raw-Zlib}}
 +
 +BackupPC is installed with __TOPDIR__ configured as <​tt>/​var/​lib/​backuppc</​tt>​. Move the content of this directory to the backups filesystem, and recreate the path as a symlink to <​tt>/​backups</​tt>​.
 +
 +Ensure that backuppc has write access to the backups filesystem, and the archive filesytsem by running the following command after both have been mounted.
 +{{Root|<​source lang="​bash">​
 +setfacl -R -m u:​backuppc:​rwX,​d:​u:​backuppc:​rwX,​m::​rwX,​d:​m::​rwX /backups
 +</​source>​}}
 +
 +Apache needs to be run as the backuppc user so that the CGI interface can access the backups filesystems. Edit the apache configuration to change the user from apache to backuppc:
 +{{File|/​etc/​apache2/​httpd.conf|<​source lang="​apache">​
 +User backuppc
 +Group backuppc
 +</​source>​}}
 +
 +Configure backuppc'​s global settings in <​tt>/​etc/​backuppc/​config.pl</​tt>​. The following settings have been changed from the defaults:
 +{{File|/​etc/​backuppc/​config.pl|<​source lang="​perl">​
 +  - Have backuppc attempt to start new backups every hour from midnight to 7am
 +$Conf{WakeupSchedule} = [[0..7]];
 +
 +  - Allow backuppc to run 2 automated, and 2 manual backups at once
 +$Conf{MaxBackups} = 2;
 +$Conf{MaxUserBackups} = 2;
 +
 +  - Configure the dhcp pools for machines with dynamic IPs.
 +  - This information can be found in subversion, at configs:/​dhcp/​master/​dhcpd.conf
 +$Conf{DHCPAddressRanges} = [[
 +|   # servers
 +    {   ​ipAddrBase => '​10.0.0',​
 +        first => 20,
 +        last => 39,
 +    },
 +    # jellybean
 +    {   ​ipAddrBase => '​10.0.0',​
 +        first => 100,
 +        last => 129,
 +    },
 +    # unknown clients
 +    {   ​ipAddrBase => '​10.0.0',​
 +        first => 130,
 +        last => 199,
 +    },
 +    # infrastructure
 +    {   ​ipAddrBase => '​10.0.0',​
 +        first => 220,
 +        last => 239,
 +    },
 +]];
 +
 +  - By default, take a full backup once a week, and an incremental backup daily
 +$Conf{FullPeriod} = 6.97;
 +$Conf{IncrPeriod} = 0.97;
 +
 +  - Keep a history of backups in order to recover from old issues
 +  - This config keeps backups from weeks 1, 2, 4, 6, 10 and 18
 +$Conf{FullKeepCnt} = [[2,|2, 1, 1]];
 +
 +  - Make sure these backups are kept around, but clear out any older ones
 +$Conf{FullKeepCntMin} = 1;
 +$Conf{FullAgeMax} ​    = 130;
 +
 +  - Keep the full weeks worth of incremental backups, and clear out any old ones
 +$Conf{IncrKeepCnt} ​   = 6;
 +$Conf{IncrKeepCntMin} = 1;
 +$Conf{IncrAgeMax} ​    = 30;
 +
 +  - Exclude certain directories by default (can be overridden per-host).
 +$Conf{BackupFilesExclude} = [[
 +|   '/​mnt/​athens', ​ # Don't backup the NAS if it's mounted anywhere
 +    '/​proc',​
 +    '/​sys',​
 +]];
 +
 +  - Use rsync by default (can be overridden per-host)
 +$Conf{XferMethod} = '​rsync';​
 +
 +  - Send email alerts to a useful address
 +$Conf{EMailFromUserName} = '​backups@sihnon.net';​
 +$Conf{EMailAdminUserName} = '​backups@sihnon.net';​
 +$Conf{EMailUserDestDomain} = '​@sihnon.net';​
 +
 +  - URL to the CGI interface (for email alerts)
 +$Conf{CgiURL} = '​http://​backups.sihnon.net/​cgi-bin/​BackupPC_Admin';​
 +</​source>​}}
 +
 +Per-host configuration files are stored in <​tt>/​backups/​pc///​hostname///​config.pl</​tt>​. Create a directory for each host, and use the following config as a template. Be sure to check for any persistent mounts in <​tt>/​mnt</​tt>​ that might need to be excluded before allowing backuppc to run.
 +{{File|/​backups/​pc///​hostname///​config.pl|<​source lang="​perl">​
 +  - hostname
 +  - OS
 +  - Purpose
 +$Conf{RsyncShareName} = '/';​
 +$Conf{BackupFilesExclude} = [[
 +|   '/​mnt/​something',​
 +    '/​proc',​
 +    '/​sys',​
 +]];
 +
 +  - vim: set filetype=perl ts=4 expandtab:
 +</​source>​}}
 +
 +Finally, let backuppc know about each of the hosts:
 +{{File|/​etc/​backuppc/​hosts|<​syntax lang="​conf">​
 +host                            dhcp    user        moreUsers ​  # <--- do not edit this line
 +ariel.jellybean.sihnon.net ​     0       ben
 +</​syntax>​}}
 +
 +=== Archives ===
 +Have backuppc archive the most recent full backups to [[Athens]] for safekeeping. Add the following entry in the hosts file:
 +{{File|/​etc/​backuppc/​hosts|<​syntax lang="​conf">​
 +host                            dhcp    user        moreUsers ​  # <--- do not edit this line
 +athens.jellybean.sihnon.net ​    ​0 ​      ​backuppc ​               # Archive host
 +</​syntax>​}}
 +
 +Then add a per-host config file for athens to configure the archives:
 +{{File|/​backups/​pc/​athens.jellybean.sihnon.net/​config.pl|<​source lang="​perl">​
 +  - athens.jellybean.sihnon.net
 +  - NAS
 +  - Backup near-line archive
 +$Conf{XferMethod} = '​archive';​
 +
 +  - The path on the local filesystem where backups will be written
 +$Conf{ArchiveDest} = '/​backups/​archives/';​
 +
 +  - Type and level of compression used in the archive
 +$Conf{ArchiveComp} = '​none';​
 +$Conf{CompressionLevel} = 1;
 +
 +  - The amount of parity data to create for the archive
 +$Conf{ArchivePar} = 5;
 +
 +  - vim: set filetype=perl ts=4 expandtab:
 +</​source>​}}
 +
 +Now, when athens is selected in the CGI interface, an option to start an archive backup is available. To run the archive, chose this option, and select the desired hosts. The defaults on the final page of the wizard are acceptable, having been configured in the athens config file, so just click start.
 +
 +===== Hardware =====
 +==== lspci ====
 +<​code>​0@@</​code>​
ariel.txt · Last modified: 2014/11/24 01:14 by 0.0.0.0