fix storage
This commit is contained in:
@@ -1,443 +0,0 @@
|
||||
# Bacula Configuration Guide
|
||||
## For Calypso Backup Appliance
|
||||
|
||||
**Version:** 1.0
|
||||
**Target OS:** Ubuntu Server 24.04 LTS
|
||||
|
||||
---
|
||||
|
||||
## 1. Overview
|
||||
|
||||
This guide covers advanced configuration of Bacula for integration with Calypso backup appliance, including storage pools, schedules, clients, and job definitions.
|
||||
|
||||
---
|
||||
|
||||
## 2. Configuration Files
|
||||
|
||||
### 2.1 Main Configuration Files
|
||||
|
||||
- **Director:** `/opt/bacula/etc/bacula-dir.conf`
|
||||
- **Storage Daemon:** `/opt/bacula/etc/bacula-sd.conf`
|
||||
- **File Daemon:** `/opt/bacula/etc/bacula-fd.conf`
|
||||
- **Console:** `/opt/bacula/etc/bconsole.conf`
|
||||
|
||||
### 2.2 Configuration File Structure
|
||||
|
||||
Each configuration file contains:
|
||||
- **Resource definitions** (Director, Storage, Client, etc.)
|
||||
- **Directives** (settings and options)
|
||||
- **Comments** (documentation)
|
||||
|
||||
---
|
||||
|
||||
## 3. Director Configuration
|
||||
|
||||
### 3.1 Director Resource
|
||||
|
||||
```conf
|
||||
Director {
|
||||
Name = bacula-dir
|
||||
DIRport = 9101
|
||||
QueryFile = "/opt/bacula/scripts/query.sql"
|
||||
WorkingDirectory = "/opt/bacula/working"
|
||||
PidDirectory = "/opt/bacula/working"
|
||||
Maximum Concurrent Jobs = 10
|
||||
Password = "director-password"
|
||||
Messages = Daemon
|
||||
}
|
||||
```
|
||||
|
||||
### 3.2 Catalog Resource
|
||||
|
||||
```conf
|
||||
Catalog {
|
||||
Name = MyCatalog
|
||||
dbname = "bacula"
|
||||
dbuser = "bacula"
|
||||
dbpassword = "bacula-db-password"
|
||||
dbaddress = "localhost"
|
||||
dbport = 5432
|
||||
}
|
||||
```
|
||||
|
||||
### 3.3 Storage Resource
|
||||
|
||||
```conf
|
||||
Storage {
|
||||
Name = FileStorage
|
||||
Address = localhost
|
||||
SDPort = 9103
|
||||
Password = "storage-password"
|
||||
Device = FileStorage
|
||||
Media Type = File
|
||||
}
|
||||
```
|
||||
|
||||
### 3.4 Pool Resource
|
||||
|
||||
```conf
|
||||
Pool {
|
||||
Name = DefaultPool
|
||||
Pool Type = Backup
|
||||
Recycle = yes
|
||||
AutoPrune = yes
|
||||
Volume Retention = 365 days
|
||||
Maximum Volume Bytes = 50G
|
||||
Maximum Volumes = 100
|
||||
Label Format = "Volume-"
|
||||
}
|
||||
```
|
||||
|
||||
### 3.5 Schedule Resource
|
||||
|
||||
```conf
|
||||
Schedule {
|
||||
Name = WeeklyCycle
|
||||
Run = Full 1st sun at 2:05
|
||||
Run = Differential 2nd-5th sun at 2:05
|
||||
Run = Incremental mon-sat at 2:05
|
||||
}
|
||||
```
|
||||
|
||||
### 3.6 Client Resource
|
||||
|
||||
```conf
|
||||
Client {
|
||||
Name = client-fd
|
||||
Address = client.example.com
|
||||
FDPort = 9102
|
||||
Catalog = MyCatalog
|
||||
Password = "client-password"
|
||||
File Retention = 60 days
|
||||
Job Retention = 6 months
|
||||
AutoPrune = yes
|
||||
}
|
||||
```
|
||||
|
||||
### 3.7 Job Resource
|
||||
|
||||
```conf
|
||||
Job {
|
||||
Name = "BackupClient"
|
||||
Type = Backup
|
||||
Client = client-fd
|
||||
FileSet = "Full Set"
|
||||
Schedule = WeeklyCycle
|
||||
Storage = FileStorage
|
||||
Pool = DefaultPool
|
||||
Messages = Standard
|
||||
Priority = 10
|
||||
Write Bootstrap = "/opt/bacula/working/BackupClient.bsr"
|
||||
}
|
||||
```
|
||||
|
||||
### 3.8 FileSet Resource
|
||||
|
||||
```conf
|
||||
FileSet {
|
||||
Name = "Full Set"
|
||||
Include {
|
||||
Options {
|
||||
signature = MD5
|
||||
compression = GZIP
|
||||
}
|
||||
File = /home
|
||||
File = /etc
|
||||
File = /var
|
||||
}
|
||||
Exclude {
|
||||
File = /tmp
|
||||
File = /proc
|
||||
File = /sys
|
||||
File = /.snapshot
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Storage Daemon Configuration
|
||||
|
||||
### 4.1 Storage Resource
|
||||
|
||||
```conf
|
||||
Storage {
|
||||
Name = FileStorage
|
||||
WorkingDirectory = "/opt/bacula/working"
|
||||
Pid Directory = "/opt/bacula/working"
|
||||
Maximum Concurrent Jobs = 20
|
||||
}
|
||||
```
|
||||
|
||||
### 4.2 Director Resource (in SD)
|
||||
|
||||
```conf
|
||||
Director {
|
||||
Name = bacula-dir
|
||||
Password = "storage-password"
|
||||
}
|
||||
```
|
||||
|
||||
### 4.3 Device Resource (Disk)
|
||||
|
||||
```conf
|
||||
Device {
|
||||
Name = FileStorage
|
||||
Media Type = File
|
||||
Archive Device = /srv/calypso/backups
|
||||
LabelMedia = yes
|
||||
Random Access = yes
|
||||
AutomaticMount = yes
|
||||
RemovableMedia = no
|
||||
AlwaysOpen = no
|
||||
Maximum Concurrent Jobs = 5
|
||||
}
|
||||
```
|
||||
|
||||
### 4.4 Device Resource (Tape)
|
||||
|
||||
```conf
|
||||
Device {
|
||||
Name = TapeDrive-0
|
||||
Media Type = LTO-8
|
||||
Archive Device = /dev/nst0
|
||||
AutomaticMount = yes
|
||||
AlwaysOpen = no
|
||||
RemovableMedia = yes
|
||||
RandomAccess = no
|
||||
MaximumFileSize = 10GB
|
||||
MaximumBlockSize = 524288
|
||||
AutoChanger = yes
|
||||
ChangerDevice = /dev/sg0
|
||||
ChangerCommand = "/opt/bacula/scripts/mtx-changer %c %o %S %a %d"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. File Daemon Configuration
|
||||
|
||||
### 5.1 Director Resource (in FD)
|
||||
|
||||
```conf
|
||||
Director {
|
||||
Name = bacula-dir
|
||||
Password = "client-password"
|
||||
}
|
||||
```
|
||||
|
||||
### 5.2 FileDaemon Resource
|
||||
|
||||
```conf
|
||||
FileDaemon {
|
||||
Name = client-fd
|
||||
FDport = 9102
|
||||
WorkingDirectory = /opt/bacula/working
|
||||
Pid Directory = /opt/bacula/working
|
||||
Maximum Concurrent Jobs = 2
|
||||
Plugin Directory = /opt/bacula/plugins
|
||||
}
|
||||
```
|
||||
|
||||
### 5.3 Messages Resource
|
||||
|
||||
```conf
|
||||
Messages {
|
||||
Name = Standard
|
||||
director = bacula-dir = all, !skipped, !restored
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. Integration with Calypso Storage
|
||||
|
||||
### 6.1 Using Calypso ZFS Datasets
|
||||
|
||||
Configure Bacula to use ZFS datasets managed by Calypso:
|
||||
|
||||
```conf
|
||||
Device {
|
||||
Name = ZFSStorage
|
||||
Media Type = File
|
||||
Archive Device = /srv/calypso/backups/zfs-pool
|
||||
LabelMedia = yes
|
||||
Random Access = yes
|
||||
AutomaticMount = yes
|
||||
}
|
||||
```
|
||||
|
||||
### 6.2 Using Calypso Storage Repositories
|
||||
|
||||
```conf
|
||||
Device {
|
||||
Name = CalypsoRepo
|
||||
Media Type = File
|
||||
Archive Device = /srv/calypso/backups/repository-1
|
||||
LabelMedia = yes
|
||||
Random Access = yes
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 7. Advanced Configuration
|
||||
|
||||
### 7.1 Compression
|
||||
|
||||
Enable compression in FileSet:
|
||||
|
||||
```conf
|
||||
FileSet {
|
||||
Name = "Compressed Set"
|
||||
Include {
|
||||
Options {
|
||||
compression = GZIP9
|
||||
signature = MD5
|
||||
}
|
||||
File = /data
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 7.2 Deduplication
|
||||
|
||||
For ZFS with deduplication, use aligned plugin:
|
||||
|
||||
```conf
|
||||
FileSet {
|
||||
Name = "Deduplicated Set"
|
||||
Include {
|
||||
Options {
|
||||
plugin = "aligned"
|
||||
}
|
||||
File = /data
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 7.3 Encryption
|
||||
|
||||
Enable encryption (requires encryption plugin):
|
||||
|
||||
```conf
|
||||
FileSet {
|
||||
Name = "Encrypted Set"
|
||||
Include {
|
||||
Options {
|
||||
encryption = AES256
|
||||
}
|
||||
File = /sensitive-data
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 8. Job Scheduling
|
||||
|
||||
### 8.1 Daily Incremental
|
||||
|
||||
```conf
|
||||
Schedule {
|
||||
Name = DailyIncremental
|
||||
Run = Incremental daily at 02:00
|
||||
}
|
||||
```
|
||||
|
||||
### 8.2 Weekly Full
|
||||
|
||||
```conf
|
||||
Schedule {
|
||||
Name = WeeklyFull
|
||||
Run = Full weekly on Sunday at 02:00
|
||||
}
|
||||
```
|
||||
|
||||
### 8.3 Monthly Archive
|
||||
|
||||
```conf
|
||||
Schedule {
|
||||
Name = MonthlyArchive
|
||||
Run = Full 1st sun at 01:00
|
||||
Run = Incremental 2nd-4th sun at 01:00
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 9. Testing Configuration
|
||||
|
||||
### 9.1 Test Director
|
||||
|
||||
```bash
|
||||
sudo /opt/bacula/bin/bacula-dir -t -u bacula -g bacula
|
||||
```
|
||||
|
||||
### 9.2 Test Storage Daemon
|
||||
|
||||
```bash
|
||||
sudo /opt/bacula/bin/bacula-sd -t -u bacula -g bacula
|
||||
```
|
||||
|
||||
### 9.3 Test File Daemon
|
||||
|
||||
```bash
|
||||
sudo /opt/bacula/bin/bacula-fd -t -u bacula -g bacula
|
||||
```
|
||||
|
||||
### 9.4 Reload Configuration
|
||||
|
||||
After testing, reload:
|
||||
|
||||
```bash
|
||||
sudo -u bacula /opt/bacula/bin/bconsole
|
||||
* reload
|
||||
* quit
|
||||
```
|
||||
|
||||
Or restart services:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart bacula-dir
|
||||
sudo systemctl restart bacula-sd
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 10. Monitoring and Maintenance
|
||||
|
||||
### 10.1 Job Status
|
||||
|
||||
```bash
|
||||
sudo -u bacula /opt/bacula/bin/bconsole
|
||||
* status director
|
||||
* show jobs
|
||||
* messages
|
||||
```
|
||||
|
||||
### 10.2 Volume Management
|
||||
|
||||
```bash
|
||||
* list volumes
|
||||
* label
|
||||
* delete volume=Volume-001
|
||||
```
|
||||
|
||||
### 10.3 Database Maintenance
|
||||
|
||||
```bash
|
||||
# Vacuum database
|
||||
sudo -u postgres psql -d bacula -c "VACUUM ANALYZE;"
|
||||
|
||||
# Check database size
|
||||
sudo -u postgres psql -d bacula -c "SELECT pg_size_pretty(pg_database_size('bacula'));"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
- Bacula Main Manual: https://www.bacula.org/documentation/
|
||||
- Configuration Examples: `/opt/bacula/etc/` (after installation)
|
||||
|
||||
@@ -1,743 +0,0 @@
|
||||
# Bacula Installation Guide
|
||||
## For Calypso Backup Appliance
|
||||
|
||||
**Version:** 1.0
|
||||
**Based on:** [Bacula Community Installation Guide](https://www.bacula.org/whitepapers/CommunityInstallationGuide.pdf)
|
||||
**Target OS:** Ubuntu Server 24.04 LTS
|
||||
**Database:** PostgreSQL 14+
|
||||
|
||||
---
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
This guide explains how to install and configure Bacula Community edition on the Calypso backup appliance. Bacula is used for backup job management, scheduling, and integration with the Calypso control plane.
|
||||
|
||||
**Note:** This installation is integrated with Calypso's PostgreSQL database and management system.
|
||||
|
||||
---
|
||||
|
||||
## 2. Prerequisites
|
||||
|
||||
### 2.1 System Requirements
|
||||
- Ubuntu Server 24.04 LTS (or compatible Debian-based system)
|
||||
- PostgreSQL 14+ (already installed by Calypso installer)
|
||||
- Root or sudo access
|
||||
- Network connectivity to download packages
|
||||
|
||||
### 2.2 Pre-Installation Checklist
|
||||
- [ ] PostgreSQL is installed and running
|
||||
- [ ] Calypso database is configured
|
||||
- [ ] Network access to Bacula repositories
|
||||
- [ ] Backup existing Bacula configuration (if upgrading)
|
||||
|
||||
---
|
||||
|
||||
## 3. Installation Methods
|
||||
|
||||
### 3.1 Method 1: Using Calypso Installer (Recommended)
|
||||
|
||||
The Calypso installer includes Bacula installation:
|
||||
|
||||
```bash
|
||||
sudo ./installer/alpha/install.sh
|
||||
```
|
||||
|
||||
Bacula will be installed automatically. Skip to **Section 5: Configuration** after installation.
|
||||
|
||||
### 3.2 Method 2: Manual Installation
|
||||
|
||||
If installing manually or Bacula was skipped during Calypso installation:
|
||||
|
||||
---
|
||||
|
||||
## 4. Manual Installation Steps
|
||||
|
||||
### 4.1 Install Required Packages
|
||||
|
||||
```bash
|
||||
# Update package lists
|
||||
sudo apt-get update
|
||||
|
||||
# Install transport for HTTPS repositories
|
||||
sudo apt-get install -y apt-transport-https
|
||||
```
|
||||
|
||||
### 4.2 Import GPG Key
|
||||
|
||||
Bacula packages are signed with a GPG key. Import it:
|
||||
|
||||
```bash
|
||||
cd /tmp
|
||||
wget https://www.bacula.org/downloads/Bacula-4096-Distribution-Verification-key.asc
|
||||
sudo apt-key add Bacula-4096-Distribution-Verification-key.asc
|
||||
rm Bacula-4096-Distribution-Verification-key.asc
|
||||
```
|
||||
|
||||
**Note:** For newer Ubuntu versions, you may need to use:
|
||||
|
||||
```bash
|
||||
# For Ubuntu 24.04+
|
||||
wget -qO - https://www.bacula.org/downloads/Bacula-4096-Distribution-Verification-key.asc | \
|
||||
sudo gpg --dearmor -o /usr/share/keyrings/bacula-archive-keyring.gpg
|
||||
```
|
||||
|
||||
### 4.3 Configure Bacula Repository
|
||||
|
||||
Create repository configuration file:
|
||||
|
||||
```bash
|
||||
sudo nano /etc/apt/sources.list.d/Bacula-Community.list
|
||||
```
|
||||
|
||||
Add the following (replace placeholders):
|
||||
|
||||
```bash
|
||||
# Bacula Community Repository
|
||||
deb [arch=amd64] https://www.bacula.org/packages/@access-key@/debs/@bacula-version@ @ubuntu-version@ main
|
||||
```
|
||||
|
||||
**Example for Ubuntu 24.04 (Noble) with Bacula 13.0.1:**
|
||||
|
||||
```bash
|
||||
# Bacula Community Repository
|
||||
deb [arch=amd64] https://www.bacula.org/packages/YOUR_ACCESS_KEY/debs/13.0.1 noble main
|
||||
```
|
||||
|
||||
**Where:**
|
||||
- `@access-key@` - Your personalized access key from Bacula registration
|
||||
- `@bacula-version@` - Bacula version (e.g., 13.0.1)
|
||||
- `@ubuntu-version@` - Ubuntu codename (e.g., `noble` for 24.04)
|
||||
|
||||
**Note:** You need to register at [Bacula.org](https://www.bacula.org) to get your access key.
|
||||
|
||||
### 4.4 Alternative: Using Distribution Packages
|
||||
|
||||
If you don't have a Bacula access key, you can use Ubuntu's default repository:
|
||||
|
||||
```bash
|
||||
# Add to /etc/apt/sources.list.d/Bacula-Community.list
|
||||
deb http://archive.ubuntu.com/ubuntu noble universe
|
||||
```
|
||||
|
||||
Then install from Ubuntu repository:
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y bacula-postgresql
|
||||
```
|
||||
|
||||
**Note:** Ubuntu repository may have older versions. For latest features, use official Bacula repository.
|
||||
|
||||
### 4.5 Update Package Lists
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
```
|
||||
|
||||
### 4.6 Install PostgreSQL (if not installed)
|
||||
|
||||
Calypso installer should have already installed PostgreSQL. If not:
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y postgresql postgresql-client postgresql-contrib
|
||||
sudo systemctl enable postgresql
|
||||
sudo systemctl start postgresql
|
||||
```
|
||||
|
||||
### 4.7 Install Bacula Packages
|
||||
|
||||
Install Bacula with PostgreSQL backend:
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y bacula-postgresql
|
||||
```
|
||||
|
||||
During installation, you'll be prompted:
|
||||
- **Configure database for bacula-postgresql with dbconfig-common?** → Choose **Yes**
|
||||
- Enter and confirm database password
|
||||
|
||||
This will:
|
||||
- Create Bacula database
|
||||
- Create Bacula database user
|
||||
- Initialize database schema
|
||||
- Configure basic Bacula services
|
||||
|
||||
### 4.8 Install Additional Components (Optional)
|
||||
|
||||
```bash
|
||||
# Install Bacula client (for local backups)
|
||||
sudo apt-get install -y bacula-client
|
||||
|
||||
# Install Bacula console (management tool)
|
||||
sudo apt-get install -y bacula-console
|
||||
|
||||
# Install Bacula Storage Daemon
|
||||
sudo apt-get install -y bacula-sd
|
||||
|
||||
# Install aligned plugin (for ZFS deduplication)
|
||||
sudo apt-get install -y bacula-aligned
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Post-Installation Configuration
|
||||
|
||||
### 5.1 Verify Installation
|
||||
|
||||
Check installed packages:
|
||||
|
||||
```bash
|
||||
dpkg -l | grep bacula
|
||||
```
|
||||
|
||||
Check services:
|
||||
|
||||
```bash
|
||||
sudo systemctl status bacula-dir
|
||||
sudo systemctl status bacula-sd
|
||||
sudo systemctl status bacula-fd
|
||||
```
|
||||
|
||||
### 5.2 Directory Structure
|
||||
|
||||
Bacula installs to `/opt/bacula/`:
|
||||
|
||||
```
|
||||
/opt/bacula/
|
||||
bin/ - Bacula binaries
|
||||
etc/ - Configuration files
|
||||
lib/ - Shared libraries
|
||||
plugins/ - Plugins (bpipe, aligned, etc.)
|
||||
scripts/ - Helper scripts
|
||||
working/ - Temporary files, PID files
|
||||
```
|
||||
|
||||
### 5.3 Configuration Files
|
||||
|
||||
Main configuration files:
|
||||
|
||||
- `/opt/bacula/etc/bacula-dir.conf` - Director configuration
|
||||
- `/opt/bacula/etc/bacula-sd.conf` - Storage Daemon configuration
|
||||
- `/opt/bacula/etc/bacula-fd.conf` - File Daemon configuration
|
||||
- `/opt/bacula/etc/bconsole.conf` - Console configuration
|
||||
|
||||
### 5.4 Database Configuration
|
||||
|
||||
Bacula uses PostgreSQL database. Verify connection:
|
||||
|
||||
```bash
|
||||
# Check database exists
|
||||
sudo -u postgres psql -l | grep bacula
|
||||
|
||||
# Connect to Bacula database
|
||||
sudo -u postgres psql -d bacula
|
||||
|
||||
# List tables
|
||||
\dt
|
||||
|
||||
# Exit
|
||||
\q
|
||||
```
|
||||
|
||||
### 5.5 Test Configuration
|
||||
|
||||
Test each component:
|
||||
|
||||
```bash
|
||||
# Test Director configuration
|
||||
sudo /opt/bacula/bin/bacula-dir -t -u bacula -g bacula
|
||||
|
||||
# Test Storage Daemon configuration
|
||||
sudo /opt/bacula/bin/bacula-sd -t -u bacula -g bacula
|
||||
|
||||
# Test File Daemon configuration
|
||||
sudo /opt/bacula/bin/bacula-fd -t -u bacula -g bacula
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. Integration with Calypso
|
||||
|
||||
### 6.1 Database Integration
|
||||
|
||||
Calypso can access Bacula database directly. Ensure Calypso database user has access:
|
||||
|
||||
```bash
|
||||
# Grant access to Calypso user (if using separate databases)
|
||||
sudo -u postgres psql -c "GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO calypso;" bacula
|
||||
```
|
||||
|
||||
### 6.2 bconsole Integration
|
||||
|
||||
Calypso uses `bconsole` to execute Bacula commands. Verify bconsole works:
|
||||
|
||||
```bash
|
||||
sudo -u bacula /opt/bacula/bin/bconsole
|
||||
```
|
||||
|
||||
In bconsole, test commands:
|
||||
|
||||
```
|
||||
* status director
|
||||
* show jobs
|
||||
* quit
|
||||
```
|
||||
|
||||
### 6.3 Service Management
|
||||
|
||||
Bacula services are managed via systemd:
|
||||
|
||||
```bash
|
||||
# Start services
|
||||
sudo systemctl start bacula-dir
|
||||
sudo systemctl start bacula-sd
|
||||
sudo systemctl start bacula-fd
|
||||
|
||||
# Enable on boot
|
||||
sudo systemctl enable bacula-dir
|
||||
sudo systemctl enable bacula-sd
|
||||
sudo systemctl enable bacula-fd
|
||||
|
||||
# Check status
|
||||
sudo systemctl status bacula-dir
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 7. Basic Configuration
|
||||
|
||||
### 7.1 Director Configuration
|
||||
|
||||
Edit `/opt/bacula/etc/bacula-dir.conf`:
|
||||
|
||||
```bash
|
||||
sudo nano /opt/bacula/etc/bacula-dir.conf
|
||||
```
|
||||
|
||||
Key sections to configure:
|
||||
- **Director** - Director name and password
|
||||
- **Catalog** - Database connection
|
||||
- **Storage** - Storage daemon connection
|
||||
- **Pool** - Backup pool configuration
|
||||
- **Schedule** - Backup schedules
|
||||
- **Client** - Client definitions
|
||||
|
||||
### 7.2 Storage Daemon Configuration
|
||||
|
||||
Edit `/opt/bacula/etc/bacula-sd.conf`:
|
||||
|
||||
```bash
|
||||
sudo nano /opt/bacula/etc/bacula-sd.conf
|
||||
```
|
||||
|
||||
Key sections:
|
||||
- **Storage** - Storage daemon name
|
||||
- **Director** - Director connection
|
||||
- **Device** - Storage devices (disk, tape, etc.)
|
||||
|
||||
### 7.3 File Daemon Configuration
|
||||
|
||||
Edit `/opt/bacula/etc/bacula-fd.conf`:
|
||||
|
||||
```bash
|
||||
sudo nano /opt/bacula/etc/bacula-fd.conf
|
||||
```
|
||||
|
||||
Key sections:
|
||||
- **Director** - Director connection
|
||||
- **FileDaemon** - File daemon settings
|
||||
|
||||
### 7.4 Reload Configuration
|
||||
|
||||
After editing configuration:
|
||||
|
||||
```bash
|
||||
# Test configuration first
|
||||
sudo /opt/bacula/bin/bacula-dir -t -u bacula -g bacula
|
||||
|
||||
# If test passes, reload via bconsole
|
||||
sudo -u bacula /opt/bacula/bin/bconsole
|
||||
* reload
|
||||
* quit
|
||||
|
||||
# Or restart service
|
||||
sudo systemctl restart bacula-dir
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 8. Storage Device Configuration
|
||||
|
||||
### 8.1 Disk Storage
|
||||
|
||||
Configure disk-based storage in `bacula-sd.conf`:
|
||||
|
||||
```
|
||||
Device {
|
||||
Name = FileStorage
|
||||
Media Type = File
|
||||
Archive Device = /srv/calypso/backups
|
||||
LabelMedia = yes
|
||||
Random Access = yes
|
||||
AutomaticMount = yes
|
||||
RemovableMedia = no
|
||||
AlwaysOpen = no
|
||||
}
|
||||
```
|
||||
|
||||
### 8.2 Tape Storage
|
||||
|
||||
For physical tape libraries:
|
||||
|
||||
```
|
||||
Device {
|
||||
Name = TapeDrive-0
|
||||
Media Type = LTO-8
|
||||
Archive Device = /dev/nst0
|
||||
AutomaticMount = yes
|
||||
AlwaysOpen = no
|
||||
RemovableMedia = yes
|
||||
RandomAccess = no
|
||||
MaximumFileSize = 10GB
|
||||
MaximumBlockSize = 524288
|
||||
MaximumOpenWait = 10 min
|
||||
MaximumRewindWait = 2 min
|
||||
MaximumOpenVolumes = 1
|
||||
LabelMedia = yes
|
||||
AutoChanger = yes
|
||||
ChangerDevice = /dev/sg0
|
||||
ChangerCommand = "/opt/bacula/scripts/mtx-changer %c %o %S %a %d"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 9. Client Configuration
|
||||
|
||||
### 9.1 Adding a Client in Director
|
||||
|
||||
Edit `/opt/bacula/etc/bacula-dir.conf` and add:
|
||||
|
||||
```
|
||||
Client {
|
||||
Name = client-fd
|
||||
Address = client.example.com
|
||||
FDPort = 9102
|
||||
Catalog = MyCatalog
|
||||
Password = "client-password"
|
||||
File Retention = 60 days
|
||||
Job Retention = 6 months
|
||||
AutoPrune = yes
|
||||
}
|
||||
```
|
||||
|
||||
### 9.2 Installing File Daemon on Client
|
||||
|
||||
On the client machine:
|
||||
|
||||
```bash
|
||||
# Install client package
|
||||
sudo apt-get install -y bacula-client
|
||||
|
||||
# Edit configuration
|
||||
sudo nano /opt/bacula/etc/bacula-fd.conf
|
||||
```
|
||||
|
||||
Configure:
|
||||
|
||||
```
|
||||
Director {
|
||||
Name = bacula-dir
|
||||
Password = "client-password"
|
||||
}
|
||||
|
||||
FileDaemon {
|
||||
Name = client-fd
|
||||
FDport = 9102
|
||||
WorkingDirectory = /opt/bacula/working
|
||||
Pid Directory = /opt/bacula/working
|
||||
Maximum Concurrent Jobs = 2
|
||||
Plugin Directory = /opt/bacula/plugins
|
||||
}
|
||||
|
||||
Messages {
|
||||
Name = Standard
|
||||
director = bacula-dir = all, !skipped, !restored
|
||||
}
|
||||
```
|
||||
|
||||
### 9.3 Test and Start Client
|
||||
|
||||
```bash
|
||||
# Test configuration
|
||||
sudo /opt/bacula/bin/bacula-fd -t -u bacula -g bacula
|
||||
|
||||
# Start service
|
||||
sudo systemctl start bacula-fd
|
||||
sudo systemctl enable bacula-fd
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 10. Verification
|
||||
|
||||
### 10.1 Check Services
|
||||
|
||||
```bash
|
||||
# Check all Bacula services
|
||||
sudo systemctl status bacula-dir
|
||||
sudo systemctl status bacula-sd
|
||||
sudo systemctl status bacula-fd
|
||||
|
||||
# Check logs
|
||||
sudo journalctl -u bacula-dir -f
|
||||
sudo journalctl -u bacula-sd -f
|
||||
```
|
||||
|
||||
### 10.2 Test with bconsole
|
||||
|
||||
```bash
|
||||
sudo -u bacula /opt/bacula/bin/bconsole
|
||||
```
|
||||
|
||||
Test commands:
|
||||
|
||||
```
|
||||
* status director
|
||||
* status storage
|
||||
* status client=client-fd
|
||||
* show jobs
|
||||
* show pools
|
||||
* show volumes
|
||||
* quit
|
||||
```
|
||||
|
||||
### 10.3 Run Test Backup
|
||||
|
||||
Create a test job in Director configuration, then:
|
||||
|
||||
```bash
|
||||
sudo -u bacula /opt/bacula/bin/bconsole
|
||||
* run job=TestJob
|
||||
* messages
|
||||
* quit
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 11. Upgrade Procedures
|
||||
|
||||
### 11.1 Backup Configuration
|
||||
|
||||
Before upgrading:
|
||||
|
||||
```bash
|
||||
# Backup configuration files
|
||||
sudo cp -r /opt/bacula/etc /opt/bacula/etc.backup.$(date +%Y%m%d)
|
||||
|
||||
# Backup database
|
||||
sudo -u bacula /opt/bacula/scripts/make_catalog_backup.pl MyCatalog
|
||||
sudo cp /opt/bacula/working/bacula.sql /tmp/bacula-backup-$(date +%Y%m%d).sql
|
||||
```
|
||||
|
||||
### 11.2 Minor Upgrade
|
||||
|
||||
For minor version upgrades (e.g., 13.0.1 → 13.0.2):
|
||||
|
||||
```bash
|
||||
# Update repository version in /etc/apt/sources.list.d/Bacula-Community.list
|
||||
# Update package lists
|
||||
sudo apt-get update
|
||||
|
||||
# Upgrade packages
|
||||
sudo apt-get upgrade bacula-postgresql
|
||||
```
|
||||
|
||||
### 11.3 Major Upgrade
|
||||
|
||||
For major upgrades, follow Bacula's upgrade documentation. Generally:
|
||||
|
||||
1. Backup everything
|
||||
2. Update repository configuration
|
||||
3. Upgrade packages
|
||||
4. Run database migration scripts (if provided)
|
||||
5. Test configuration
|
||||
6. Restart services
|
||||
|
||||
---
|
||||
|
||||
## 12. Troubleshooting
|
||||
|
||||
### 12.1 Common Issues
|
||||
|
||||
**Issue: Database connection failed**
|
||||
|
||||
```bash
|
||||
# Check PostgreSQL is running
|
||||
sudo systemctl status postgresql
|
||||
|
||||
# Check database exists
|
||||
sudo -u postgres psql -l | grep bacula
|
||||
|
||||
# Test connection
|
||||
sudo -u postgres psql -d bacula -c "SELECT version();"
|
||||
```
|
||||
|
||||
**Issue: Service won't start**
|
||||
|
||||
```bash
|
||||
# Check configuration syntax
|
||||
sudo /opt/bacula/bin/bacula-dir -t -u bacula -g bacula
|
||||
|
||||
# Check logs
|
||||
sudo journalctl -u bacula-dir -n 50
|
||||
|
||||
# Check permissions
|
||||
ls -la /opt/bacula/working
|
||||
```
|
||||
|
||||
**Issue: bconsole connection failed**
|
||||
|
||||
```bash
|
||||
# Check Director is running
|
||||
sudo systemctl status bacula-dir
|
||||
|
||||
# Check network connectivity
|
||||
telnet localhost 9101
|
||||
|
||||
# Verify bconsole.conf
|
||||
cat /opt/bacula/etc/bconsole.conf
|
||||
```
|
||||
|
||||
### 12.2 Log Locations
|
||||
|
||||
- **Systemd logs:** `sudo journalctl -u bacula-dir`
|
||||
- **Bacula logs:** `/opt/bacula/working/bacula.log`
|
||||
- **PostgreSQL logs:** `/var/log/postgresql/`
|
||||
|
||||
---
|
||||
|
||||
## 13. Security Considerations
|
||||
|
||||
### 13.1 Passwords
|
||||
|
||||
- Change default passwords in configuration files
|
||||
- Use strong passwords for Director, Storage, and Client
|
||||
- Store passwords securely (consider using Calypso's secret management)
|
||||
|
||||
### 13.2 File Permissions
|
||||
|
||||
```bash
|
||||
# Set proper permissions
|
||||
sudo chown -R bacula:bacula /opt/bacula/etc
|
||||
sudo chmod 600 /opt/bacula/etc/*.conf
|
||||
sudo chmod 755 /opt/bacula/bin/*
|
||||
```
|
||||
|
||||
### 13.3 Network Security
|
||||
|
||||
- Use firewall rules to restrict access
|
||||
- Consider VPN for remote clients
|
||||
- Use TLS/SSL for network communication (if configured)
|
||||
|
||||
---
|
||||
|
||||
## 14. Integration with Calypso API
|
||||
|
||||
### 14.1 Database Access
|
||||
|
||||
Calypso can query Bacula database directly:
|
||||
|
||||
```sql
|
||||
-- Example: List recent jobs
|
||||
SELECT JobId, Job, Level, JobStatus, StartTime, EndTime
|
||||
FROM Job
|
||||
ORDER BY StartTime DESC
|
||||
LIMIT 10;
|
||||
```
|
||||
|
||||
### 14.2 bconsole Commands
|
||||
|
||||
Calypso executes bconsole commands via API:
|
||||
|
||||
```bash
|
||||
# Example command execution
|
||||
echo "status director" | sudo -u bacula /opt/bacula/bin/bconsole
|
||||
```
|
||||
|
||||
### 14.3 Configuration Management
|
||||
|
||||
Calypso can:
|
||||
- Read Bacula configuration files
|
||||
- Update configuration via API
|
||||
- Apply configuration changes
|
||||
- Monitor Bacula services
|
||||
|
||||
---
|
||||
|
||||
## 15. Best Practices
|
||||
|
||||
### 15.1 Regular Maintenance
|
||||
|
||||
- **Database backups:** Regular catalog backups
|
||||
- **Log rotation:** Configure log rotation
|
||||
- **Volume management:** Regular volume labeling and testing
|
||||
- **Job monitoring:** Monitor job success/failure rates
|
||||
|
||||
### 15.2 Performance Tuning
|
||||
|
||||
- Adjust concurrent jobs based on system resources
|
||||
- Configure appropriate block sizes for tape devices
|
||||
- Use compression for network backups
|
||||
- Optimize database queries
|
||||
|
||||
### 15.3 Monitoring
|
||||
|
||||
- Set up alerting for failed jobs
|
||||
- Monitor storage capacity
|
||||
- Track backup completion times
|
||||
- Review logs regularly
|
||||
|
||||
---
|
||||
|
||||
## 16. References
|
||||
|
||||
- **Official Bacula Documentation:** https://www.bacula.org/documentation/
|
||||
- **Bacula Community Installation Guide:** https://www.bacula.org/whitepapers/CommunityInstallationGuide.pdf
|
||||
- **Bacula Concept Guide:** https://www.bacula.org/whitepapers/ConceptGuide.pdf
|
||||
- **Bacula Main Manual:** https://www.bacula.org/documentation/documentation/
|
||||
- **Bacula Support:** https://www.bacula.org/support
|
||||
|
||||
---
|
||||
|
||||
## 17. Appendix
|
||||
|
||||
### 17.1 Default Ports
|
||||
|
||||
- **Director:** 9101
|
||||
- **Storage Daemon:** 9103
|
||||
- **File Daemon:** 9102
|
||||
- **Console:** Connects to Director on 9101
|
||||
|
||||
### 17.2 Default Users
|
||||
|
||||
- **System User:** `bacula`
|
||||
- **Database User:** `bacula`
|
||||
- **Database Name:** `bacula`
|
||||
|
||||
### 17.3 Important Files
|
||||
|
||||
- **Configuration:** `/opt/bacula/etc/`
|
||||
- **Binaries:** `/opt/bacula/bin/`
|
||||
- **Working Directory:** `/opt/bacula/working/`
|
||||
- **Logs:** `/opt/bacula/working/bacula.log`
|
||||
- **Scripts:** `/opt/bacula/scripts/`
|
||||
|
||||
---
|
||||
|
||||
## Document History
|
||||
|
||||
| Version | Date | Author | Changes |
|
||||
|---------|------|--------|---------|
|
||||
| 1.0 | 2025-01-XX | Development Team | Initial Bacula installation guide for Calypso |
|
||||
|
||||
153
docs/alpha/components/bacula/Bacula-Installation-Guide.md
Normal file
153
docs/alpha/components/bacula/Bacula-Installation-Guide.md
Normal file
@@ -0,0 +1,153 @@
|
||||
|
||||
# Bacula Installation and Configuration Guide for Ubuntu 24.04
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
This guide provides step-by-step instructions for installing and configuring Bacula on Ubuntu 24.04. The configuration files will be moved to a custom directory: `/opt/calypso/conf/bacula`.
|
||||
|
||||
## 2. Installation
|
||||
|
||||
First, update the package lists and install the Bacula components and a PostgreSQL database backend.
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y bacula-director bacula-sd bacula-fd postgresql
|
||||
```
|
||||
|
||||
During the installation, you may be prompted to configure a mail server. You can choose "No configuration" for now.
|
||||
|
||||
### 2.1. Install Bacula Console
|
||||
|
||||
Install the Bacula console, which provides the `bconsole` command-line utility for interacting with the Bacula Director.
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y bacula-console
|
||||
```
|
||||
|
||||
## 3. Database Configuration
|
||||
|
||||
Create the Bacula database and user.
|
||||
|
||||
```bash
|
||||
sudo -u postgres createuser -P bacula
|
||||
sudo -u postgres createdb -O bacula bacula
|
||||
```
|
||||
|
||||
When prompted, enter a password for the `bacula` user. You will need this password later.
|
||||
|
||||
Now, grant privileges to the `bacula` user on the `bacula` database.
|
||||
|
||||
```bash
|
||||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE bacula TO bacula;"
|
||||
```
|
||||
|
||||
Bacula provides scripts to create the necessary tables in the database.
|
||||
|
||||
```bash
|
||||
sudo /usr/share/bacula-director/make_postgresql_tables.sql | sudo -u postgres psql bacula
|
||||
```
|
||||
|
||||
## 4. Configuration File Migration
|
||||
|
||||
Create the new configuration directory and copy the default configuration files.
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /opt/calypso/conf/bacula
|
||||
sudo cp /etc/bacula/* /opt/calypso/conf/bacula/
|
||||
sudo chown -R bacula:bacula /opt/calypso/conf/bacula
|
||||
```
|
||||
|
||||
## 5. Systemd Service Configuration
|
||||
|
||||
Create override files for the `bacula-director` and `bacula-sd` services to point to the new configuration file locations.
|
||||
|
||||
### 5.1. Bacula Director
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/systemd/system/bacula-director.service.d
|
||||
sudo bash -c 'cat > /etc/systemd/system/bacula-director.service.d/override.conf <<EOF
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/bacula-dir -f -c /opt/calypso/conf/bacula/bacula-dir.conf
|
||||
EOF'
|
||||
```
|
||||
|
||||
### 5.2. Bacula Storage Daemon
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/systemd/system/bacula-sd.service.d
|
||||
sudo bash -c 'cat > /etc/systemd/system/bacula-sd.service.d/override.conf <<EOF
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/bacula-sd -f -c /opt/calypso/conf/bacula/bacula-sd.conf
|
||||
EOF'
|
||||
```
|
||||
|
||||
### 5.3. Bacula File Daemon
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/systemd/system/bacula-fd.service.d
|
||||
sudo bash -c 'cat > /etc/systemd/system/bacula-fd.service.d/override.conf <<EOF
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/bacula-fd -f -c /opt/calypso/conf/bacula/bacula-fd.conf
|
||||
EOF'
|
||||
```
|
||||
|
||||
Reload the systemd daemon to apply the changes.
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
## 6. Bacula Configuration
|
||||
|
||||
Update the `bacula-dir.conf` and `bacula-sd.conf` files to use the new paths and settings.
|
||||
|
||||
### 6.1. Bacula Director Configuration
|
||||
|
||||
Edit `/opt/calypso/conf/bacula/bacula-dir.conf` and make the following changes:
|
||||
|
||||
* In the `Storage` resource, update the `address` to point to the correct IP address or hostname.
|
||||
* In the `Catalog` resource, update the `dbuser` and `dbpassword` with the values you set in step 3.
|
||||
* Update any other paths as necessary.
|
||||
|
||||
### 6.2. Bacula Storage Daemon Configuration
|
||||
|
||||
Edit `/opt/calypso/conf/bacula/bacula-sd.conf` and make the following changes:
|
||||
|
||||
* In the `Storage` resource, update the `SDAddress` to point to the correct IP address or hostname.
|
||||
* Create a directory for the storage device and set the correct permissions.
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /var/lib/bacula/storage
|
||||
sudo chown -R bacula:tape /var/lib/bacula/storage
|
||||
```
|
||||
|
||||
* In the `Device` resource, update the `Archive Device` to point to the storage directory you just created. For example:
|
||||
|
||||
```
|
||||
Device {
|
||||
Name = FileStorage
|
||||
Media Type = File
|
||||
Archive Device = /var/lib/bacula/storage
|
||||
LabelMedia = yes;
|
||||
Random Access = Yes;
|
||||
AutomaticMount = yes;
|
||||
RemovableMedia = no;
|
||||
AlwaysOpen = no;
|
||||
}
|
||||
```
|
||||
|
||||
## 7. Starting and Verifying Services
|
||||
|
||||
Start the Bacula services and check their status.
|
||||
|
||||
```bash
|
||||
sudo systemctl start bacula-director bacula-sd bacula-fd
|
||||
sudo systemctl status bacula-director bacula-sd bacula-fd
|
||||
```
|
||||
|
||||
## 8. SELinux/AppArmor
|
||||
|
||||
If you are using SELinux or AppArmor, you may need to adjust the security policies to allow Bacula to access the new configuration directory and storage directory. The specific steps will depend on your security policy.
|
||||
Reference in New Issue
Block a user