$ Storage { Name = bacula-sd SDPort = 9103 WorkingDirectory = "/opt/bacula/working" Pid Directory = "/opt/bacula/working" Plugin Directory = "/opt/bacula/plugins" Maximum Concurrent Jobs = 50 # ← AUMENTADO Heartbeat Interval = 60
}
Storage { Name = bacula-sd SDPort = 9103 WorkingDirectory = "/opt/bacula/working" Pid Directory = "/opt/bacula/working" Plugin Directory = "/opt/bacula/plugins" Maximum Concurrent Jobs = 50 # ← AUMENTADO Heartbeat Interval = 60
}
Storage { Name = bacula-sd SDPort = 9103 WorkingDirectory = "/opt/bacula/working" Pid Directory = "/opt/bacula/working" Plugin Directory = "/opt/bacula/plugins" Maximum Concurrent Jobs = 50 # ← AUMENTADO Heartbeat Interval = 60
}
Director { Name = bacula-dir Password = "[SENHA-DO-DIRECTOR]"
}
Director { Name = bacula-dir Password = "[SENHA-DO-DIRECTOR]"
}
Director { Name = bacula-dir Password = "[SENHA-DO-DIRECTOR]"
}
Autochanger { Name = FileChgr1 Device = FileChgr1-Dev1, FileChgr1-Dev2, FileChgr1-Dev3, FileChgr1-Dev4, FileChgr1-Dev5 Device = FileChgr1-Dev6, FileChgr1-Dev7, FileChgr1-Dev8, FileChgr1-Dev9, FileChgr1-Dev10 Changer Command = "" Changer Device = /dev/null
}
Autochanger { Name = FileChgr1 Device = FileChgr1-Dev1, FileChgr1-Dev2, FileChgr1-Dev3, FileChgr1-Dev4, FileChgr1-Dev5 Device = FileChgr1-Dev6, FileChgr1-Dev7, FileChgr1-Dev8, FileChgr1-Dev9, FileChgr1-Dev10 Changer Command = "" Changer Device = /dev/null
}
Autochanger { Name = FileChgr1 Device = FileChgr1-Dev1, FileChgr1-Dev2, FileChgr1-Dev3, FileChgr1-Dev4, FileChgr1-Dev5 Device = FileChgr1-Dev6, FileChgr1-Dev7, FileChgr1-Dev8, FileChgr1-Dev9, FileChgr1-Dev10 Changer Command = "" Changer Device = /dev/null
}
# Device 1
Device { Name = FileChgr1-Dev1 Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spool1
}
# Device 1
Device { Name = FileChgr1-Dev1 Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spool1
}
# Device 1
Device { Name = FileChgr1-Dev1 Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spool1
}
# Device 1 (Replique este modelo alterando Name e Spool Directory)
Device { Name = FileChgr1-Dev1 # ← Mudar para Dev2, Dev3... até Dev10 Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spool1 # ← Mudar para spool2, spool3... até spool10
}
# Device 1 (Replique este modelo alterando Name e Spool Directory)
Device { Name = FileChgr1-Dev1 # ← Mudar para Dev2, Dev3... até Dev10 Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spool1 # ← Mudar para spool2, spool3... até spool10
}
# Device 1 (Replique este modelo alterando Name e Spool Directory)
Device { Name = FileChgr1-Dev1 # ← Mudar para Dev2, Dev3... até Dev10 Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spool1 # ← Mudar para spool2, spool3... até spool10
}
#!/bin/bash
# Script: gerar_10_devices.sh
# Gera 10 arquivos de configuração de Devices para Bacula cd /opt/bacula/etc/conf.d/StorageDaemon/bacula-sd/Device/ # Modelo base
cat > device-modelo.conf <<'EOF'
Device { Name = FileChgr1-DevX Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spoolX
}
EOF # Gerar 10 devices
for i in $(seq 1 10); do sed "s/DevX/Dev$i/g; s/spoolX/spool$i/g" device-modelo.conf > "FileChgr1-Dev${i}.cfg" echo "✅ Criado: FileChgr1-Dev${i}.cfg"
done rm device-modelo.conf
echo "✅ 10 Devices criados! Execute 'reload' no bconsole."
#!/bin/bash
# Script: gerar_10_devices.sh
# Gera 10 arquivos de configuração de Devices para Bacula cd /opt/bacula/etc/conf.d/StorageDaemon/bacula-sd/Device/ # Modelo base
cat > device-modelo.conf <<'EOF'
Device { Name = FileChgr1-DevX Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spoolX
}
EOF # Gerar 10 devices
for i in $(seq 1 10); do sed "s/DevX/Dev$i/g; s/spoolX/spool$i/g" device-modelo.conf > "FileChgr1-Dev${i}.cfg" echo "✅ Criado: FileChgr1-Dev${i}.cfg"
done rm device-modelo.conf
echo "✅ 10 Devices criados! Execute 'reload' no bconsole."
#!/bin/bash
# Script: gerar_10_devices.sh
# Gera 10 arquivos de configuração de Devices para Bacula cd /opt/bacula/etc/conf.d/StorageDaemon/bacula-sd/Device/ # Modelo base
cat > device-modelo.conf <<'EOF'
Device { Name = FileChgr1-DevX Media Type = File1 Archive Device = /backup LabelMedia = yes Random Access = yes AutomaticMount = yes RemovableMedia = no AlwaysOpen = no PreferMountedVolumes = no # Obrigatório para distribuir jobs Maximum Concurrent Jobs = 5 Maximum Spool Size = 100G Spool Directory = /opt/bacula/working/spoolX
}
EOF # Gerar 10 devices
for i in $(seq 1 10); do sed "s/DevX/Dev$i/g; s/spoolX/spool$i/g" device-modelo.conf > "FileChgr1-Dev${i}.cfg" echo "✅ Criado: FileChgr1-Dev${i}.cfg"
done rm device-modelo.conf
echo "✅ 10 Devices criados! Execute 'reload' no bconsole."
# 1. Salvar o script
nano gerar_10_devices.sh
# Cole o conteúdo acima # 2. Dar permissão
chmod +x gerar_10_devices.sh # 3. Executar
./gerar_10_devices.sh # 4. Verificar se foi criado
ls -l /opt/bacula/etc/conf.d/StorageDaemon/bacula-sd/Device/FileChgr1-Dev*.cfg # 5. Recarregar Storage Daemon
-weight: 500;">systemctl reload bacula-sd
# 1. Salvar o script
nano gerar_10_devices.sh
# Cole o conteúdo acima # 2. Dar permissão
chmod +x gerar_10_devices.sh # 3. Executar
./gerar_10_devices.sh # 4. Verificar se foi criado
ls -l /opt/bacula/etc/conf.d/StorageDaemon/bacula-sd/Device/FileChgr1-Dev*.cfg # 5. Recarregar Storage Daemon
-weight: 500;">systemctl reload bacula-sd
# 1. Salvar o script
nano gerar_10_devices.sh
# Cole o conteúdo acima # 2. Dar permissão
chmod +x gerar_10_devices.sh # 3. Executar
./gerar_10_devices.sh # 4. Verificar se foi criado
ls -l /opt/bacula/etc/conf.d/StorageDaemon/bacula-sd/Device/FileChgr1-Dev*.cfg # 5. Recarregar Storage Daemon
-weight: 500;">systemctl reload bacula-sd
Messages { Name = Standard director = bacula-dir = all
}
Messages { Name = Standard director = bacula-dir = all
}
Messages { Name = Standard director = bacula-dir = all
}
-weight: 600;">sudo mkdir -p /opt/bacula/working/spool{1..10}
-weight: 600;">sudo chown -R bacula:bacula /opt/bacula/working/spool*
-weight: 600;">sudo chmod 755 /opt/bacula/working/spool*
-weight: 600;">sudo mkdir -p /opt/bacula/working/spool{1..10}
-weight: 600;">sudo chown -R bacula:bacula /opt/bacula/working/spool*
-weight: 600;">sudo chmod 755 /opt/bacula/working/spool*
-weight: 600;">sudo mkdir -p /opt/bacula/working/spool{1..10}
-weight: 600;">sudo chown -R bacula:bacula /opt/bacula/working/spool*
-weight: 600;">sudo chmod 755 /opt/bacula/working/spool*
df -h /backup
df -h /opt/bacula/working # Recomendação:
# /backup: Mínimo 2 TB (idealmente NVMe RAID 10)
# /opt/bacula/working: Mínimo 1 TB (para spool de 10 devices x 100 GB)
df -h /backup
df -h /opt/bacula/working # Recomendação:
# /backup: Mínimo 2 TB (idealmente NVMe RAID 10)
# /opt/bacula/working: Mínimo 1 TB (para spool de 10 devices x 100 GB)
df -h /backup
df -h /opt/bacula/working # Recomendação:
# /backup: Mínimo 2 TB (idealmente NVMe RAID 10)
# /opt/bacula/working: Mínimo 1 TB (para spool de 10 devices x 100 GB)
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart bacula-sd
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status bacula-sd
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart bacula-sd
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status bacula-sd
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart bacula-sd
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status bacula-sd
Storage { Name = File1 Address = bacula.exemplo.com SDPort = 9103 Password = "[SENHA]" Device = FileChgr1 # ← Aponta para o Autochanger Media Type = File1 Maximum Concurrent Jobs = 50 # ← AUMENTADO AllowCompression = yes
}
Storage { Name = File1 Address = bacula.exemplo.com SDPort = 9103 Password = "[SENHA]" Device = FileChgr1 # ← Aponta para o Autochanger Media Type = File1 Maximum Concurrent Jobs = 50 # ← AUMENTADO AllowCompression = yes
}
Storage { Name = File1 Address = bacula.exemplo.com SDPort = 9103 Password = "[SENHA]" Device = FileChgr1 # ← Aponta para o Autochanger Media Type = File1 Maximum Concurrent Jobs = 50 # ← AUMENTADO AllowCompression = yes
}
Pool { Name = Default Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 365 days Maximum Volume Bytes = 50G Maximum Volumes = 200 # ← Ajustar para comportar mais volumes Label Format = "Vol-" Storage = File1
}
Pool { Name = Default Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 365 days Maximum Volume Bytes = 50G Maximum Volumes = 200 # ← Ajustar para comportar mais volumes Label Format = "Vol-" Storage = File1
}
Pool { Name = Default Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 365 days Maximum Volume Bytes = 50G Maximum Volumes = 200 # ← Ajustar para comportar mais volumes Label Format = "Vol-" Storage = File1
}
Running Jobs:
JobId Level Files Bytes Status Finished Name
==============================
1042 Full 54,321 450 GB OK 18:30:00 Backup-DB-01
1043 Full 12,100 120 GB OK 18:32:15 Backup-App-05
...
SD Status:
Device "FileChgr1-Dev1" is mounted with: Volume: Vol-0001 Pool: Default Media Type: File1 Write Speed: 105 MB/s
...
Total Throughput: 850 MB/s
Running Jobs:
JobId Level Files Bytes Status Finished Name
==============================
1042 Full 54,321 450 GB OK 18:30:00 Backup-DB-01
1043 Full 12,100 120 GB OK 18:32:15 Backup-App-05
...
SD Status:
Device "FileChgr1-Dev1" is mounted with: Volume: Vol-0001 Pool: Default Media Type: File1 Write Speed: 105 MB/s
...
Total Throughput: 850 MB/s
Running Jobs:
JobId Level Files Bytes Status Finished Name
==============================
1042 Full 54,321 450 GB OK 18:30:00 Backup-DB-01
1043 Full 12,100 120 GB OK 18:32:15 Backup-App-05
...
SD Status:
Device "FileChgr1-Dev1" is mounted with: Volume: Vol-0001 Pool: Default Media Type: File1 Write Speed: 105 MB/s
...
Total Throughput: 850 MB/s
bconsole
*-weight: 500;">status storage=File1 # Saída esperada:
Device "FileChgr1-Dev1" (/backup) is not open.
Device "FileChgr1-Dev2" (/backup) is not open.
...
Device "FileChgr1-Dev10" (/backup) is not open. Auto-select Storage Devices: FileChgr1-Dev1 to FileChgr1-Dev10
bconsole
*-weight: 500;">status storage=File1 # Saída esperada:
Device "FileChgr1-Dev1" (/backup) is not open.
Device "FileChgr1-Dev2" (/backup) is not open.
...
Device "FileChgr1-Dev10" (/backup) is not open. Auto-select Storage Devices: FileChgr1-Dev1 to FileChgr1-Dev10
bconsole
*-weight: 500;">status storage=File1 # Saída esperada:
Device "FileChgr1-Dev1" (/backup) is not open.
Device "FileChgr1-Dev2" (/backup) is not open.
...
Device "FileChgr1-Dev10" (/backup) is not open. Auto-select Storage Devices: FileChgr1-Dev1 to FileChgr1-Dev10
for i in {1..10}; do echo "run job=backup-cliente-$i yes" | bconsole
done *-weight: 500;">status dir
for i in {1..10}; do echo "run job=backup-cliente-$i yes" | bconsole
done *-weight: 500;">status dir
for i in {1..10}; do echo "run job=backup-cliente-$i yes" | bconsole
done *-weight: 500;">status dir
# Em terminal separado
watch -n 2 "iostat -x 1 1 | grep -E 'nvme|sda'" # Verificar taxa de escrita no /backup
watch -n 1 "du -sh /backup"
# Em terminal separado
watch -n 2 "iostat -x 1 1 | grep -E 'nvme|sda'" # Verificar taxa de escrita no /backup
watch -n 1 "du -sh /backup"
# Em terminal separado
watch -n 2 "iostat -x 1 1 | grep -E 'nvme|sda'" # Verificar taxa de escrita no /backup
watch -n 1 "du -sh /backup"
#!/bin/bash
# device_usage.sh echo "=== Device Usage ===" bconsole <<EOF | grep -E "Dev[0-9]|JobId"
-weight: 500;">status storage=File1
EOF echo -e "
=== Jobs por Device ==="
bconsole <<EOF | grep -c "Dev1"
-weight: 500;">status dir
EOF
#!/bin/bash
# device_usage.sh echo "=== Device Usage ===" bconsole <<EOF | grep -E "Dev[0-9]|JobId"
-weight: 500;">status storage=File1
EOF echo -e "
=== Jobs por Device ==="
bconsole <<EOF | grep -c "Dev1"
-weight: 500;">status dir
EOF
#!/bin/bash
# device_usage.sh echo "=== Device Usage ===" bconsole <<EOF | grep -E "Dev[0-9]|JobId"
-weight: 500;">status storage=File1
EOF echo -e "
=== Jobs por Device ==="
bconsole <<EOF | grep -c "Dev1"
-weight: 500;">status dir
EOF
# Jobs ativos
*list jobs | tail -20 # Volumes em uso por Device
*list media # Taxa de transferência em tempo real
iostat -xmt 1 | grep -A 5 nvme0n1
# Jobs ativos
*list jobs | tail -20 # Volumes em uso por Device
*list media # Taxa de transferência em tempo real
iostat -xmt 1 | grep -A 5 nvme0n1
# Jobs ativos
*list jobs | tail -20 # Volumes em uso por Device
*list media # Taxa de transferência em tempo real
iostat -xmt 1 | grep -A 5 nvme0n1
Maximum Concurrent Jobs
# Em bacula-dir.conf
Director { Name = bacula-dir Maximum Concurrent Jobs = 50 # ← AUMENTAR
}
# Em bacula-dir.conf
Director { Name = bacula-dir Maximum Concurrent Jobs = 50 # ← AUMENTAR
}
# Em bacula-dir.conf
Director { Name = bacula-dir Maximum Concurrent Jobs = 50 # ← AUMENTAR
}
Maximum Spool Size
# Aumentar tamanho ou desabilitar spool
Maximum Spool Size = 0 # Desabilita (escreve direto no disco)
# Aumentar tamanho ou desabilitar spool
Maximum Spool Size = 0 # Desabilita (escreve direto no disco)
# Aumentar tamanho ou desabilitar spool
Maximum Spool Size = 0 # Desabilita (escreve direto no disco)
iostat -x 1
iftop -i eth0
/opt/bacula/working
Archive Device = /backup - ✅ Ambientes com 50+ clientes fazendo backup simultâneo
- ✅ Storage de alto desempenho (NVMe, SSD RAID 10)
- ✅ Network 10 Gbps+ com múltiplos File Daemons
- ✅ Necessidade de escala horizontal sem adicionar hardware - Mesmo processo bacula-sd (menor overhead de memória)
- Mesma Pool de Volumes (gerenciamento simplificado)
- Mesmo diretório físico (/backup) - Name: FileChgr1-Dev1, Dev2, Dev3... até Dev10
- Spool Directory: spool1, spool2, spool3... até spool10 - Director: Maximum Concurrent Jobs = 50
- Storage: Maximum Concurrent Jobs = 50
- Device: Maximum Concurrent Jobs = 5 (x10 devices = 50)
- Client: Maximum Concurrent Jobs = 1 (ou mais se desejar paralelo no cliente) - I/O do disco está saturado? (iostat -x 1)
- Network está limitada? (iftop -i eth0)
- CPU do Storage Daemon está em 100%? (top) - Use NVMe ou SSD RAID 10: Discos lentos (HDD SATA) não aproveitam múltiplos Devices
- Network 10 Gbps+: Garante que não haverá bottleneck de rede
- Ajuste Spool Size: Configure conforme espaço disponível em /opt/bacula/working
- Monitore Recursos: Use htop, iostat e iftop durante backups
- Aumente Gradualmente: Comece com 5 Devices, depois 10, para identificar gargalos - Documentação Oficial - Autochangers
- Mais tutoriais de Bacula no TecMestre