Bacula-users

Re: [Bacula-users] Storage daemon didn't accept Device "FifoStorage"

2008-11-03 15:50:17
Subject: Re: [Bacula-users] Storage daemon didn't accept Device "FifoStorage"
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 03 Nov 2008 21:47:23 +0100
Hi,

31.10.2008 11:35, Isabel Bermejo wrote:
> Hi
> 
> Yes, the script I made works correctly. It dumps the database to a file
> /tmp/fifofile.

Which should be a FIFO you create in the run before job script... but 
that's already implemented, I think.

> What I want to do is to backup MySQL database using bacula and fifo. I know
> that is easy to dump first the database to a file and then backup that file
> (I've tried this way and it works correctly), but I have not enough space to
> dump a high database to a file. I read in Bacula manual that I can configure
> the Bacula Storage defining a Device Resource with fifo. As I can read from
> manual:
> 
> "In addition to a tape device name or a directory name, Bacula will accept
> the name of a FIFO. If a FIFO device is specified for a backup operation,
> you must have a program that reads what Bacula writes into the FIFO...with
> the RunBeforeJob directive." And then I can see an example of a fifo device
> resource

Well, that is from the SD documentation. You need the FileSet manual 
here...

> So I configured a job with RunBeforeJob option specifying a script which
> dumps the database to a fifofile. Then I create a new FileSet with
> readfifo=yes because this option, "If enabled, tells the Client to read the
> data on a backup and write the data on a restore to any FIFO (pipe) that is
> explicitly mentioned in the FileSet. In this case, you must have a program
> already running that writes into the FIFO for a backup or reads from the
> FIFO on a restore". Moreover, I create a Storage named FifoStorage, that is
> configured in Storage daemon.
> 
> I'm not sure if I'm doing things right, but I'm gonna explain you what is my
> intention: When I run a backupMySQL, the scripts initiates the dump to a
> fifofile while the client reads that file backing up the database whitout
> using extra space.
> 
> Now, my question is: Do you mean that I have to define the fifo only in one
> of the resource? Which will be a correct configuration? I'm confused about
> all the documents I've read

Where do you want your data to end up? If on tape or on disk, you 
don't need a FIFO in the SD configuration.

If you want to send the volume file somewhere else, e.g. across the 
network to a remote storage server, a FIFO might be the right choice. 
In such a case, you'd need to know a lot about how Bacula works, so 
you wouldn't ask this question :-)

What you want is to read the client's data from a FIFO - that has no 
impact on the SD setup.

Arno


> Thank you
> ISABEL
> 
> 
> -----Mensaje original-----
> De: Arno Lehmann [mailto:al AT its-lehmann DOT de]
> Enviado el: viernes, 31 de octubre de 2008 11:04
> Para: bacula-users AT lists.sourceforge DOT net
> Asunto: Re: [Bacula-users] Storage daemon didn't accept Device
> "FifoStorage"
> 
> 
> Hi,
> 
> 31.10.2008 10:27, Isabel Bermejo wrote:
>> Hi
>> I'm trying to backup MySQL database using bacula and a FifoStorage. First
> I
>> configure a script named "backwithfifo" which dumps the database.
>>
>> #!/bin/sh
>> #
>> exec > /dev/null
>> SCRIPTDIR=/usr/bin
>> mkfifo /tmp/tmpfifo
>> cd $SCRIPTDIR
>> ./mysqldump -h localhost -u root -pclipper iesa > /tmp/tmpfifo
>> res=$?
>> if (test $res -ne 0) then
>>    logger -t mysql -isd ERROR Dump done with errors. Exit status $res
>> else
>>    logger -t mysql -isd OK Dump done with no errors. Exit status $res
>> fi
> 
> I assume this works correctly.
> 
>> Then I modify Bacula files to run the backup, using the script, to a
>> fifofile.
>>
>> In Bacula-Director file:
>> Job {
>>    Name = "BackupMySQL"
>>    Type = Backup
>>    Client = client-fd
>>    FileSet = "MySQLdb"
>>    Schedule = "WeeklyCycleAfterBackup"
>>    Storage = FifoStorage
>>    Messages = Standard
>>    Pool = MySQLPool
>>    RunBeforeJob = "/etc/bacula/MyScripts/backwithfifo" #this is the script
>> which dumps the database to a fifofile
>>    Write Bootstrap = "/var/lib/bacula/BackupMySQL.bsr"
>>
>> FileSet {
>>    Name = "MySQLdb"
>>    Include {
>>       Options {
>>          signature = MD5
>>          readfifo = yes
>>       }
>>       File = /tmp/fifofiles
>>    }
>> }
>>
>> Storage {
>>    Name = FifoStorage
>>    Address = xxx.xxx.xxx.xxx
>>    SDPort = 9103
>>    Password = "password"
>>    Device = FifoStorage
>>    Media Type = Fifo
>> }
>>
>> In Bacula-Storage file:
>> Device {
>>    Name = FifoStorage
>>    Media Type = Fifo
>>    Archive Device = /tmp/fifofiles
> 
> This is probably not what you want - the FIFO is read by the FD and
> you've already set that up above.
> 
> Here, you need a normal storage device - either a tape drive or a disk
> directory where the volumes will be written to. The SD doesn't need to
> know anything about the FIFO setup.
> 
>>    Label Media = yes
>>    Random Access = no
>>    AutomaticMount = no
>>    RemovableMedia = no
>>    MaximumOpenWait = 60
>>    AlwaysOpen = no
> 
> Those settings also look like you tried to set up a FIFO for storage -
> you can do that, but is is in no way related to the FIFO where the
> backed up data comes from.
> 
> You'd need a FIFO created on the SD, which would direct its output
> somewhere else.
> 
> You probably should simply try this with a regular disk-based storage
> first.
> 
> Arno
> 
>> }
>>
>> When I run the backup job, it results on an error:
>>
>> 31-Oct 10:08 client-dir: RunBefore: mysql[28164]: Volcado realizado
>> correctamente.Exit status 0
>> 31-Oct 10:08 client-dir: No prior Full backup Job record found.
>> 31-Oct 10:08 client-dir: No prior or suitable Full backup found. Doing
> FULL
>> backup.
>> 31-Oct 10:08 client-dir: Start Backup JobId 10063,
>> Job=BackupMySQL.2008-10-31_10.07.42
>> 31-Oct 10:08 client-sd: BackupMySQL.2008-10-31_10.07.42 Fatal error:
>>      Archive "FifoStorage" requested by DIR could not be opened or does
> not
>> exist.
>> 31-Oct 10:08 client-dir: BackupMySQL.2008-10-31_10.07.42 Fatal error:
>>      Storage daemon didn't accept Device "FifoStorage" because:
>>      3925 Device "FifoStorage" could not be opened or does not exist.
>> 31-Oct 10:08 client-dir: BackupMySQL.2008-10-31_10.07.42 Error: Bacula
>> 1.36.3 (22Apr05): 31-Oct-2008 10:08:26
>>   JobId:                  10063
>>   Job:                    BackupMySQL.2008-10-31_10.07.42
>>   Backup Level:           Full (upgraded from Incremental)
>>   Client:                 client-fd
>>   FileSet:                "MySQLdb" 2008-10-31 09:59:45
>>   Pool:                   "MySQLPool"
>>   Storage:                "FifoStorage"
>>   Start time:             31-Oct-2008 10:07:44
>>   End time:               31-Oct-2008 10:08:26
>>   FD Files Written:       0
>>   SD Files Written:       0
>>   FD Bytes Written:       0
>>   SD Bytes Written:       0
>>   Rate:                   0.0 KB/s
>>   Software Compression:   None
>>   Volume name(s):
>>   Volume Session Id:      2
>>   Volume Session Time:    1225443462
>>   Last Volume Bytes:      0
>>   Non-fatal FD errors:    0
>>   SD Errors:              0
>>   FD termination status:
>>   SD termination status:
>>   Termination:            *** Backup Error ***
>>
>> As you can see, the error is "Storage daemon didn't accept Device
>> FifoStorage because could not be opened or does not exist". I can see the
>> file fifofile in /tmp/fifofile and I can do a cat but the Storage Daemon
>> seems can't open the file. I don't know how to configure a backup job for
> a
>> database using fifo. Can anyone tell me where is the error?
>>
>> Thanks a lot
>> ISABEL
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users AT lists.sourceforge DOT net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>
> 
> --
> Arno Lehmann
> IT-Service Lehmann
> Sandstr. 6, 49080 Osnabrück
> www.its-lehmann.de
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 

-- 
Arno Lehmann
IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück
www.its-lehmann.de

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>