-
Amanda
安装
网
上关于
amanda
的教程很多,
但基
本安装平台都在
Centos7.0
前,
我的平台是
7.0
的,
所以各种各样
的问题出现在我安装的过程中,差点放弃!为了自已可以温习和大家
少走弯路,把自已的安装过程写下来。
1.
首先
配置
hosts
文件,如下图:
p>
172.16.0.94
为客服端,
172
.16.6.69
为服务端。
然后把
hosts
文件复制到服务端
#scp /etc/hosts 172.16.6.69:/etc/hosts
输入密码完成复制。
2.
客服端安装软件包:
#yum
install
–
y AmandaAmanda-
develAmanda-client
3.
#Vim /etc/xinetd.d/Amanda
很多教程中
socket_type = dragm
protocol = udp
不知道为什么,我做的时候出错,
看了一些国外的方法,我
把
客服端和服务端改成一样了,还
有
server
中
lib
和
lib64
要注意,好像
7.0
后只有
64
位了,编辑完成后重
启
xinetd
#systemctl restart
xinetd
4.#vim
/var/lib/Amanda/.amandahosts
5.
创建要备份的文件夹
#mkdir data
#cd /data
#touch 1 2 3
#
测试用,随意建
< br>我们要注意
amanda
这个用户,
安装软件后我们生成的用户为
amandabackup,
是没有
amanda
这个用户的,所以我们在
< br>/etc/passwd
中加:
6.
服务端安装:
#yum install
–
y amandaAmanda-server
Amanda-devel
7.#scp
172.16.0.94:/etc/xinetd.d/Amanda
/etc/xinetd.d/Amanda
//xinetd
配置
和客服端相同。
#systemctl restart xinetd
//
重启进程
8.#vim
/var/lib/Amanda/.amadahosts
9.
修改
amanda
配置文件
p>
#vim /etc/amanda/DailySet1/
org
设置使用
amanda
的单位或者机构的名称
mailto
指定将报告发送的邮件地址
dumpuseramanda //
指定使用
Amanda
备份的用户,默认为
amanda
用户
dumpcycle 7days /
/
设置备份周期的长度,单位也可以是
weeks
,在这里设置
7days
和
1weeks
的效果是一样的。
runspercycle 8 //
设置每个备份周期内
p>
amanda
运行的次数
tapetype HARD-DISK
//
设置存储类型
labelstr
定义卷标格式
logdir
//
指定日志存放路径,默认存放在
amanda
配置目录
下
tpchanger
更换磁带的脚本
changerfile
tapedev
指定存储位置
define
dumptype root-tar { //
定义转存储类
global //
调用前面定义的
g
lobal
类型
program
使用
GNU
tar
作为备份程序,默认是
DUMP
comment
描述该类型的信息
compress
none
//
不采用压缩
index
yes
//
备份集索,必须为
yes(
默认为
no)
,
否则在恢复的时候将不能找到可恢复的索引信息
priority low
}
define tapetype HARD-DISK {
//
定义磁盘类型
comment
length 1000 mbytes
}
9.
创建虚拟磁带
#mkdir -p /amanda/DailySet1
#
中
tapedev
项
#cd /amanda/DailySet1
#for n in `seq 1 8`;domkdir
/Amanda/DailySet1/slot$${n}; done
#touch
info
#ln -s slot1 data
#
创建
链接文件
#
/amanda
#
更改目录属主,
备份时使用
amanda
用户,
必
须使其有权限
?
10.
添加备份项,这里备份
192
.168.4.138
上的
/data
目录
?
#vim
/etc/amanda/DailySet1/disklist
/data comp-root-tar
#
最后一行注
释掉
?
创建
ta
pelist
文件
#touch
/etc/amanda/DailySet1/tapelist
#
/etc/amanda/DailySet1/tapelist
?
制作虚拟磁盘卷标
与使用磁带机一样
,使用前也需要为虚拟磁盘创建卷
标
# 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 DailySet1-01, checking label, done.
< br>$$for
((
i=2
;
i<=8
;
i++
)<
/p>
);
do
/usr/sbin/amlabel
DailySet1
DailySet1-0$$i
slot
$$i
;
done
?
建立
cu
rinfo
和
index
目录或文件<
/p>
#
与
文件定义
有关
# mkdir -p /etc/amanda/DailySet1/curinf
o/client/_var_log
# tuoch /e
tc/amanda/DailySet1/curinfo/client/_var_log/info
p>
#mkdir /etc/amanda/DailySet1/
curinfo/client/_data
#touch
/etc/amanda/DailySet1/curinfo/client/_data/info#
mkdir -p
/etc/amanda/DailySet1/index/cl
ient/_var_log
#mkdir /etc/am
anda/DailySet1/index/client/_data
# chown -R
/etc/amanda/DailySet1/curinfo
#
权限更改很重要
# chown
-R /etc/amanda/DailySet1/index
?
创建
holding disk
位置,
文件需求
#mkdir
/dumps/amanda
#chown -R
/dumps
11.#vim
/etc/Amanda/DailySet1/
12.
配置测试
测试使用的命令为
amcheck
,必须
su
到
amanda
用户
#su - amanda
$$
/usr/sbin/amcheck DailySet1
#
默认检查选项
cs
Amanda
Tape Server Host Check
-----------------------------
Holding disk /dumps/amanda: 188781820
KB disk space available, using
188679420 KB
slot 1: read
label `DailySet1-01', date `X'
NOTE:
skipping tape-writable test
Tape
DailySet1-01 label ok
Server check took
0.105 seconds
Amanda Backup Client
Hosts Check
--------------------------------
Client check: 1 host checked in 0.000
seconds, 0 problems found
(brought to
you by Amanda 2.5.0p2)
显示如上则表示配置无误
附:
amcheck
命令选项
amcheck
(
su -
amanda
)默认时为
-cs
-s
检测服务端状态及磁带状态
-c
检测客户端状态
-l
服务端测试
-t
< br>服务端
tape
测
-m
有错误时发送
mail
给用户(
mailto
)
-a
发送
mail
给用户
-M
+mailadderss
需求测试
?
备份测试
#su - amanda
$$/usr/sbin/amdump DailySet1
#
按照
DailySet1
设置备份数
据
$$cat
/etc/amanda/DailySet1/log.20100930.0
#
备份完成无提示,可以查看日志文件
DISK planner client /data
START planner date 20100930
START driver date 20100930
STATS driver startup time 0.039
FINISH planner date 20100930 time 0.127
START taper datestamp 20100930 label
DailySet1-01 tape 0
SUCCESS
dumper
client
/data
20100930
1
[sec
0.025
kb
34
kps
1320.9
orig-kb
100]
SUCCESS chunker client /data 20100930 1
[sec 0.061 kb 34 kps 1070.8]
SUCCESS
taper client /data 20100930 1 [sec 0.002 kb 96 kps
41308.1 {wr:
writers 3 rdwait 0.000
wrwait 0.000 filemark 0.000}]
INFO
taper tape DailySet1-01 kb 96 fm 1 [OK]
FINISH driver date 20100930 time 0.365
?
创建
cr
on
周期任务
# crontab -u amanda -e
#
如下:
* 1 * * *
/usr/local/sbin/amdump DailySet1
附:
amdump
命令及
amcleanup
命令
amdump
amdumpconfig [host[disk...]...]
一般放在
cron
周期事务中
< br>
example
:
runsamdump every weeknight at 1 a.m. as
user bin:
0 1 * * 1-5 bin
/usr/local/sbin/amdump daily
#daily
为配置名称
注意两点:
1
、
waiting for
hold file to be removed
2
、
amdump or
amflush is already running, or you must run
amcleanup
amcleanup
-
-
-
-
-
-
-
-
-
上一篇:SVN备份还原操作手册
下一篇:动物营养与饲料学