Amanda安装配置流程

2009年做过和Amanda相关的工作,文章挺分散,在这里集中整理一下。
Amanda安装配置流程
2010-03-09 10:25
作为整个工程的第一步,记录整个安装流程和配置文件的修改,尤其是配置文件的管理,这在后面是非常重要的环境。
-------------START---------------
到官网http://www.zmanda.com/ 下载所需版本的服务器端与客户端。
软件版本 2.6.0p2
本次应用环境为:
                                            主机名                           IP                代号
-------------------------------------------------------------------------------------------------------
   服务器端   :red hat 企业版5.1 32位     | localhost155.AmSer    |     192.168.1.155    |      SER
Linux客户端 :red hat 企业版5.1 32位 | Amanda11               |     192.168.1.154    |      CLT
Windows客户端 :Windows xp SP3         | HUST-VINDA             |     192.168.1.151    |      WIN
-------------------------------------------------------------------------------------------------------


一、主机SER安装与配置
第一步 安装xinetd与服务器端
[root@localhost155 ~]# rpm -ivh xinetd-2.3.14-11.i386.rpm

[root@localhost155 ~]# rpm -ivh amanda-backup_server-2.6.0p2-1.rhel5.i386.rpm
(省略...)
Amanda installation log can be found in '/var/log/amanda/install.log' and errors (if any) in '/var/log/amanda/install.err'.

第二步 修改用户amandabackup的密码
[root@localhost155 ~]# passwd amandabackup
Changing password for user amandabackup.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

第三步 创建vtapes
   @1@ 创建vtape目录和解决方案目录。并修改所有者与权限
[root@localhost155 ~]# mkdir -p /data/amanda/vtape/DailySet1
[root@localhost155 ~]# chown -R amandabackup:disk /data/amanda/vtape/DailySet1/
[root@localhost155 ~]# chmod -R 750 /data/amanda/vtape/DailySet1/
   @2@配置命令(并没有修改文件/etc/amanda/amanda-client.conf)
   [root@localhost155 ~]# mkdir /var/log/amanda/gnuter-lists(需要么? --不需要

   切换到用户amandabackup
[root@localhost155 ~]# su - amandabackup

   可以查看amserverconfig的选项如下
-sh-3.1$ amserverconfig
Option tapedev requires an argument
/usr/sbin/amserverconfig
         <config> [--template <template>]
        [--no-vtape] (do not create virtual tapes)
        [--tapetype <tapetype>] [--tpchanger <tpchanger>]
        [--tapedev <tapedev>] [--changerfile <changerfile>]
        [--changerdev <changerdev>] [--labelstr <labelstr>]
        [--mailto <mailto>] [--dumpcycle <dumpcycle> (ex: 5days, 1week or 2weeks)]
        [--runspercycle <runspercycle>] [--runtapes <runtapes>]
        [--tapecycle <tapecycle>]
        [--help]

使用命令进行配置
-sh-3.1$ amserverconfig DailySet1 --template harddisk --tpchanger chg-disk --tapedev /data/amanda/vtape/DailySet1
--mailto amandabackup@localhost --dumpcycle 1week --runspercycle 5 --tapecycle 12 --runtapes 1
Logging to /var/log/amanda/amserverconfig.20090709151648.debug
/etc/amanda/template.d directory created
/var/lib/amanda/gnutar-lists directory exists
/etc/amanda/DailySet1/advanced.conf created and updated
curinfo and index directory created
tapelist file created
disklist file created
Creating custom configuration using templates
custom amanda.conf created
creating vtape directory
amlabel vtapes
WARNING: Not enough space for vtapes. Creation of vtapes failed
/var/lib/amanda/example/xinetd.amandaserver contains the latest Amanda server daemon configuration.
Please merge it to /etc/xinetd.d/amandaserver.
/var/lib/amanda/.ssh/client_authorized_keys created. Please append to /var/lib/amanda/.ssh/authorized_keys file on Amanda clients
Error in creating virtual tape, please check log and create virtual tape manually.(无论如何都是这样的,所以下一步要手动创建vtape)


注意:最重要的配置文件 /etc/amanda/DailySet1/amanda.conf 是在这个时候生成的,我们可以查看其内容如下
-sh-3.1$ vim /etc/amanda/DailySet1/amanda.conf
org "DailySet1"         # your organization name for reports
mailto "amandabackup@localhost" # space separated list of operators at your site
dumpcycle 1week         # the number of days in the normal dump cycle
runspercycle 5          # the number of amdump runs in dumpcycle days
tapecycle 12    # the number of tapes in rotation
runtapes 1              # number of tapes to be used in a single run of amdump
tpchanger "chg-disk"    # the tape-changer glue script
tapedev "file://data/amanda/vtape/DailySet1"    # the no-rewind tape device
changerfile "/etc/amanda/DailySet1/changer.conf"        # tape changer configuration parameter file
changerdev "/dev/null" # tape changer configuration parameter device
tapetype HARDDISK       # what kind of tape it is
labelstr "DailySet1"    # label constraint regex: all tapes must match
dtimeout 1800   # number of idle seconds before a dump is aborted
ctimeout 30     # max number of secconds amcheck waits for each client
etimeout 300    # number of seconds per filesystem for estimates
define dumptype global {
       comment "Global {efinitions"
       auth "bsdtcp"
}
}efine dumptype gui-base {
       global            {
       program "GNUTAR"
       comment "gui base dumptype dumped with tar"
       compress none
       index yes
}
}efine tapetype HARDDISK {
       comment "Virtual T{pes"
       length 5000 mbytes
}
}ncludefile "advanced.conf"
includefile "/etc/amanda/template.d/dumptypes"
includefile "/etc/amanda/template.d/tapetypes"


@3@手动创建虚拟磁带库vtape

创建12(前面参数tapecycle确定)个目录 ,并链接
-sh-3.1$ cd /data/amanda/vtape/DailySet1/
-sh-3.1$ mkdir slot{1..12}
-sh-3.1$ ln -s slot1 data
-sh-3.1$ ls
data slot1 slot10 slot11 slot12 slot2 slot3 slot4 slot5 slot6 slot7 slot8 slot9

为磁带打上标签标签规则由labelstr确定


-sh-3.1$ for i in 1 2 3 4 5 6 7 8 9 ;do amlabel DailySet1 DailySet1-0$i slot $i;done
labeling tape in slot 1 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-01..
Checking label...
Success!
labeling tape in slot 2 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-02..
Checking label...
Success!
labeling tape in slot 3 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-03..
Checking label...
Success!
labeling tape in slot 4 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-04..
Checking label...
Success!
labeling tape in slot 5 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-05..
Checking label...
Success!
labeling tape in slot 6 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-06..
Checking label...
Success!
labeling tape in slot 7 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-07..
Checking label...
Success!
labeling tape in slot 8 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-08..
Checking label...
Success!
labeling tape in slot 9 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-09..
Checking label...
Success!


-sh-3.1$ for i in 10 11 12 ;do amlabel DailySet1 DailySet1-$i slot $i;done
labeling tape in slot 10 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-10..
Checking label...
Success!
labeling tape in slot 11 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-11..
Checking label...
Success!
labeling tape in slot 12 (file://data/amanda/vtape/DailySet1):
Reading label...
Found an unlabeled tape.
Writing label DailySet1-12..
Checking label...
Success!

修改服务器hosts和权限文件 (把Linux和Windows客户端也改了。。。。。windows .am~拒绝访问)
[root@localhost155 ~]# vi /var/lib/amanda/.amandahosts
localhost   root amindexd amidxtaped
localhost   amandabackup amdump
localhost.localdomain   root amindexd amidxtaped
localhost.localdomain   amandabackup amdump

Amanda11 amandabackup amindexd amidxtaped
Amanda11 root amindexd amidxtaped

hust-vinda amandaroot amindexd amidxtaped
hust-vinda Administrator amindexd amidxtaped

[root@localhost155 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1     localhost6.localdomain6 localhost6
127.0.0.1       localhost.localdomain   localhost       localhost155

192.168.1.154 Amanda11   #linux client
192.168.1.151 hust-vinda #windows client
  
修改disklist 内容

[root@localhost155 ~]# vi /etc/amanda/DailySet1/disklist
Amanda11 /mydata comp-user-tar
##hust-vinda c:/data zwc-compress   (由于这个没有,因此先按照手册上的 改配置文件)这个不必添加 Windows配置时会自动添加


@4@添加Linux客户端配置
[root@localhost155 ~]# su - amandabackup
-sh-3.1$ amaddclient --config DailySet1 --client Amanda11 --diskdev /mydata --dumptype comp-user-tar
Logging to /var/log/amanda/amaddclient.20090709195118.debug
/etc/amanda/DailySet1/disklist updated
updating /var/lib/amanda/.amandahosts on localhost155.AmSer
/var/lib/amanda/.amandahosts contains Amanda11 root, file not updated
Attempting to update /var/lib/amanda/.amandahosts on Amanda11
The authenticity of host 'amanda11 (192.168.1.154)' can't be established.
RSA key fingerprint is 7b:2a:00:58:ad:df:9b:eb:b1:2b:86:27:97:88:7b:67.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'amanda11,192.168.1.154' (RSA) to the list of known hosts.
amandabackup@amanda11's password:
.amandahosts                            100% 120     0.1KB/s   00:00  
/var/lib/amanda/.amandahosts contains localhost155.AmSer amandabackup, file not updated
Amanda11:/var/lib/amanda/.amandahosts updated successfully
Creating amanda-client.conf for Amanda11
Creating /etc/amanda/DailySet1 on Amanda11 (不要提前创建这个目录)
amandabackup@amanda11's password:
amandabackup@amanda11's password:
amanda-client.conf-Amanda11             100% 388     0.4KB/s   00:00  
Copy /var/lib/amanda/amanda-client.conf-Amanda11 to Amanda11 successfully
File /var/lib/amanda/example/xinetd.amandaclient contains the latest Amanda client daemon configuration.
Please merge it to /etc/xinetd.d/amandaclient.


@5@添加Windows客户端配置

-sh-3.1$ amaddclient --config DailySet1 --client hust-vinda --diskdev c:/ data -dumptype zwc-compress
Logging to /var/log/amanda/amaddclient.20090709200806.debug
/etc/amanda/DailySet1/disklist updated
updating /var/lib/amanda/.amandahosts on localhost155.AmSer
Attempting to update /var/lib/amanda/.amandahosts on hust-vinda
ssh: connect to host hust-vinda port 22: Connection refused
WARNING: scp from hust-vinda not successful.
Check hust-vinda:/var/lib/amanda/.amandahosts file.
If entry 'localhost155.AmSer amandabackup' is not present,
append the entry to the file manually.
Creating amanda-client.conf for hust-vinda
Creating /etc/amanda/DailySet1 on hust-vinda
ssh: connect to host hust-vinda port 22: Connection refused
WARNING: Cannot create /etc/amanda/DailySet1 on hust-vinda
Please copy /var/lib/amanda/amanda-client.conf-hust-vinda to hust-vinda manually
File /var/lib/amanda/example/xinetd.amandaclient contains the latest Amanda client daemon configuration.
Please merge it to /etc/xinetd.d/amandaclient.

你可能感兴趣的:(Amanda安装配置流程)