以bacula-7.4.4安装为例
CentOS-7
安装mariadb
yum install -y mariadb-server mariadb-devel
systemctl start mariadb
systemctl enable mariadb
源代码安装
yum install -y gcc gcc-c++
#需安装C++编译环境
tar zxvf bacula-7.4.4.tar.gz
cd bacula-7.4.4
./configure --prefix=/opt/bacula --with-mysql
make && make install
make install-autostart
CentOS-6
安装mysql
yum install -y mysql mysql-server mysql-devel
/etc/init.d/mysqld start
#设置mysql开机自启动
chkconfig mysqld on #设置开机自启动
chkconfig --list mysqld #检查开机自启动
源代码安装
yum install -y gcc gcc-c++
#需安装C++编译环境
tar zxvf bacula-7.4.4.tar.gz
cd bacula-7.4.4
./configure --prefix=/opt/bacula --with-mysql
make && make install
make install-autostart
#执行命令后查看自启动
ls /etc/rc.d/init.d/ |grep bacula
bacula-dir
bacula-fd
bacula-sd
在需要备份的服务器上安装客户端(linux)
yum install -y gcc gcc-c++
#需安装C++编译环境
tar zxvf bacula-7.4.4.tar.gz
cd bacula-7.4.4
./configure --prefix=/opt/bacula --enable-client-only
make && make install
make install-autostart
初始化Bacula的数据库
cd /opt/bacula/etc
./create_mysql_database
./grant_mysql_privileges
./make_mysql_tables
登录Mysql数据库 查看bacula的库表是否已经建立
[root@bacula1 etc]# mysql -uroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bacula |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)
MariaDB [(none)]> quit
Bye