如何在 Ubuntu 18.04 LTS 上设置 Bareos 备份解决方案如何在 Ubuntu 18.04 LTS 上设置 Bareos 备份解决方案如何在 Ubuntu 18.04 LTS 上设置 Bareos 备份解决方案如何在 Ubuntu 18.04 LTS 上设置 Bareos 备份解决方案
  • 文章
  • 正则表达式
    • 工具
  • 登录
找到的结果: {phrase} (显示: {results_count} 共: {results_count_total})
显示: {results_count} 共: {results_count_total}

加载更多搜索结果...

搜索范围
模糊匹配
搜索标题
搜索内容
发表 admin at 2025年2月28日
类别
  • 未分类
标签

如何在 Ubuntu 18.04 LTS 上设置 Bareos 备份解决方案

在此页

  1. 先决条件
  2. 开始
  3. 安装 Bareos
  4. 安装 Bareos 网络界面。
  5. 创建 Bareos 管理用户
  6. 访问 Bareos 网络界面
  7. 结论

Bareos 代表“备份存档恢复开源”,是一个从 Bacula.org 派生出来的免费开源备份平台。它是一款跨平台软件,可用于所有操作系统的数据备份、归档和恢复。它由三个组件组成,包括 Bareos Director、Storage Daemons 和 File Daemons。每个组件的简要说明如下所示:

director 是所有守护进程的中央控制单元,负责管理数据库、连接的客户端和插件的配置。文件守护进程负责管理备份和恢复过程。存储守护进程从一个或多个文件守护进程接收数据并将数据存储在配置的备份介质上。

特征

  • 支持本地 NDMP。
  • 支持客户端配额。
  • 支持使用 LTO 进行硬件加密。
  • 带宽限制。
  • 文件集阴影重复数据删除。
  • 支持 VMware 插件备份 VMware 磁盘映像。
  • 支持 LDAP Plugin 备份 LDAP 目录
  • 用于备份云存储的 Gluster 和 Ceph 插件

如果您正在寻找一种更简单的方法来管理您的企业备份,那么 Bareos 是您的最佳选择。

在本教程中,我们将向您展示如何在 Ubuntu 18.04 服务器上安装 Bareos 和 Bareos WebUI。

先决条件

  • 一台运行 Ubuntu 18.04 的服务器。
  • 在您的服务器上配置了根密码。

入门

在开始之前,建议将您的系统包存储库更新到最新版本。您可以使用以下命令执行此操作:

apt-get update -y
apt-get upgrade -y

完成后,您可以继续下一步。

安装 Bareos

默认情况下,Bareos 在 Ubuntu 18.04 默认存储库中不可用。所以你需要将 bareos 存储库添加到你的系统中。

您可以使用以下命令添加它:

echo "deb http://download.bareos.org/bareos/release/latest/xUbuntu_18.04 /" > /etc/apt/sources.list.d/bareos.list

接下来,使用以下命令下载并添加 GPG 密钥:

wget -q http://download.bareos.org/bareos/release/latest/xUbuntu_18.04/Release.key -O- | apt-key add -

接下来,使用以下命令更新存储库:

apt-get update -y

存储库更新后,通过运行以下命令安装带有 MariaDB 服务器的 Bareos:

apt-get install mariadb-server bareos bareos-database-mysql -y

在安装过程中,您将被要求选择邮件服务器配置类型,如以下屏幕所示:

选择 Local Only 并按 Enter 键继续。您将被要求提供您的系统邮件名称,如以下屏幕所示:

提供您的系统邮件名称并按 Enter 键继续。您将被要求使用 dbconfig 来配置 Bareos 数据库,如以下屏幕所示:

选择 Yes 并按 Enter 键继续。您将被要求提供 Bareos 数据库的 MySQL 密码,如下所示:

提供您想要的密码,然后按 Enter 键继续。系统将要求您确认密码,如下所示:

确认密码并按 Enter 键完成安装。

默认情况下,所有 bareos 配置都存储在 /etc/bareos/ 目录中。您可以使用以下命令列出它们:

tree /etc/bareos/

您应该在以下输出中看到所有 bareos 文件和目录:

/etc/bareos/
??? bareos-dir.d
?   ??? catalog
?   ?   ??? MyCatalog.conf
?   ??? client
?   ?   ??? bareos-fd.conf
?   ??? console
?   ?   ??? bareos-mon.conf
?   ??? director
?   ?   ??? bareos-dir.conf
?   ??? fileset
?   ?   ??? Catalog.conf
?   ?   ??? LinuxAll.conf
?   ?   ??? SelfTest.conf
?   ?   ??? Windows All Drives.conf
?   ??? job
?   ?   ??? backup-bareos-fd.conf
?   ?   ??? BackupCatalog.conf
?   ?   ??? RestoreFiles.conf
?   ??? jobdefs
?   ?   ??? DefaultJob.conf
?   ??? messages
?   ?   ??? Daemon.conf
?   ?   ??? Standard.conf
?   ??? pool
?   ?   ??? Differential.conf
?   ?   ??? Full.conf
?   ?   ??? Incremental.conf
?   ?   ??? Scratch.conf
?   ??? profile
?   ?   ??? operator.conf
?   ??? schedule
?   ?   ??? WeeklyCycleAfterBackup.conf
?   ?   ??? WeeklyCycle.conf
?   ??? storage
?   ?   ??? File.conf
?   ??? user
??? bareos-dir-export
?   ??? client
??? bareos-fd.d
?   ??? client
?   ?   ??? myself.conf
?   ??? director
?   ?   ??? bareos-dir.conf
?   ?   ??? bareos-mon.conf
?   ??? messages
?       ??? Standard.conf
??? bareos-sd.d
?   ??? device
?   ?   ??? FileStorage.conf
?   ??? director
?   ?   ??? bareos-dir.conf
?   ?   ??? bareos-mon.conf
?   ??? messages
?   ?   ??? Standard.conf
?   ??? storage
?       ??? bareos-sd.conf
??? bconsole.conf

完成后,您可以继续下一步。

安装 Bareos Web 界面。

Bareos 还提供 WebUI 来监控和管理 Bareos。它是一个用 PHP 编写并基于 Zend Framework 的免费软件工具。它旨在通过网络监控和管理 Bareos。您可以使用 Bareos 仪表板轻松执行备份和还原操作。您可以通过运行以下命令来安装它:

apt-get install bareos-webui -y

这将在您的系统中安装 Apache 网络服务器、PHP 和其他 PHP 扩展。安装完成后,您将需要重新加载 Apache 服务以应用更改。您可以使用以下命令重新启动它:

systemctl reload apache2

接下来,使用以下命令启动所有 Bareos 服务:

systemctl start bareos-dir
systemctl start bareos-sd
systemctl start bareos-fd

您还可以使用以下命令查看所有服务的状态:

systemctl status bareos-dir bareos-sd bareos-fd

您应该看到以下输出:

? bareos-director.service - Bareos Director Daemon service
   Loaded: loaded (/lib/systemd/system/bareos-director.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-04-04 07:21:03 UTC; 7s ago
     Docs: man:bareos-dir(8)
  Process: 19182 ExecStart=/usr/sbin/bareos-dir (code=exited, status=0/SUCCESS)
  Process: 19171 ExecStartPre=/usr/sbin/bareos-dir -t -f (code=exited, status=0/SUCCESS)
 Main PID: 19189 (bareos-dir)
    Tasks: 4 (limit: 2359)
   CGroup: /system.slice/bareos-director.service
           ??19189 /usr/sbin/bareos-dir

Apr 04 07:21:03 ubuntu1804 systemd[1]: Starting Bareos Director Daemon service...
Apr 04 07:21:03 ubuntu1804 systemd[1]: bareos-director.service: Can't open PID file /var/lib/bareos/bareos-dir.9101.pid (yet?) after start: No 
Apr 04 07:21:03 ubuntu1804 systemd[1]: Started Bareos Director Daemon service.

? bareos-storage.service - Bareos Storage Daemon service
   Loaded: loaded (/lib/systemd/system/bareos-storage.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-04-04 07:21:03 UTC; 7s ago
     Docs: man:bareos-sd(8)
  Process: 19172 ExecStart=/usr/sbin/bareos-sd (code=exited, status=0/SUCCESS)
 Main PID: 19181 (bareos-sd)
    Tasks: 2 (limit: 2359)
   CGroup: /system.slice/bareos-storage.service
           ??19181 /usr/sbin/bareos-sd

Apr 04 07:21:03 ubuntu1804 systemd[1]: Starting Bareos Storage Daemon service...
Apr 04 07:21:03 ubuntu1804 systemd[1]: bareos-storage.service: Can't open PID file /var/lib/bareos/bareos-sd.9103.pid (yet?) after start: No su
Apr 04 07:21:03 ubuntu1804 systemd[1]: Started Bareos Storage Daemon service.

? bareos-filedaemon.service - Bareos File Daemon service
   Loaded: loaded (/lib/systemd/system/bareos-filedaemon.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-04-04 07:18:11 UTC; 2min 58s ago
     Docs: man:bareos-fd(8)
 Main PID: 3469 (bareos-fd)
    Tasks: 2 (limit: 2359)
   CGroup: /system.slice/bareos-filedaemon.service
           ??3469 /usr/sbin/bareos-fd

完成后,您可以继续下一步。

创建 Bareos 管理用户

接下来,您需要创建一个管理员用户来访问 WebUI。

为此,请使用以下命令访问 Bareos 控制台:

bconsole

连接后,您应该得到以下输出:

 Connecting to Director localhost:9101
  Encryption: ECDHE-PSK-CHACHA20-POLY1305
 1000 OK: bareos-dir Version: 18.2.5 (30 January 2019)
 bareos.org build binary
 bareos.org binaries are UNSUPPORTED by bareos.com.
 Get official binaries and vendor support on https://www.bareos.com
 You are connected using the default console
 Enter a period to cancel a command.

接下来,运行以下命令创建一个管理员用户并为其设置密码:

configure add console name=admin password=password profile=webui-admin

您应该得到以下输出:

Created resource config file "/etc/bareos/bareos-dir.d/console/admin.conf":
 Console {
   Name = admin
   Password = password
   Profile = webui-admin
 }

接下来,使用以下命令退出 Bareos 控制台:

exit

接下来,您还需要在 Bareos 中禁用 TLS。您可以通过编辑 admin.conf 文件来完成:

nano /etc/bareos/bareos-dir.d/console/admin.conf

添加行“TLS Enable=No”,如下所示:

Console {
  Name = admin
  Password = password
  Profile = webui-admin
TLS Enable = No
}

完成后保存并关闭文件。然后,重新启动所有 Bareos 服务以应用更改:

systemctl restart bareos-dir
systemctl restart bareos-sd
systemctl restart bareos-fd

完成后,您可以继续下一步。

访问 Bareos Web 界面

至此,bareos和bareos WebUI安装配置完成。是时候访问他们的 WebUI 了。

打开您的 Web 浏览器并输入 URL http://your-server-ip/bareos-webui。您将被重定向到 Bareos 登录页面,如下所示:

提供您的管理员用户名和密码,然后单击“登录”按钮。您应该在以下屏幕中看到 Bareos 默认仪表板:

结论

恭喜!您已经在 Ubuntu 18.04 服务器上成功安装了 Bareos 和 Bareos WebUI。您现在可以开始探索 Bareos WebUI 来监控和管理您的企业备份。有关详细信息,您可以访问 Bareos 文档页面。如果您有任何问题,请随时问我。

©2015-2025 艾丽卡 support@alaica.com