Thursday, August 19, 2010

Install and configure Amanda Backup Server

Amanda is one of the complex installation as it has got many features and one can be easily be confused when
installing it for first time. So i have thought of  sharing minimal installation steps to jump start your backup

First download Server and Client packages of  amanda depending on operating system you use from below
location

http://www.zmanda.com/downloads/community/Amanda/

I have taken 2 ubuntu machines 9.04

Server -- 192.168.155.108  - amanda-backup-server_3.1.0-1Ubuntu904_i386.deb
Client  -- 192.168.155.109 - amanda-backup-client_3.1.0-1Ubuntu904_i386.deb

after installation just update your repository
------------------------------------------------------------------------------------------------
On Server do this 
-----------------------------------------------------------------------------------------------


#apt-get update

then install all build essentials required for a package to install

#apt-get install build-essential

afther that install debian package

#dpkg -i  amanda-backup-server_3.1.0-1Ubuntu904_i386.deb

I've noticed that if I try to install this package it doesn't seem to work because of missing dependent librararies typing


#apt-get -f install

will solve dependency problem

After installation of that package

User amandabackup
group disk
 will be created.

add password for the user amandabackup

# passwd amandabackup

after adding user we need to create directory where our backup has to be stored.

# mkdir -p /data/amanda/vtape/DailySet1 
# chown amandabackup:disk /data/amanda/vtape/DailySet1
# chmod -R 750 /data/amanda/vtape/DailySet1



------------------------------------------------------------------------------------------------
On Client do this 
-----------------------------------------------------------------------------------------------
 Install client package same as you installed on server

here also user amandabackup will get created

change password for user amandabackup 

#passwd amandabackup

The client configuration file of amanda is

/etc/amanda/amanda-client.conf

Change this line:

tapedev    "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device
to this:

tapedev    "file://data/amanda/vtape/DailySet1" # your tape device

this is the location where we are taking backup.

after configuring  go to server again.

------------------------------------------------------------------------------------------------
On Server do this 
-----------------------------------------------------------------------------------------------

We have created a backup directory and created user amandabackup and set its password on Server
now switch user to amandabackup

# su – amandabackup

then enter this command to configure server configuration file for DailySet1

# amserverconfig DailySet1 --template harddisk --tapedev /data/amanda/vtape/DailySet1 --mailto root@localhost --dumpcycle 1week --runspercycle 5 --tapecycle 12 --runtapes 1 

the output will be:



















Now adding Client 192.168.155.109 on server give second command

Explaining:
amserverconfig : command that creates the initial Amanda configuration
daily : the name of this backup set
template disk : this backup is written to disk (or “virtual” tape -vtape-)
tapedev /var/lib/amanda/vtapes/daily : this is the path of the vtapes
mailto me@mydomain.com : Amanda emails the backup report to this address
dumpcycle 5 : This backup cycle has 5 days (lets say ... Mon to Fri)
runspercycle 1 : This backup runs only once per day
tapecycle 20 : 20 vtapes (4 weeks) on the cycle
runtapes 1 : The maximum number of tapes (in this case “vtapes”) used in a single run


# amaddclient --config DailySet1 --client 192.168.155.109 --diskdev /data/backupme --dumptype  comp-user-tar 


/data/backupme  is the directory on the client you want to take backup

output will be :

























after adding client now everything is ready we should test its working or not
we can test it using amcheck command

# amcheck DailySet1


the output will be:













Now checking is successful if you see 0 problems found in the output as shown above.
now we are ready to take first backup with the command amdump

# amdump DailySet1

This command will take backup and the status is emailed to root@localhost of server as we have configured above.

the mail will be like this :


From amandabackup@amandaserver  Tue Jul 20 15:19:10 2010
Return-Path:
X-Original-To: root@localhost
Delivered-To: root@localhost
Received: by amandaserver (Postfix, from userid 1001)
    id 98122602ED; Tue, 20 Jul 2010 15:19:10 -0400 (EDT)
To: root@localhost
Subject: DailySet1 AMANDA MAIL REPORT FOR July 20, 2010
Message-Id: <20100720191910.98122602ED@amandaserver>
Date: Tue, 20 Jul 2010 15:19:10 -0400 (EDT)
From: amandabackup@amandaserver (Amanda)

Hostname: amandaserver
Org     : DailySet1
Config  : DailySet1
Date    : July 20, 2010

These dumps were to tape DailySet1-1.
The next tape Amanda expects to use is: 1 new tape.
The next new tape already labelled is: DailySet1-2.


STATISTICS:
                                        Total       Full      Incr.
                                        --------   --------   --------
Estimate Time (hrs:min)  0:00
Run Time (hrs:min)         0:00
Dump Time (hrs:min)      0:00       0:00       0:00
Output Size (meg)            1.6        1.6        0.0
Original Size (meg)          1.6        1.6        0.0
Avg Compressed Size (%) 98.8       98.8        --
Filesystems Dumped         1          1          0
Avg Dump Rate (k/s)        163.1      163.1        --

Tape Time (hrs:min)          0:00       0:00       0:00
Tape Size (meg)                1.6        1.6        0.0
Tape Used (%)                  0.0        0.0        0.0
Filesystems Taped              1          1          0
Parts Taped                        1          1          0
Avg Tp Write Rate (k/s)    160.1      160.1        --

USAGE BY TAPE:
  Label               Time         Size      %    Nb    Nc
  DailySet1-1         0:00           0G    0.0     1     1

NOTES:
  planner: Adding new disk 192.168.155.109:/home/vxadmin.
  taper: tape DailySet1-1 kb 1601 fm 1 [OK]


DUMP SUMMARY:
                                             DUMPER STATS               TAPER STATS
HOSTNAME     DISK        L ORIG-GB  OUT-GB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
-------------------------- ------------------------------------- -------------
192.168.155. -me/vxadmin 0       0       0   98.8    0:10  163.2   0:10  160.1

(brought to you by Amanda version 3.1.0)


So you have succesfully taken backup of your first client