个人工具

“Quick HOWTO : Ch1 : Network Backups With Rancid/zh”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
Introduction
安装 Rancid
 
(未显示3个用户的13个中间版本)
第1行: 第1行:
{{From|https://wiki.ubuntu.com/php5}}
+
{{Translation}} {{From|http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch1_:_Network_Backups_With_Rancid}} {{Translator|落寞三少 yiding.he}} {{Languages}}  
  
{{Languages|php5}}
+
<br>
  
== Introduction ==
+
== 简介 ==
  
One of the most commonly overlooked aspects of network management is the failure to backup network device configurations. Sadly it is only viewed as being a priority after disaster strikes. Fortunately there is a Linux / Unix open source package called Rancid that can get the job done automatically for most devices that have command prompt method for configuration.
+
一个被网络管理忽略的地方是失败的网络备份硬盘的设置,悲哀的是这只是造成灾难性打击的开始。幸运的是 Linux/Unix 有一个叫 Rancid 的开源软件包。它可以自动地、用命令的方法快速完成为大多数驱动器设置备份这项工作。 这个产品可以从 [http://www.shrubbery.net/rancid/ rancid 网站] 下载得到,在 Concurrent Versions System (CVS) 中还增加旧的自动归档的好外。这个指南将会教您如何快速安装和如何为你的网络备份需要进行设置。
  
The product can be downloaded from the [http://www.shrubbery.net/rancid/ rancid website] and has the added advantage of automatically archiving the older configuration versions in a Concurrent Versions System (CVS). This tutorial will show you how to quickly install and configure it for your network backup needs.
+
<br>
 +
 
 +
== 安装 Rancid  ==
 +
 
 +
在 Fedora Linux 安装 Rancid 十分简单,但接下来还有一些简单的步骤,现在我们开始: 1. 要想使用 Rancid,你必须先安装编程语言。用 RPM 命令 -Q 查看你是否决定安装,在这里,是不可以用 yum 命令安装的。
 +
 
 +
[root@bigboy tmp]# rpm -q expect
 +
package expect is not installed
 +
[root@bigboy rancid-2.3.2a2]# yum -y install expect
 +
Repository updates-released already added, not adding again
 +
Repository base already added, not adding again
 +
Setting up Install Process
 +
...
 +
...
 +
...
 +
[root@bigboy rancid-2.3.2a2]#
 +
 +
 
 +
2)为将访问 Rancid 目录增加一个名为 netadm 的 linux 组名 。
 +
 
 +
[root@bigboy tmp]# groupadd netadm
 +
 +
 
 +
3)为了每晚能运行这个网络备份设备,我们在 netadm 工作组里新建一个名为 rancid 的用户,和新建一个目录/usr/local/rancid 。
 +
 
 +
[root@bigboy tmp]# useradd -g netadm -c "Networking Backups" -d /usr/local/rancid rancid
 +
 +
 
 +
4) 创建一个名为 /usr/local/rancid/tar 的目录并用wget命令从网站获得最新版本的Rancid压缩包
 +
[root@bigboy tmp]# mkdir /usr/local/rancid/tar
 +
[root@bigboy tmp]# cd /usr/local/rancid/tar
 +
[root@bigboy tar]# wget ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.2a2.tar.gz
 +
--01:14:26--  ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.2a2.tar.gz
 +
                      =&gt; `rancid-2.3.2a2.tar.gz'
 +
...
 +
...
 +
...
 +
100%[==============================&gt;] 280,435          153.28K/s
 +
 
 +
01:14:58 (152.78 KB/s) - `rancid-2.3.2a2.tar.gz' saved [280,435]
 +
[root@bigboy tar
 +
 +
 
 +
5) Rancid需要编译. 然后, 你需要从Rancid压缩包中解压出需要编译的文件.在这个例子里这个文件是rancid-2.3.2a2.tar.gz 所以解压出文件后将会放置在一个名为rancid-2.3.2a2. 的新生成的目录里。
 +
 
 +
[root@bigboy tar]# tar -xvzf rancid-2.3.2a2.tar.gz
 +
rancid-2.3.2a2/bin/Makefile.am
 +
rancid-2.3.2a2/bin/Makefile.in
 +
rancid-2.3.2a2/bin/alogin.in
 +
...
 +
...
 +
...
 +
rancid-2.3.2a2/man/lg.conf.5.in
 +
rancid-2.3.2a2/man/rancid.conf.5.in
 +
rancid-2.3.2a2/man/lg_intro.1.in
 +
[root@bigboy tar]#
 +
 +
 
 +
6) cd到这个目录.
 +
 
 +
[root@bigboy tar]# cd rancid-2.3.2a2
 +
[root@bigboy rancid-2.3.2a2]#
 +
 +
 
 +
7) 在这个目录里有一个名为README的文档介绍接下来该作什么.你可以用less命令阅读这个文档,参考里面给出的几种配置选项. 在这个例子中我们将会用一个非常简单的情景继续进行 .
 +
 
 +
[root@bigboy rancid-2.3.2a2]# less README
 +
 +
 
 +
8)准备用configure命令编译Rancid包.在这里--prefix 参数是用来设置默认目录为rancid用户的/usr/local/rancid/ home目录。
 +
 
 +
<br>
 +
 
 +
[root@bigboy rancid-2.3.2a2]# ./configure --prefix=/usr/local/rancid/
 +
checking for a BSD-compatible install... /usr/bin/install -c
 +
checking whether build environment is sane... yes
 +
checking for gawk... gawk
 +
...
 +
...
 +
...
 +
config.status: creating include/config.h
 +
config.status: include/config.h is unchanged
 +
config.status: executing depfiles commands
 +
[root@bigboy rancid-2.3.2a2]#
 +
 +
 
 +
9)用make命令安装。
 +
 
 +
[root@bigboy rancid-2.3.2a2]# make install
 +
Making install in .
 +
gmake[1]: Entering directory `/usr/local/rancid/tar/rancid-2.3.2a2'
 +
gmake[2]: Entering directory `/usr/local/rancid/tar/rancid-2.3.2a2'
 +
gmake[2]: Nothing to be done for `install-exec-am'.
 +
test -z "/usr/local/rancid//share/rancid" || mkdir -p -- "/usr/local/rancid//share/rancid"
 +
...
 +
...
 +
...
 +
/usr/bin/install -c 'downreport' '/usr/local/rancid//share/rancid/downreport'
 +
gmake[2]: Leaving directory `/usr/local/rancid/tar/rancid-2.3.2a2/share'
 +
gmake[1]: Leaving directory `/usr/local/rancid/tar/rancid-2.3.2a2/share'
 +
[root@bigboy rancid-2.3.2a2]#
 +
 +
 
 +
10) 这里有一个名为cloginrc.sample的样本密码文件. 你需要将它拷贝到/usr/local/rancid/ home目录作为一个隐藏文件/usr/local/rancid/.cloginrc.
 +
 
 +
[root@bigboy rancid-2.3.2a2]# cp cloginrc.sample /usr/local/rancid/.cloginrc
 +
[root@bigboy rancid-2.3.2a2]#
 +
 +
 
 +
11) 最后你需要设置.cloginrc的文件权限对rancid用户和netadm Linux group为可读.你也必须用类似的方式改变文件的所有权和家目录的权限。
 +
[root@bigboy rancid-2.3.2a2]# chmod 0640 /usr/local/rancid/.cloginrc
 +
[root@bigboy rancid-2.3.2a2]# chown -R rancid:netadm /usr/local/rancid/
 +
[root@bigboy rancid-2.3.2a2]# chmod 770 /usr/local/rancid/
 +
 +
 
 +
现在安装完成了,你需要做初始的配置以让Rancid运行。不过别担心,这是非常简单的。

2010年11月1日 (一) 08:46的最新版本



简介

一个被网络管理忽略的地方是失败的网络备份硬盘的设置,悲哀的是这只是造成灾难性打击的开始。幸运的是 Linux/Unix 有一个叫 Rancid 的开源软件包。它可以自动地、用命令的方法快速完成为大多数驱动器设置备份这项工作。 这个产品可以从 rancid 网站 下载得到,在 Concurrent Versions System (CVS) 中还增加旧的自动归档的好外。这个指南将会教您如何快速安装和如何为你的网络备份需要进行设置。


安装 Rancid

在 Fedora Linux 安装 Rancid 十分简单,但接下来还有一些简单的步骤,现在我们开始: 1. 要想使用 Rancid,你必须先安装编程语言。用 RPM 命令 -Q 查看你是否决定安装,在这里,是不可以用 yum 命令安装的。

[root@bigboy tmp]# rpm -q expect
package expect is not installed
[root@bigboy rancid-2.3.2a2]# yum -y install expect
Repository updates-released already added, not adding again
Repository base already added, not adding again
Setting up Install Process
...
...
...
[root@bigboy rancid-2.3.2a2]#

2)为将访问 Rancid 目录增加一个名为 netadm 的 linux 组名 。

[root@bigboy tmp]# groupadd netadm

3)为了每晚能运行这个网络备份设备,我们在 netadm 工作组里新建一个名为 rancid 的用户,和新建一个目录/usr/local/rancid 。

[root@bigboy tmp]# useradd -g netadm -c "Networking Backups" -d /usr/local/rancid rancid

4) 创建一个名为 /usr/local/rancid/tar 的目录并用wget命令从网站获得最新版本的Rancid压缩包

[root@bigboy tmp]# mkdir /usr/local/rancid/tar
[root@bigboy tmp]# cd /usr/local/rancid/tar
[root@bigboy tar]# wget ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.2a2.tar.gz
--01:14:26--   ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.2a2.tar.gz
                     => `rancid-2.3.2a2.tar.gz'
...
...
...
100%[==============================>] 280,435           153.28K/s
 
01:14:58 (152.78 KB/s) - `rancid-2.3.2a2.tar.gz' saved [280,435]
[root@bigboy tar

5) Rancid需要编译. 然后, 你需要从Rancid压缩包中解压出需要编译的文件.在这个例子里这个文件是rancid-2.3.2a2.tar.gz 所以解压出文件后将会放置在一个名为rancid-2.3.2a2. 的新生成的目录里。

[root@bigboy tar]# tar -xvzf rancid-2.3.2a2.tar.gz
rancid-2.3.2a2/bin/Makefile.am
rancid-2.3.2a2/bin/Makefile.in
rancid-2.3.2a2/bin/alogin.in
...
...
...
rancid-2.3.2a2/man/lg.conf.5.in
rancid-2.3.2a2/man/rancid.conf.5.in
rancid-2.3.2a2/man/lg_intro.1.in
[root@bigboy tar]#

6) cd到这个目录.

[root@bigboy tar]# cd rancid-2.3.2a2
[root@bigboy rancid-2.3.2a2]#

7) 在这个目录里有一个名为README的文档介绍接下来该作什么.你可以用less命令阅读这个文档,参考里面给出的几种配置选项. 在这个例子中我们将会用一个非常简单的情景继续进行 .

[root@bigboy rancid-2.3.2a2]# less README

8)准备用configure命令编译Rancid包.在这里--prefix 参数是用来设置默认目录为rancid用户的/usr/local/rancid/ home目录。


[root@bigboy rancid-2.3.2a2]# ./configure --prefix=/usr/local/rancid/
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
...
...
...
config.status: creating include/config.h
config.status: include/config.h is unchanged
config.status: executing depfiles commands
[root@bigboy rancid-2.3.2a2]#

9)用make命令安装。

[root@bigboy rancid-2.3.2a2]# make install
Making install in .
gmake[1]: Entering directory `/usr/local/rancid/tar/rancid-2.3.2a2'
gmake[2]: Entering directory `/usr/local/rancid/tar/rancid-2.3.2a2'
gmake[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/rancid//share/rancid" || mkdir -p -- "/usr/local/rancid//share/rancid"
...
...
...
/usr/bin/install -c 'downreport' '/usr/local/rancid//share/rancid/downreport'
gmake[2]: Leaving directory `/usr/local/rancid/tar/rancid-2.3.2a2/share'
gmake[1]: Leaving directory `/usr/local/rancid/tar/rancid-2.3.2a2/share'
[root@bigboy rancid-2.3.2a2]#

10) 这里有一个名为cloginrc.sample的样本密码文件. 你需要将它拷贝到/usr/local/rancid/ home目录作为一个隐藏文件/usr/local/rancid/.cloginrc.

[root@bigboy rancid-2.3.2a2]# cp cloginrc.sample /usr/local/rancid/.cloginrc
[root@bigboy rancid-2.3.2a2]#

11) 最后你需要设置.cloginrc的文件权限对rancid用户和netadm Linux group为可读.你也必须用类似的方式改变文件的所有权和家目录的权限。

[root@bigboy rancid-2.3.2a2]# chmod 0640 /usr/local/rancid/.cloginrc
[root@bigboy rancid-2.3.2a2]# chown -R rancid:netadm /usr/local/rancid/
[root@bigboy rancid-2.3.2a2]# chmod 770 /usr/local/rancid/

现在安装完成了,你需要做初始的配置以让Rancid运行。不过别担心,这是非常简单的。