Amanda Test Backup System

 




Major reference: the 15-min backup solution
My test configuration is shown in Figure 1 with one Amanda server and 3 clients.
    

Figure 1: Test configuration.

Download and installation 

Amanda version

Download link
The following versions were / are used in our lab.

Redhat Enterprise 5.0     
amanda-backup_server-2.6.0p1-1.rhel5.i386.rpm     May 14 2008      1.51 Mb
amanda-backup_client-2.6.0p1-1.rhel5.i386.rpm      May 14 2008      1.05 Mb
amanda-backup_server-2.6.1p1-1.rhel5.i386.rpm     April 10 2009      1.92 Mb
amanda-backup_client-2.6.1p1-1.rhel5.i386.rpm      April 10 2009      1.63 Mb

If in the Linux commend line interface, the files can be download using:
wget <url>
which downloads the file to current directory.


Installation

       Guide: Basically, here we use the root user to install the rpm
       System requirement checklist
        Tips: if there are some softwares that are not in the computer yet, can use yum to download and install before going through the long and troublesome procedures of finding software, unzip, configuration and installation.

       Amada server is installed on wendy, clients are installed in web1 and web2.

Create a user if install using source

(Automatically created when installing the server or client using rpm.)
    Default user: amandabackup (Defined by the CLIENT_LOGIN parameter)
    User Name: amandabackup
    Pass word: amanda
    UserID: 501
    Primary group: disk
    Full name: Amanda
    Login shell: /bin/sh
    Home dir :  /var/lib/amanda
    In amadabackup's home dir /var/lib/amanda .profile
        export PATH = "$PATH:/usr/sbin"



Configuring Internet services on the Amanda server

   inetd and xinetd xinetd configuration attributes
   Reference

    The following file is fould in /etc/xinetd.d/amandaserver. This file is automatically generated upon installation using rpm.

# default: on
#
# description: Amanda services for Amanda server and client.
#

service amanda
{
        disable         = no
        flags           = IPv6
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = amandabackup
        group           = disk
        groups          = yes
        server          = /usr/libexec/amanda/amandad
        server_args     = -auth=bsdtcp amdump amindexd amidxtaped
}

Note: server = /usr/libexec/amanda/amandad is the actual place we can find amandad on the server. If not sure where it is, do a search on the server. Some install put it in /usr/lib/amanda and that causes me a lot of pain to find out what is the problem that I kept getting error message from amcheck.


Collecting information

      amadamin is at wendy, /usr/sbin. We can use this commend to collect the information of the build, paths and default settings.

         # amadmin x     version
or      # amadmin daily version
or      # amadmin test  version  
  
    As installed using binary package, need to use the amadmin command piped to grep to determine the Amanda parameters.
    Some important directories:
    The config files:  /etc/amanda/<config set folder name>/
    The log files:      /var/log/amanda/<config set folder name>/
    The home folder:/var/lib/amanda/
    And some command to find out the amanda system folder locations:

    # amadmin amanda version | grep CLIENT_LOGIN
       USE_AMANDAHOSTS CLIENT_LOGIN="amandabackup" CHECK_USERID
    # amadmin amanda version | grep CONFIG_DIR
       AMANDA_DBGDIR="/var/log/amanda" CONFIG_DIR="/etc/amanda"
    # amadmin amanda version | grep AMANDA_DBGDIR

       AMANDA_DBGDIR="/var/log/amanda" CONFIG_DIR="/etc/amanda"
    # amadmin amanda version | grep libexecdir

       libexecdir="/usr/libexec"
       amlibexecdir="/usr/libexec/amanda" mandir="/usr/share/man"
    # amadmin amanda version | grep listed_incr_dir

       listed_incr_dir="/var/lib/amanda/gnutar-lists"

Configuring the backup server

After rpm installation, the user amandabackup and the Amanda related xinetd entry has been created. The xinetd entry can be found at /etc/xinetd.d/amanda.

Refer to the the Amanda chapter in "Backup & Recovery" by W. Curtis. Preston, there are 10 steps to configure the server.

   1. Create the Amanda configuration directory /etc/amanda/(config name) (in case you use Zmanda packages).
   2. Copy a sample of amanda.conf into /etc/amanda/(config name).
       Note: there are several sample amanda.conf files in the home directory of amandabackup. They can be found at the folder ~/sample/ and ~/template.d/
   3. Create a disklist file in /etc/amanda/(config name).
   4. Edit the .amandahosts file to enable authentication between client and server.
   5. Edit configuration files amanda.conf and disklist.
   6. Add client configuration to the disklist file.
   7. Set up the device (create device nodes or directories) if you are using virtual tapes.
   8. Label the media (tapes or vtapes ) using amlabel.
   9. Configure a cron job to schedule Amanda backup runs.
  10. Run amcheck to verify that there are no problems with configuration, client/server communications, the holding disk or the tape.



Configuration file name and path

    Configuration file path on the server: /etc/amanda/DailySet1/amanda.conf

    As the "DailySet1" folder is created,  we need to change the path in amanda.conf

infofile "/etc/amanda/DailySet1/curinfo"        # database filename
indexdir "/etc/amanda/DailySet1/index" # index directory
tapelist "/etc/amanda/DailySet1/tapelist" # list of used tapes
    And create a folder called tapelist in daily, curinfo and index is automatically created.
    The folder such as "daily" is important, as for commends in amanda generally requires the config name to function, it looks for the config file using the path:
        /etc/amanda/<?>/amanda.conf
       <?> for example, DailySet1.


    Create the holding dir for amanda backup using root and change the conf file, and make them accessble for amadabackup:

# mkdir -p /space/amandahold/DailySet1
# chown -R amandabackup:disk /space/amandahold
# chmod 750 /space/amandahold

Add entries in /etc/services on the server

The entries are already in the file, but better give a check. The linux clients have the same entries.
They are:
amanda    10080/udp
amanda    10080/tcp
kamanda   10081/udp
kamanda   10081/tcp
amandaidx 10082/tcp
amidxtape 10083/tcp


Creat file. amandahosts on the server

Path: /var/lib/amanda/.amandahosts
Content:
wendy.blueprint.org amandabackup amdump   (for client to recognize server, and wendy also can backup itself)
wendy.blueprint.org  amandabackup amindexd amidxtaped (for server to recognize client)
web1.blueprint.org  amandabackup amindexd amidxtaped  

Change file permissions for amanda and .amandahosts
$ chown amandabackup amanda ~/.amandahosts
$ chmod 755 amanda
$ chmod 600 ~/.amandahosts

Tell Amdanda Server who are the client

Create the file"disklist" at /etc/amanda/DailySet1/  with the contect:

# Hostname(same as the .amandahosts)   |   Directory to backup on client    |     dumptype
  web1.blueprint.org             /var/www/html             comp-user-tar
    archie.blueprint.org  /backuptest

Configuring the backup client: normal, Linux

Machine in use: web1
1. Using root user to install the client rpm package.
2. User amandaback (group: disk) is created after the installation
3. The xinetd file is created in /etc/xinetd.d/  file name: amandaclient

service amanda
{
        disable         = no
        flags           = IPv6
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = amandabackup
        group           = disk
        groups          = yes
        server          = /usr/libexec/amanda/amandad
        server_args     = -auth=bsdtcp amdump
}

4. Reload xinetd service:  $service xinetd reload
5. Have host added at /var/lib/amanda/.amandahosts  (ower: amandabackup on web1, chmod 700)

   
wendy.blueprint.org amandabackup amdump


Configuring the backup client: encryptd, Linux

Machine in use: archie

Before install

archie needs xinetd.
Download xinetd-2.3.14 from here
But it require gcc.
So I have to do this:
    yum install gcc
Actually, instead I only need to do this....(but i didnt know earlier....33M big package for gcc has already started... T_T another 15min for just a small package of 124kb)
    yum -y install xinetd

Steps

1. Using root user to install the client rpm package.
    rpm -ivh <software.rpm>
2. User amandaback (group: disk) is created after the installation
3. Add xinetd file (auto add by the rpm, but just do a check.)
4. Restart xinetd
5. su - amandabackup (change user)
   Add one line at .amandahost file (to know who is the server)
    wendy.blueprint.org amandabackup amdump
    And chmod 700 for this file
    chmod 700 /var/lib/amanda/.amandahosts
6. Create a hidden file .am_passphase
    weiwei
    chown amandabackup:disk ~amandabackup/.am_passphase
    chmod 700 ~amndabackup/.am_passphase
7. As root user, create a script that enables encryption on the client archie
    I use the original one.
    And chown, chmod 700 for this file

Configuring the backup client: normal, Windows

Machine in use: web2 (192.168.10.213) change the hard disk mia which has windows system on it.

Before install

    The concept is that my Linux machine wendy can share the files on windows machine web2. Then Amanda can backup the Linux folder which is shared from Windows machine.
    There are two ways to do Amanda backup in Windows machine. The first one you have to set up sharing on Windows and use Samba on Linux to talk to Windows. This method requires the user to know how to create user and share on Windows and then adding the share to Amanda. The second method is much simple, using the Amanda Windows client.

    The first method can refer to this web page:  https://wwws.cs.ait.ac.th/cgi-bin/amanda/amanda
    The second method using the reference here: http://wiki.zmanda.com/index.php/Windows_client

Here are my brief steps of setting up Windows client using bsdtcp.

Steps

1. Download: AmandaBackupClient-2-5-2p1.msi
2. Pre Installation check:
    The server is wendy.blueprint.org
    The config set is DailySet1
    The authentication method is bsdtcp
3. Installation
    Page2: Select the method
.
    Page3: Sever----------------------------------wendy.blueprint.org
               Configuration-----------------------DailySet1
               ServerID for ssh-------------------amandabackup (ignore because we are using bsdtcp)
    Page4:Account name---------------------WEB2
    Confirm and install: the following file can be found on c://cygwin/tmp/amana/amanada_install.log


    Enter password: amanda


    to change password, using:
    net user amandabackup <new password>
    net user amandaroot <new password>

4. What have been done using the client installing
(1)Two users are created in Windows machine:
    
    amandabackup
        amandaroot
    They are under the groups: Administrators, Backup Operators, Users.
    Password: amanda
    Home: C:\cygwin\var\lib\amanda
(2)The files location:
    amanda-client.conf  C:\cygwin\etc\amanda\
    amanda-client.conf  C:\cygwin\etc\amanda\DailySet1
    .amandahosts        C:\cygwin\var\lib\amanda

   
Add this line to .amandahosts on WEB2
    wendy.blueprint.org   amandabackup    amdump


5. Changes in backup server wendy
    Add this line to .amandahosts on wendy:
    web2.blueprint.org   amandabackup    amindexd    amidextaped
    Add this line to /etc/amanda/DailySet1/disklist on wendy:
    web2.blueprint.org   C://cygwin/music    root-tar
   
    Note: we don't need to make "share" on Windows machine.

6. Run amcheck DailySet1 on the server.
Comments