PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : ratlosigkeit bei bacula



arvidflow
27.04.10, 13:25
hi,
ich versuche nun schon ne weile mich mit bacula zurechtzufinden, nur leider will das nicht so richtig funktionieren. mein ziel ist es aus einem lokalen ordner (auf dem ein nfs gemountet ist) inhalte auf ein tape zu schreiben. der ordner heißt /nfs_bu_folder und der testordner für das backup heißt /teststorage :


backupsys:/etc/bacula# ls /teststorage /nfs_bu_folder
/nfs_bu_folder:
testdatei.txt

/teststorage:

fürs erste würde ich gern erreichen, dass der inhalt (also testdate.txt) ordnungsgemäß im /teststorage gesichert wird.

meine derzeitige situation:
bacula version 2.4.4 ist installiert und arbeitet mit (bzw. soll arbeiten mit) postgres. außerdem soll das ganze auch per bweb administriert werden, welches ich auch bereits, (warscheinlich) erfolgreich installiert habe.
nun weiß ich nicht weiter. ich configuriere und configuriere nun schon seit stunden und nichts will funktionieren. auch bleibt der bacula-dir nach dem systemstart (bei dem dieser dienst auch ohne fehler gestartet wird) nicht am laufen. auch wenn ich anschließend nocheinmal #/etc/init.d/bacula-director start aufrufe kommen zwar keine fehler, aber der dienst läuft lauf pgrep anschließend trotzdem nicht. wenn ich allerdings als root einfach bacula-dir ausführe, ist der dienst anschließend vorhanden. die situation ist dann folgende:


# pgrep bacula
2984
2994
3076

nun könnte man meinen die bconsole sollte funktionieren.


backupsys:~# bconsole
Connecting to Director localhost:9101
27-Apr 14:20 bconsole JobId 0: Fatal error: bsock.c:129 Unable to connect to Director daemon on localhost:9101. ERR=Verbindungsaufbau abgelehnt
backupsys:~# lsof -i :9101
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
bacula-di 3076 root 5u IPv4 7239 TCP backupsys.int.ito-consult.de:bacula-dir (LISTEN)

ich bin verwirrt und weiß nicht mehr was ich noch machen soll. ich habe lediglich die idee, dass in der configuration irgendwas mit den passworten nciht hinhaut, aber aufgrund dessen, dass diese scheinbar als md5-hash eingetragen werden, weiß ich auch nicht wie ich das lösen soll. hier sind meine configurationsdateien. ich hoffe irgendjemand kann mir den weg zum erfolg zeigen.

bacula-dir.conf:


backupsys:/etc/bacula# cat bacula-dir.conf
#
# Default Bacula Director Configuration file
#
# The only thing that MUST be changed is to add one or more
# file or directory names in the Include directive of the
# FileSet resource.
#
# For Bacula release 2.4.4 (28 December 2008) -- debian 5.0
#
# You might also want to change the default email address
# from root to your address. See the "mail" and "operator"
# directives in the Messages resource.
#

Director { # define myself
Name = backupsys-dir
DIRport = 9101 # where we listen for UA connections
QueryFile = "/etc/bacula/scripts/query.sql"
WorkingDirectory = "/var/lib/bacula"
PidDirectory = "/var/run/bacula"
Maximum Concurrent Jobs = 1
Password = "sWaZRqTS1VX2uacyTZNXlI4Ax9Oj5MK1ANC62QBta0xi" # Console password
Messages = Daemon
DirAddress = backupsys
}

# Catalog
Catalog {
Name = MyCatalog
dbname = "bacula"; dbuser = "bacula"; dbpassword = "start"
}

# Media pool
Pool {
Name = Default
LabelFormat = "BackupVol"
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 365 days
}

# Definition of file storage device
Storage {
Name = File
# Do not use "localhost" here
Address = backupsys # N.B. Use a fully qualified name here
SDPort = 9103
Password = "sL0Pjc3Nl1Je8zgVW3u8+0cI+vdIl5XdizCLU0v5dotr"
Device = FileStorage
Media Type = File
}

# Client (File Services) to backup
Client {
Name = backupsys-fd
Address = backupsys
FDPort = 9102
Catalog = MyCatalog
Password = "ARm7qyF3lJSBKJ9NRICUj+Ry3PRJ3EZN92EnilHFVb8/" # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}

# File sets
FileSet {
Name = "Full Set"
Include {
Options {
signature = MD5
}
File = /nfs_bu_folder
}
Exclude {
}
}

FileSet {
Name = "Catalog"
Include {
Options {
signature = MD5
}
File = /var/lib/bacula/bacula.sql
}
}

# When to do the backups, full backup on first sunday of the month,
# differential (i.e. incremental since full) every other sunday,
# and incremental backups other days
Schedule {
Name = "WeeklyCycle"
Run = Full 1st sun at 23:05
Run = Differential 2nd-5th sun at 23:05
Run = Incremental mon-sat at 23:05
}

# This schedule does the catalog. It starts after the WeeklyCycle
Schedule {
Name = "WeeklyCycleAfterBackup"
Run = Full sun-sat at 23:10
}

JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Client = backupsys-fd
FileSet = "Full Set"
Schedule = "WeeklyCycle"
Storage = File
Messages = Standard
Pool = Default
Priority = 10
}

# Define the main nightly save backup job
# By default, this job will back up to disk in /nonexistant/path/to/file/archive/dir
Job {
Name = "Client1"
JobDefs = "DefaultJob"
Write Bootstrap = "/var/lib/bacula/Client1.bsr"
}

# Backup the catalog database (after the nightly save)
Job {
Name = "BackupCatalog"
Client = "backupsys-fd"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"
Schedule = "WeeklyCycleAfterBackup"
# This creates an ASCII copy of the catalog
# WARNING!!! Passing the password via the command line is insecure.
# see comments in make_catalog_backup for details.
# Arguments to make_catalog_backup are:
# make_catalog_backup <database-name> <user-name> <password> <host>
RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup bacula bacula start backupsys"
# This deletes the copy of the catalog
RunAfterJob = "/etc/bacula/scripts/delete_catalog_backup"
Write Bootstrap = "/var/lib/bacula/BackupCatalog.bsr"
Priority = 11 # run after main backup
}

# Reasonable message delivery -- send most everything to email address
# and to the console
Messages {
Name = Standard
#
# NOTE! If you send to two email or more email addresses, you will need
# to replace the %r in the from field (-f part) with a single valid
# email address in both the mailcommand and the operatorcommand.
# What this does is, it sets the email address that emails would display
# in the FROM field, which is by default the same email as they're being
# sent to. However, if you send email to more than one address, then
# you'll have to set the FROM address manually, to a single address.
# for example, a 'no-reply@mydomain.com', is better since that tends to
# tell (most) people that its coming from an automated source.

#
mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
mail = root@localhost = all, !skipped
operator = root@localhost = mount
console = all, !skipped, !saved
#
# WARNING! the following will create a file that you must cycle from
# time to time as it will grow indefinitely. However, it will
# also keep all your messages if they scroll off the console.
#
append = "/var/lib/bacula/log" = all, !skipped
}

# Message delivery for daemon messages (no job).
Messages {
Name = Daemon
mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
mail = root@localhost = all, !skipped
console = all, !skipped, !saved
append = "/var/lib/bacula/log" = all, !skipped
}





















#
# Standard Restore template, to be changed by Console program
# Only one such job is needed for all Jobs/Clients/Storage ...
#
#Job {
# Name = "RestoreFiles"
# Type = Restore
# Client=backupsys-fd
# FileSet="Full Set"
# Storage = File
# Pool = Default
# Messages = Standard
# Where = /nonexistant/path/to/file/archive/dir/bacula-restores
#}

# Definition of DDS tape storage device
#Storage {
# Name = DDS-4
# Do not use "localhost" here
# Address = backupsys # N.B. Use a fully qualified name here
# SDPort = 9103
# Password = "sL0Pjc3Nl1Je8zgVW3u8+0cI+vdIl5XdizCLU0v5dotr" # password for Storage daemon
# Device = DDS-4 # must be same as Device in Storage daemon
# Media Type = DDS-4 # must be same as MediaType in Storage daemon
# Autochanger = yes # enable for autochanger device
#}

# Definition of 8mm tape storage device
#Storage {
# Name = "8mmDrive"
# Do not use "localhost" here
# Address = backupsys # N.B. Use a fully qualified name here
# SDPort = 9103
# Password = "sL0Pjc3Nl1Je8zgVW3u8+0cI+vdIl5XdizCLU0v5dotr"
# Device = "Exabyte 8mm"
# MediaType = "8mm"
#}

#
# Restricted console used by tray-monitor to get the status of the director
#
#Console {
# Name = backupsys-mon
# Password = "qMwcsiwZKWqmrKq1rykrWz96MtoL3D0G8DxO6f0o0v2m"
# CommandACL = status, .status
#}

bacula-fd.conf:


backupsys:/etc/bacula# cat bacula-fd.conf
#
# Default Bacula File Daemon Configuration file
#
# For Bacula release 2.4.4 (28 December 2008) -- debian 5.0
#
# There is not much to change here except perhaps the
# File daemon Name to
#

#
# List Directors who are permitted to contact this File daemon
#
Director {
Name = backupsys-dir
Password = "ARm7qyF3lJSBKJ9NRICUj+Ry3PRJ3EZN92EnilHFVb8/"
}

#
# Restricted Director, used by tray-monitor to get the
# status of the file daemon
#
Director {
Name = backupsys-mon
Password = "OWQaB2VMloOQuB5qrp+kWGzrfJ5nMfK+GVMvu1snxK7E"
Monitor = yes
}

#
# "Global" File daemon configuration specifications
#
FileDaemon { # this is me
Name = backupsys-fd
FDport = 9102 # where we listen for the director
WorkingDirectory = /var/lib/bacula
Pid Directory = /var/run/bacula
Maximum Concurrent Jobs = 20
FDAddress = backupsys
}

# Send all messages except skipped files back to Director
Messages {
Name = Standard
director = backupsys-dir = all, !skipped, !restored
}

bacula-sd.conf:


backupsys:/etc/bacula# cat bacula-sd.conf
#
# Default Bacula Storage Daemon Configuration file
#
# For Bacula release 2.4.4 (28 December 2008) -- debian 5.0
#
# You may need to change the name of your tape drive
# on the "Archive Device" directive in the Device
# resource. If you change the Name and/or the
# "Media Type" in the Device resource, please ensure
# that dird.conf has corresponding changes.
#

Storage { # definition of myself
Name = backupsys-sd
SDPort = 9103 # Director's port
WorkingDirectory = "/var/lib/bacula"
Pid Directory = "/var/run/bacula"
Maximum Concurrent Jobs = 20
SDAddress = backupsys
}

#
# List Directors who are permitted to contact Storage daemon
#
Director {
Name = backupsys-dir
Password = "sL0Pjc3Nl1Je8zgVW3u8+0cI+vdIl5XdizCLU0v5dotr"
}

#
# Restricted Director, used by tray-monitor to get the
# status of the storage daemon
#
Director {
Name = backupsys-mon
Password = "9v4d+PzZv7C5pdB4iR+larCJqMBw6zsAEKPcxKh7ZHdU"
Monitor = yes
}

#
# Devices supported by this Storage daemon
# To connect, the Director's bacula-dir.conf must have the
# same Name and MediaType.
#

Device {
Name = FileStorage
Media Type = File
Archive Device = /teststorage
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}

#
# An autochanger device with two drives
#
#Autochanger {
# Name = Autochanger
# Device = Drive-1
# Device = Drive-2
# Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
# Changer Device = /dev/sg0
#}

#Device {
# Name = Drive-1 #
# Drive Index = 0
# Media Type = DLT-8000
# Archive Device = /dev/nst0
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
# AutoChanger = yes
# #
# # Enable the Alert command only if you have the mtx package loaded
# # Note, apparently on some systems, tapeinfo resets the SCSI controller
# # thus if you turn this on, make sure it does not reset your SCSI
# # controller. I have never had any problems, and smartctl does
# # not seem to cause such problems.
# #
# Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#Device {
# Name = Drive-2 #
# Drive Index = 1
# Media Type = DLT-8000
# Archive Device = /dev/nst1
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
# AutoChanger = yes
# # Enable the Alert command only if you have the mtx package loaded
# Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# A Linux or Solaris tape drive
#
#Device {
# Name = DDS-4 #
# Media Type = DDS-4
# Archive Device = /dev/nrst0
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
## Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
## Changer Device = /dev/sg0
## AutoChanger = yes
# # Enable the Alert command only if you have the mtx package loaded
## Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
## If you have smartctl, enable this, it has more info than tapeinfo
## Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# A FreeBSD tape drive
#
#Device {
# Name = DDS-4
# Description = "DDS-4 for FreeBSD"
# Media Type = DDS-4
# Archive Device = /dev/nsa1
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes
# Offline On Unmount = no
# Hardware End of Medium = no
# BSF at EOM = yes
# Backward Space Record = no
# Fast Forward Space File = no
# TWO EOF = yes
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# A OnStream tape drive.
# You need the kernel osst driver 0.9.14 or later, and
# do "mt -f /dev/nosst0 defblksize 32768" once as root.
#
#Device {
# Name = OnStream
# Description = "OnStream drive on Linux"
# Media Type = OnStream
# Archive Device = /dev/nrst0
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes
# Offline On Unmount = no
## The min/max blocksizes of 32768 are *required*
# Minimum Block Size = 32768
# Maximum Block Size = 32768
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# A DVD device
#
#Device {
# Name = "DVD Writer"
# Media Type = DVD
# Device Type = DVD
# Archive Device = /dev/hdc
# LabelMedia = yes; # lets Bacula label unlabeled media
# Random Access = Yes;
# AutomaticMount = yes; # when device opened, read it
# RemovableMedia = yes;
# AlwaysOpen = no;
# MaximumPartSize = 800M;
# RequiresMount = yes;
# MountPoint = /mnt/cdrom;
# MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
# UnmountCommand = "/bin/umount %m";
# SpoolDirectory = /tmp/backup;
# WritePartCommand = "/etc/bacula/dvd-handler %a write %e %v"
# FreeSpaceCommand = "/etc/bacula/dvd-handler %a free"
#}

#
# For OpenBSD OS >= 3.6
#
#Device {
# Name = DDS-3
# Media Type = DDS-3
# Archive Device = /dev/nrst0
# Use MTIOCGET= no
# BSF at EOM = yes
# TWO EOF = no
# AutomaticMount = yes;
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# A very old Exabyte with no end of media detection
#
#Device {
# Name = "Exabyte 8mm"
# Media Type = "8mm"
# Archive Device = /dev/nrst0
# Hardware end of medium = No;
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = Yes;
# RemovableMedia = yes;
# RandomAccess = no;
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# Send all messages to the Director,
# mount messages also are sent to the email address
#
Messages {
Name = Standard
director = backupsys-dir = all
}

bconsole.conf:


backupsys:/etc/bacula# cat bconsole.conf
#
# Bacula User Agent (or Console) Configuration File
#

Director {
Name = localhost-dir
DIRport = 9101
address = localhost
Password = "sWaZRqTS1VX2uacyTZNXlI4Ax9Oj5MK1ANC62QBta0xi"
}


ich würde mich sowas von freuen, wenn ich das durch eure hilfe endlich hinbekommen könnte.
danke

arvidflow
29.04.10, 10:27
ich bin mittlerweile soweit, dass ich von einem in den anderen ordner auf der festplatte sichern kann. bisher komme ich aber trotzdem nicht mit den tapes klar und irgendwie hab ich noch keine sich in allen fällen gleich verhaltende funktionalität in bacula herstellen können. es ist irgendwie misteriös ;-)

CoolTux
29.04.10, 12:23
ich bin mittlerweile soweit, dass ich von einem in den anderen ordner auf der festplatte sichern kann. bisher komme ich aber trotzdem nicht mit den tapes klar und irgendwie hab ich noch keine sich in allen fällen gleich verhaltende funktionalität in bacula herstellen können. es ist irgendwie misteriös ;-)



Hier sind meine Einstellungen für mein Tape Drive.


Device {
Name = LTO1 #
Media Type = LTO1
LabelMedia = yes
Archive Device = /dev/st0
AutomaticMount = yes; # when device opened, read it
AlwaysOpen = no;
RemovableMedia = yes
RandomAccess = no
Autochanger = no
Backward Space Record = yes

}


Und hier mal so eine passende Jobbeschreibung



Job {
Name = "Backup ETC Verzeichnis - Home Laufwerk ausser DBs und Mediafiles"
Type = Backup
Client = server-fd
FileSet = "ETC Verzeichnis - Home Laufwerk ausser DBs und Mediafiles"
Schedule = "Wochenzyklus"
Storage = LTO1
Messages = Standard
Pool = Default
Priority = 10
Max Start Delay = 22h
Maximum Concurrent Jobs = 4
Write Bootstrap = "/var/db/bacula/BackupHomeundETC.bsr"
Rerun Failed Levels = yes # Wiederaufnahme von fehlgeschlagenen Jobs
Reschedule On Error = yes # Wiederaufnahme von fehlerhaften Jobs
Reschedule Interval = 1 hour # Interval in dem Wiederanwahl erfolgt
Reschedule Times = 3 # Wiederanwahlversuche
}


Und das Fileset



# Was soll gesichert werden
FileSet {
Name = "ETC Verzeichnis - Home Laufwerk ausser DBs und Mediafiles"
Include {
Options {
signature = MD5
compression = GZIP
onefs = no
sparse = no
}
File = /home
File = /etc
}
Exclude {
File = /home/public/VMWare
File = /home/var/spool/imap
File = /home/var/mysql_data
File = /home/var/openldap-data
File = /home/root/BackupHDD
File = /home/public/bacula-restores
}
}




Hoffe es hilft Dir weiter. Wenn nicht poste bitte noch mal Deine bacula-dir.conf und die bacula-sd.conf



Gruß
Leon

pibi
30.04.10, 12:13
ich bin mittlerweile soweit, dass ich von einem in den anderen ordner auf der festplatte sichern kann.Na immerhin, das ist doch schon mal ein Anfang. Dann funktioniert naemlich auch schon die Postgres-Anbindung.
bisher komme ich aber trotzdem nicht mit den tapes klarDas bedeutet im Klartext? Welches Tape hast Du? Wie ist es im bacula-sd.conf definiert? Ich habe in Deiner Config nix dazu gefunden.

Generelle Bemerkungen:

- Wenn ein Tape von Bacula gemountet ist, kannst Du es mit zB. tar nicht benutzen

- Um das Passwort-Zeugs mit mehreren Bacula-Servern/Clients zu vereinfachen (wichtig beim Betrieb eines Netzwerks), compiliere ich immer so:
./configure --with-postgresql --with-working-dir=/etc/bacula/working --with-sysconfdir=/etc/bacula --sbindir=/usr/local/sbin --with-dir-password=asterix --with-sd-password=obelix --with-fd-password=miraculix

- in der Anfangs- und Testphase alles auf der Textconsole von Bacula erledigen und nicht noch irgendwelche Zusatztools installieren, dort funktioniert es immer (spaeter will man dann sowieso nix anderes mehr....)

Sonst melde Dich einfach nochmal. Bacula ist recht genial, wenn man die Funktionsweise erstmal begriffen hat.

Gruss Pit,

pibi
30.04.10, 12:21
Hoppala! Da habe ich doch versehentlich zwei Mal den Text gespeichert.

Gruss Pit.

tha_specializt
26.07.10, 16:32
- in der Anfangs- und Testphase alles auf der Textconsole von Bacula erledigen und nicht noch irgendwelche Zusatztools installieren, dort funktioniert es immer (spaeter will man dann sowieso nix anderes mehr....)

Naja ich bin jetzt aus der Anfangsphase raus und lass die ersten vollständigen Backup-Runden fahren ... nach dem elendig langem Konsolengehacke würde ich mir doch eine Fernsteuerungs-GUI des Directors für Windows wünschen ... zumal ich echt nicht verstehen kann wieso eine solche ausgereifte Software komplett ohne GUI daherkommt und nur mangelhaft von Webmin etc. steuerbar ist ..... in der Tat überlege ich, ob ich nicht in meiner Freizeit ne nette kleine Java-GUI schreiben und nach einer intensiven Entfernung jeglicher Informationen meines Arbeitgebers eventuell sogar auf Sourceforge eintragen sollte - so sehr nervt mich die Abstinenz einer GUI, das ist einfach nicht professionell