RHEL5 + Amanda

Source: Internet
Author: User
RHEL5 + Amanda-Linux Enterprise Application-Linux server application information. The following is a detailed description. Required kits:
Amanda-2.5.0p2-4.i386.rpm
Amanda-devel-2.5.0p2-4.i386.rpm
Amanda-client-2.5.0p2-4.i386.rpm
Amanda-server-2.5.0p2-4.i386.rpm
# Rpm-ivh amanda-2.5.0p2-4.i386.rpm
Warning: amanda-2.5.0p2-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
1: amanda ####################################### #### [100%]
# Rpm-ivh amanda-devel-2.5.0p2-4.i386.rpm
Warning: amanda-devel-2.5.0p2-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
1: amanda-devel ##################################### ###### [100%]
# Rpm-ivh amanda-server-2.5.0p2-4.i386.rpm
Warning: amanda-server-2.5.0p2-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
1: amanda-server ##################################### ###### [100%]
# Rpm-ivh amanda-client-2.5.0p2-4.i386.rpm
Warning: amanda-client-2.5.0p2-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
1: amanda-client ##################################### ###### [100%]
#

1. Client Configuration
1. Start the amanda Service
Edit the/etc/xinetd. d/amanda file on the client and change "disable = yes" to "disable = no" as follows:
Service amanda {socket_type = dgram protocol = udp wait = yes user = amanda group = disk server =/usr/lib/amanda/amandad disable = no}
Save and exit. Restart the xinetd service.

# Service xinetd restart stop xinetd: [OK] Start xinetd: [OK]
2. Grant the Amanda server to back up this client
# Vi/var/lib/amanda/. amandahosts
Int32 amanda
Nsroot

Write the server host name and the user name used for backup in. amandahosts (here, the Amanda server is named NS2. The account used for backup is amanda). At the same time, you also need to add the correspondence between the server and the root user to it, otherwise, the server cannot be accessed when data is restored. After setting the Host Name of the Amanda server, you must also specify the Amanda ing between the IP address of the Amanda server and the host name in the/etc/hosts file. Otherwise, the Amanda Client will not be able to access the server.

Parse the NS2.

# Vi/etc/hosts

10.0.0.100 NS2.

Ensure that the client can communicate with the server

# Ping NS2.
PING NS2. (10.0.0.100) 56 (84) bytes of data.
64 bytes from ns2.atyu30.com (10.0.0.100): icmp_seq = 1 ttl = 64 time = 0.419 MS
64 bytes from ns2.atyu30.com (10.0.0.100): icmp_seq = 2 ttl = 64 time = 0.183 MS

2. Server Configuration

The disk is used for backup, that is, disk-to-disk mode.

1./etc/amanda/DailySet1/amanda. conf

All of Amanda's backup policies and execution commands are defined through several configuration documents under the "DailySet1" directory.
The following are some parameters to be modified:

# Vi amanda. conf
Org "NS2. // set the name of the organization or organization that uses amanda.
Mailto "amanda@atyu30.com" // specifies the email address to send the report
Dumpuser amanda // specifies the user who uses the Amanda backup. The default value is amanda.
Dumpcycle 7 days // set the length of the backup cycle. The unit can also be weeks. The effect of setting 7 days and 1weeks is the same here.
Runspercycle 7 // set the number of times amanda runs in each backup cycle
Tapetype HARD-DISK // set the storage type
Labelstr "^ DailySet1-[0-9] [0-9] * $" // define the volume label format
Logdir "/var/log/amanda" // specify the log storage path, which is stored in the configuration directory of amanda by default.
Tpchanger "chg-disk" // script for changing the tape
Changerfile "/etc/amanda/DailySet1/changer "//
Tapedev "file:/amanda/DailySet1" // specify the storage location
Define dumptype root-tar {// defines the Storage Class
Global // call the global type defined earlier
Program "GNUTAR" // use GNU tar as the backup program. The default value is DUMP.
Comment "root partitions dumped with tar" // information describing this type
Compress none // No compression
Index yes // backup set cable, which must be yes (no by default); otherwise, recoverable index information cannot be found during restoration.
Priority low


} Define tapetype HARD-DISK {// define the disk type comment "disk-to-DISK" length 1000 mbytes}
2. the directory structure for creating a virtual tape is as follows: slot_root_dir-|-info |-data-> slot1/|-slot1/|-slot2/| -... |-slotn/
Slot_root_dir is the path specified by tapedev, and the value of n in slotn should be consistent with the value of tapecycle. As follows:

# Mkdir/amanda/DailySet1
# Cd/amanda/DailySet1/
# Mkdir slot1 slot2
# Touch info
# Ln-s slot1 data
# Chown-R amanda. disk/amanda
3. Add backup items. Back up the data directory on 10.0.0.1.

# Vi/etc/amanda/DailySet1/disklist
10.0.0.1/data comp-root-tar
4. Create a tapelist File

# Touch/etc/amanda/DailySet1/tapelist
# Chown amanda. disk/etc/amanda/DailySet1/tapelist
5. Create a volume label for the virtual disk, as shown in the following figure:

# Su-amanda
$/Usr/sbin/amlabel DailySet1 DailySet1-01 slot 1
Changer: got exit: 0 str: 1 file:/amanda/Dailyset1
Labeling tape in slot 1 (file:/amanda/Dailyset1 ):
Rewinding, reading label, not an amanda tape (Read 0 bytes)
Rewinding, writing label Co., DailySet1-01, checking label, done.

$/Usr/sbin/amlabel DailySet1 DailySet1-02 slot 2
6. Check Configuration Amanda comes with a tool to check the configuration file, used to check the configuration of the entire Amanda server and client.

First, create the following file:
/Etc/amanda/DailySet1 this directory first creates the following file
# Mkdir-p/etc/amanda/DailySet1/curinfo/10.0.0.1/_ var_log
# Tuoch/etc/amanda/DailySet1/curinfo/10.0.0.1/_ var_log/info
# Mkdir-p/etc/amanda/DailySet1/curinfo/localhost/_ etc
# Touch/etc/amanda/DailySet1/curinfo/localhost/_ etc/info
# Mkdir-p/etc/amanda/DailySet1/curinfo/10.0.0.1/localhost
# Mkdir-p/etc/amanda/DailySet1/index/localhost/_ etc
# Touch/etc/amanda/DailySet1/index/localhost/_ etc/info
# Mkdir-p/etc/amanda/DailySet1/index/10.0.0.1/_ var_log
# Chown-R amanda. disk/etc/amanda/DailySet1/curinfo
# Chown-R amanda. disk/etc/amanda/DailySet1/index

Permission issues are troublesome. Do not be confused.
Test:
$/Usr/sbin/amcheck DailySet1 Amanda Tape Server Host Check
-----------------------------
Holding disk/dumps/amanda: 3510768 KB disk space available, using 3408368 KB
Slot 2: read label 'dailyset1-02 ', date 'X'

NOTE: skipping tape-writable test
Tape DailySet1-02 label OK
Server check took 0.131 seconds

Amanda Backup Client Hosts Check

--------------------------------
Client check: 1 host checked in 0.100 seconds, 0 problems found
(Brought to you by Amanda 2.5.0p2)

7. the program used to back up data in Amanda is amdump, which is usually stored in cron for automatic execution. amdump does not prompt any information during Backup, you can check whether the backup is successful by checking the log file.

$/Usr/sbin/amdump DailySet1
8. restore Amanda provides an interactive amrecover tool to restore files from Amanda's backup. It requires the backup set to set the index, that is, the "index yes" setting is used, at the same time, the amandaidx and amidxtape processes must be started on the server. These two processes are also managed by xinetd. You must use the root user to restore data on the client. Before restoration, you must switch to the current directory to be restored. The usage of the Amrecover tool is as follows: # amrecover DarilySet1-s serverhost-t the-s parameter in the command above serverhost indicates the server that stores the backup SET index, and-t indicates the server where the drive is located. After successful connection, a dialog box is displayed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.