[Translating]20140528 Setup Backup Server Using Bacula And Webmin On Ubuntu 14.04

This commit is contained in:
geekpi 2014-05-30 16:41:00 +08:00
parent bc3263b63c
commit dc125b2eb2
2 changed files with 190 additions and 193 deletions

View File

@ -1,193 +0,0 @@
Translating-----------geekpi
Setup Backup Server Using Bacula And Webmin On Ubuntu 14.04
================================================================================
**Bacula** is an open source network backup solution that permits you to backup and restore the datas from a local or group of remote networked computers. It is very easy in terms of installation and configuration with many advanced storage management features.
In this tutorial, let us see how to install and configure Bacula on Ubuntu 14.04 server. My test box IP address is **192.168.1.250/24**, and hostname is **server.unixmen.local**. Well, now let me get us into the tutorial.
### Install Bacula ###
Bacula uses an SQL database to manage its information. We can use either MySQL or PostgreSQL database. In this tutorial, I use MySQL server.
Enter the following command to install MySQL server.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server
During MySQL installation, youll be asked to set the database administrator password. Enter the password and click Ok.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0012.png)
Re-enter the password:
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0021.png)
Now, let us install bacula using the following command:
sudo apt-get install bacula-server bacula-client
By default, Bacula uses Postfix MTA. During installation, youll be asked to configure Postfix.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0031.png)
Select Internet Site and click Ok.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0041.png)
Enter server fully qualified name(FQDN):
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0051.png)
Now, select Yes to configure database for Bacula with dbconfig-common.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_006.png)
Enter the MySQL database administrator password:
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0071.png)
Set password for bacula-director-mysql to register with the database server. If left blank, a random password will be generated.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0081.png)
Re-enter the password:
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0091.png)
### Create Backup and Restore Directories ###
Now, let us backup and restore directories.
sudo mkdir -p /mybackup/backup /mybackup/restore
Set permissions and ownership to the above directories:
sudo chown -R bacula:bacula /mybackup/
sudo chown -R 700 /mybackup/
### Configure Bacula ###
Bacula has many configuration files which we have to configure.
**Update Bacula Director configuration:**
sudo vi /etc/bacula/bacula-dir.conf
Find the following section, and update the restore path. In our case,** /mybackup/restore** is my restore location.
[...]
Job {
Name = "RestoreFiles"
Type = Restore
Client=server-fd
FileSet="Full Set"
Storage = File
Pool = Default
Messages = Standard
Where = /mybackup/restore
}
[...]
Scroll down to “list of files to be backed up” section, and set the path of the directory to backup. For this tutorial, I want to backup the “**/home/sk**” directory. So, I included this directory path in the “File” parameter.
[...]
# By default this is defined to point to the Bacula binary
# directory to give a reasonable FileSet to backup to
# disk storage during initial testing.
#
File = /home/sk
}
[...]
Scroll down further, fins the section **Exclude** section. Set the list of directories to be excluded from the backup. Here, I excluded the backup folder **/mybackup** directory from being backed up.
[...]
# If you backup the root directory, the following two excluded
# files can be useful
#
Exclude {
File = /var/lib/bacula
File = /nonexistant/path/to/file/archive/dir
File = /proc
File = /tmp
File = /.journal
File = /.fsck
File = /mybackup
}
}
[...]
Save and close file.
**Update Bacula Storage Daemon settings:**
Edit **/etc/bacula/bacula-sd.conf**,
sudo vi /etc/bacula/bacula-sd.conf
Set the backup folder location. i.e **/mybackup/backup** in our case.
[...]
Device {
Name = FileStorage
Media Type = File
Archive Device = /mybackup/backup
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}
[...]
Now, check if all the configurations are valid as shown below. If the commands displays nothing, the configuration changes are valid.
sudo bacula-dir -tc /etc/bacula/bacula-dir.conf
sudo bacula-sd -tc /etc/bacula/bacula-sd.conf
Once you done all the changes, restart all bacula services.
sudo /etc/init.d/bacula-director restart
sudo /etc/init.d/bacula-fd restart
sudo /etc/init.d/bacula-sd restart
Thats it. Now, bacula has been installed and configured successfully.
### Manage Bacula Using Webmin ###
Managing and working with Bacula via command line is bit difficult. So let use a graphical system administration tool called “webmin” to ease our tasks.
Follow the below link to install Webmin on Ubuntu 14.04.
- [Install Webmin on Ubuntu 14.04 LTS][1]
注:此链接文章在另一篇里,如果也翻译发布了,那么可以更改这个链接地址
Now, go to the Webmin interface using URL https://ip-address:10000. Go to the System tab on the left pane and click on the Module configuration link. If it not found under system, search it from the unused modules section.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/Webmin-1.690-on-server.unixmen.local-Ubuntu-Linux-14.04-Mozilla-Firefox_002.png)
Select MySQL in the database section. Enter the MySQL database administrator password, and click Save button.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/Webmin-1.690-on-server.unixmen.local-Ubuntu-Linux-14.04-Mozilla-Firefox_003.png)
Thats it. Now youll be able to configure Bacula from webmin easily. Start adding backup clients, volumes and schedule the jobs.
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/Webmin-1.690-on-server.unixmen.local-Ubuntu-Linux-14.04-Mozilla-Firefox_004.png)
Cheers!
--------------------------------------------------------------------------------
via: http://www.unixmen.com/setup-backup-server-using-bacula-webmin-ubuntu-14-04/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.unixmen.com/install-webmin-ubuntu-14-04/

View File

@ -0,0 +1,190 @@
在Ubuntu 14.04 上使用Bacula和Webmin设置备份服务器
================================================================================
**Bacula**是一个开源网络备份解决方案,允许你在本地或者远程计算机组上备份或者还原数据。许多高级存储管理特性配置与安装是很容易的。
主机名是**server.unixmen.local**。现在让我们进入教程吧。
### 安装 Bacula ###
Bacula使用SQL数据库管理它的信息。我们可以使用MySQL或者PostgreSQL数据库。本篇教程中我使用MySQL。
输入下面的命令安装MySQL服务器。
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server
在安装MySQL的过程中可能提示需要输入数据库管理员密码。输入密码后按下OK。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0012.png)
重新输入密码:
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0021.png)
现在使用下面的命令安装bacula
sudo apt-get install bacula-server bacula-client
Bacula默认使用Postfix MTA。安装过程中你会被要求配置Postfix。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0031.png)
选择Internet站点并点击OK。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0041.png)
输入服务器完整网域名称:
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0051.png)
现在输入yes用dbconfig-common来配置Bacula数据库。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_006.png)
输入MySQL数据库管理员密码
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0071.png)
设置bacula-director-mysql密码注册数据库。如果空白会生成一个随机密码。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0081.png)
重新输入密码:
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/sk@server-_0091.png)
### 创建备份与还原目录 ###
现在,让我们创建备份与还原目录。
sudo mkdir -p /mybackup/backup /mybackup/restore
设置上面目录的权限与所属用户/组:
sudo chown -R bacula:bacula /mybackup/
sudo chown -R 700 /mybackup/
### 配置 Bacula ###
Bacula有很多配置文件需要我们配置。
**更新 Bacula Director 配置:**
sudo vi /etc/bacula/bacula-dir.conf
找到下面的字段,并更新还原路径。本篇中,** /mybackup/restore**是我的还原位置。
[...]
Job {
Name = "RestoreFiles"
Type = Restore
Client=server-fd
FileSet="Full Set"
Storage = File
Pool = Default
Messages = Standard
Where = /mybackup/restore
}
[...]
滚动到“list of files to be backed up”字段并设置备份的目录。本篇教程中我希望备份“**/home/sk**”目录。所以我包这个目录包含进了“File”参数中。
[...]
# By default this is defined to point to the Bacula binary
# directory to give a reasonable FileSet to backup to
# disk storage during initial testing.
#
File = /home/sk
}
[...]
继续向下滚动,找到**Exclude** 字段,设置排除在备份目录外的目录列表。这里,我排除了目录**/mybackup**。
[...]
# If you backup the root directory, the following two excluded
# files can be useful
#
Exclude {
File = /var/lib/bacula
File = /nonexistant/path/to/file/archive/dir
File = /proc
File = /tmp
File = /.journal
File = /.fsck
File = /mybackup
}
}
[...]
保存并关闭文件。
**更新 Bacula 存储守护进程设置:**
编辑 **/etc/bacula/bacula-sd.conf**,
sudo vi /etc/bacula/bacula-sd.conf
设置备份目录位置,也就是本篇中的**/mybackup/backup**。
[...]
Device {
Name = FileStorage
Media Type = File
Archive Device = /mybackup/backup
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}
[...]
现在如下检查是否所有的配置是有效的。如果下面的命令没有显示,那么配置就是有效的。
sudo bacula-dir -tc /etc/bacula/bacula-dir.conf
sudo bacula-sd -tc /etc/bacula/bacula-sd.conf
一旦你完成所有的设置重启所有的bacula服务。
sudo /etc/init.d/bacula-director restart
sudo /etc/init.d/bacula-fd restart
sudo /etc/init.d/bacula-sd restart
就是这样。现在bacula已经成功安装与配置了。
### 使用Webmin 管理 Bacula ###
使用命令行管理Bacula是有点困难的。所以我们使用一个图形化的管理工具“webmin”来简化我们的任务。
使用下面的命令在Ubuntu 14.04上安装Webmin。
- [在 Ubuntu 14.04 LTS上安装Webmin][1]
注:此链接文章在另一篇里,如果也翻译发布了,那么可以更改这个链接地址
现在使用URL https://ip-address:10000进入Webmin界面。在左边的窗格中进入系统标签并点击模块配置链接。如果在系统下没有找到它在未使用模块一栏中查找。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/Webmin-1.690-on-server.unixmen.local-Ubuntu-Linux-14.04-Mozilla-Firefox_002.png)
在数据库一栏中选择MySQL数据库。输入MySQL管理员密码并点击保存。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/Webmin-1.690-on-server.unixmen.local-Ubuntu-Linux-14.04-Mozilla-Firefox_003.png)
就是这样。现在你可以在webmin中简单地配置Bacula了。开始加入备份客户端磁盘卷和计划任务吧。
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/05/Webmin-1.690-on-server.unixmen.local-Ubuntu-Linux-14.04-Mozilla-Firefox_004.png)
干杯!
--------------------------------------------------------------------------------
via: http://www.unixmen.com/setup-backup-server-using-bacula-webmin-ubuntu-14-04/
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.unixmen.com/install-webmin-ubuntu-14-04/