CentOS 6 установка и настройка bacula
- Details
- Category: debian ubuntu rhel centos
Отключим selinux изменив значение в disabled
# vi /etc/sysconfig/selinux
SELINUX = disabled
Также необходимо открыть порты 9101, 9102, 9103.
Установка bacula
# yum install mysql-devel mysql-server
# yum install bacula-storage-mysql
# yum install bacula-director-mysql bacula-console
# yum install bacula-client
# yum install bacula-traymonitor
Запускаем сервис MySQL
# service mysqld start
# chkconfig mysqld on
Устанавливаем пароль для MySQL
# mysqladmin -u root password YOUR_PASS!
Предоставим необходимые привилегии
# /usr/libexec/bacula/grant_mysql_privileges -u root -p
# /usr/libexec/bacula/create_mysql_database -u root -p
# /usr/libexec/bacula/make_mysql_tables -u root -p
# /usr/libexec/bacula/grant_bacula_privileges -u root -p
Залогинемся в БД
# mysql -u root -p
Изменим пароль пользователя bacula
mysql> update mysql.user SET password=PASSWORD ('YOUR_PASS!') WHERE user='bacula';
mysql> flush privileges;
Создадим директорию для бэкапа и назначим пользователя bacula владельцем
# mkdir /BACKUP_DIR
# chown bacula /BACKUP_DIR/
Настроим конфигурационные файлы bacula
Изменим пароль Password
# vi /etc/bacula/bacula-dir.conf
Director { # define myself
Name = bacula-dir
DIRport = 9101 # where we listen for UA connections
QueryFile = "/usr/libexec/bacula/query.sql"
WorkingDirectory = "/var/spool/bacula"
PidDirectory = "/var/run"
Maximum Concurrent Jobs = 1
Password = "YOUR_PASS!" # Console password
Messages = Daemon
}
Изменим адрес и пароль
# Client (File Services) to backup
Client {
Name = bacula-fd
Address = YOUR_HOST!
FDPort = 9102
Catalog = MyCatalog
Password = "YOUR_PASS!" # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}
Изменим адрес и пароль
# Definition of file storage device
Storage {
Name = File
# Do not use "localhost" here
Address = YOUR_HOST! # N.B. Use a fully qualified name here
SDPort = 9103
Password = "YOUR_PASS!"
Device = FileStorage
Media Type = File
Изменим пароль
# Restricted console used by tray-monitor to get the status of the director
#
Console {
Name = bacula-mon
Password = "YOUR_PASS!"
CommandACL = status, .status
}
Укажем пароль для подключения к MySQL пользователя bacula
Catalog {
Name = MyCatalog
# Uncomment the following line if you want the dbi driver
# dbdriver = "dbi:sqlite3"; dbaddress = 127.0.0.1; dbport =
dbname = "bacula"; dbuser = "bacula"; dbpassword = "YOUR_PASS!"
}
Изменим пароль
# vi /etc/bacula/bacula-fd.conf
# List Directors who are permitted to contact this File daemon
#
Director {
Name = bacula-dir
Password = "YOUR_PASS!"
}
#
# Restricted Director, used by tray-monitor to get the
# status of the file daemon
#
Director {
Name = bacula-mon
Password = "YOUR_PASS!"
Monitor = yes
Изменим пароль и укажем директорию для бэкапа
# vi /etc/bacula/bacula-sd.conf
# List Directors who are permitted to contact Storage daemon
#
Director {
Name = bacula-dir
Password = "YOUR_PASS!"
# Restricted Director, used by tray-monitor to get the
# status of the storage daemon
#
Director {
Name = bacula-mon
Password = "YOUR_PASS!"
Monitor = yes
}
Device {
Name = FileStorage
Media Type = File
Archive Device = /BACKUP_DIR
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}
В следующем файле изменим адрес и пароль
# vi /etc/bacula/bconsole.conf
# Bacula User Agent (or Console) Configuration File
#
Director {
Name = bacula-dir
DIRport = 9101
address = YOUR_HOST!
Password = "YOUR_PASS!"
Изменим адрес и пароль при наличии файла
# vi /etc/bacula/tray-monitor.conf
Добавим сервисы в автозапуск при старте системы и запустим их
# chkconfig bacula-dir on
# chkconfig bacula-fd on
# chkconfig bacula-sd on
# service bacula-dir start
# service bacula-fd start
# service bacula-sd start