Bacula-users

Re: [Bacula-users] Running a restore job

2008-04-08 04:15:37
Subject: Re: [Bacula-users] Running a restore job
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 08 Apr 2008 10:15:17 +0200
Hi,

08.04.2008 06:13, thing AT thing.dyndns DOT org wrote:
> Hi,
> 
> If I run the bacula-sd daemon directly and avoid the start up script it
> runs and I can connect....(doing a status then 2).
> 
> hermes:/var/run/bacula# ls -l
> total 12
> -rw-r----- 1 root root 6 2008-04-08 16:01 bacula-dir.9101.pid
> -rw-r----- 1 root root 6 2008-04-08 16:01 bacula-fd.9102.pid
> -rw-r----- 1 root root 6 2008-04-08 16:05 bacula-sd.9103.pid
> hermes:/var/run/bacula#
> 
> So this suggests an error in the .conf or the start up script?

If you - through the startup script - run the SD as a user other than 
root, you have to make sure the SD can access all its files and 
directories... once you ran the SD as root, some of these files might 
be inaccessible for the other user.

To make sure, run e.g. 'bacula-sd -c /etc/bacula/bacula-sd.conf -f -d 
50 -v' and you should see some messages.

Typically, the working directory with all its contents and the pid 
file should be owned by the bacula user in this case.

Also you should plan to upgrade to a more recent version...


> #
> # Default Bacula Storage Daemon Configuration file
> #
> #  For Bacula release 1.38.11 (28 June 2006) -- debian 4.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 = hermes-sd
>   SDPort = 9103                  # Director's port
>   WorkingDirectory = "/var/lib/bacula"
>   Pid Directory = "/var/run/bacula"
>   Maximum Concurrent Jobs = 20
>   SDAddress = 127.0.0.1

This is, in most cases, a configuration error...

>   #ssj SDAddress = 192.168.1.254
> }
> 
> #
> # List Directors who are permitted to contact Storage daemon
> #
> Director {
>   Name = hermes-dir
>   Password = "xxxxx"
> }
> 
> #
> # Restricted Director, used by tray-monitor to get the
> #   status of the storage daemon
> #
> Director {
>   Name = hermes-mon
>   Password = "xxxxxxx"
>   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 = /backup-250g-01
>   #Archive Device = /tmp
>   LabelMedia = yes;                   # lets Bacula label unlabeled media
>   Random Access = Yes;
>   AutomaticMount = yes;               # when device opened, read it
>   RemovableMedia = no;
>   AlwaysOpen = no;
> }
> 
... lots of comments not needed here...
> #
> # Send all messages to the Director,
> # mount messages also are sent to the email address
> #
> Messages {
>   Name = Standard
>   director = hermes-dir = all
> }
> 
> 
> 
> 
> 
>> Hi,
>>
>> I seem to have a dead storage daemon....at least I think this is the
>> issue....it seems unable to start or at least continue running....I cant
>> see it logging its issue anywhere....
>>
>>  From the bconsole while running a status this pops up,
>>
>> 8><--------
>> 8-Apr 15:44 hermes-dir: *Console*.2008-04-08_15.38.10 Fatal error:
>> bnet.c:859 Unable to connect to Storage daemon on localhost:9103.
>> ERR=Connection refused
>> 8><--------

Also, check with netstat and ps if the SD is running and listening on 
the network.

>> Indeed when i try and connect I get,
>>
>> *status
>> Status available for:
>>      1: Director
>>      2: Storage
>>      3: Client
>>      4: All
>> Select daemon type for status (1-4): 2
>> Automatically selected Storage: File
>> Connecting to Storage daemon File at localhost:9103
>>
>> Failed to connect to Storage daemon File.
>> ====
>> *
>>
>> ?
>>
>> Looking at the pid directory when i retart the dir or fd the PID updates,
>> for the sd no pid is written, so this suggests the sd is failing to start?
>>
>> hermes:/var/run/bacula# ls -l
>> total 8
>> -rw-r----- 1 root root 6 2008-04-08 15:57 bacula-dir.9101.pid
>> -rw-r----- 1 root root 6 2008-04-08 15:19 bacula-fd.9102.pid

yup... only root can write here.

>> hermes:/var/run/bacula# ls -l
>> total 8
>> -rw-r----- 1 root root 6 2008-04-08 15:57 bacula-dir.9101.pid
>> -rw-r----- 1 root root 6 2008-04-08 15:19 bacula-fd.9102.pid
>> hermes:/var/run/bacula# ls -l
>> total 8
>> -rw-r----- 1 root root 6 2008-04-08 16:01 bacula-dir.9101.pid
>> -rw-r----- 1 root root 6 2008-04-08 15:19 bacula-fd.9102.pid
>> hermes:/var/run/bacula# ls -l
>> total 8
>> -rw-r----- 1 root root 6 2008-04-08 16:01 bacula-dir.9101.pid
>> -rw-r----- 1 root root 6 2008-04-08 16:01 bacula-fd.9102.pid
>> hermes:/var/run/bacula#
>>
>> Any ideas please?

chown bacula: /var/run/bacula/*
chown -R bacula: /var/lib/bacula/

(but make sure this doesn't interfere with files used by the DIR or FD 
in that directory...)


Arno

>> regards
>>
>> Steven
>>
>>
>>> Hi,
>>>
>>> I am attempting to do a full restore to the default file location,
>>> (following the tutorial) typing status seems to indicate that this is
>>> running, however after 30mins nothing has been written back to the disk.
>>>
>>> I type status and I get,
>>>
>>> bermes:/backup-250g-01/bacula-restores# bconsole
>>> Connecting to Director localhost:9101
>>> 1000 OK: hermes-dir Version: 1.38.11 (28 June 2006)
>>> Enter a period to cancel a command.
>>> *status
>>> Using default Catalog name=MyCatalog DB=bacula
>>> Status available for:
>>>      1: Director
>>>      2: Storage
>>>      3: Client
>>>      4: All
>>> Select daemon type for status (1-4): 4
>>> hermes-dir Version: 1.38.11 (28 June 2006) i486-pc-linux-gnu debian 4.0
>>> Daemon started 06-Apr-08 10:09, 11 Jobs run since started.
>>>
>>> Scheduled Jobs:
>>> Level          Type     Pri  Scheduled          Name
>>> Volume
>>> ===================================================================================
>>> Incremental    Backup    10  08-Apr-08 23:05    Client1
>>> backup-250g-01
>>> Full           Backup    11  08-Apr-08 23:10    BackupCatalog
>>> backup-250g-01
>>> ====
>>>
>>> Running Jobs:
>>>  JobId Level   Name                       Status
>>> ======================================================================
>>>     46         RestoreFiles.2008-04-08_14.01.17 is running
>>> ====
>>>
>>> Terminated Jobs:
>>>  JobId  Level     Files      Bytes     Status   Finished        Name
>>> ========================================================================
>>>     36  Full          0              0 Error    04-Apr-08 23:10
>>> BackupCatalog
>>>     37  Incr        275      5,816,324 OK       05-Apr-08 23:05 Client1
>>>     38  Full          0              0 Error    05-Apr-08 23:10
>>> BackupCatalog
>>>     39  Incr        600     41,624,135 OK       06-Apr-08 12:46 Client1
>>>     40  Full     36,530 29,918,835,561 OK       07-Apr-08 02:58 Client1
>>>     41  Full          0              0 Error    07-Apr-08 02:58
>>> BackupCatalog
>>>     42  Incr      1,291    573,238,771 OK       07-Apr-08 23:07 Client1
>>>     43  Full          0              0 Error    07-Apr-08 23:10
>>> BackupCatalog
>>>     44                0              0 Error    08-Apr-08 06:52
>>> RestoreFiles
>>>     45                0              0 Error    08-Apr-08 06:54
>>> RestoreFiles
>>>
>>> ====
>>> Connecting to Storage daemon File at localhost:9103
>>>
>>> hermes-sd Version: 1.38.11 (28 June 2006) i486-pc-linux-gnu debian 4.0
>>> Daemon started 06-Apr-08 10:08, 3 Jobs run since started.
>>>
>>> Running Jobs:
>>> Reading: Full Restore job RestoreFiles JobId=46 Volume="backup-250g-01"
>>>     pool="Default" device=""FileStorage" (/backup-250g-01)"
>>>     Files=0 Bytes=0 Bytes/sec=0
>>>     FDReadSeqNo=302 in_msg=301 out_msg=6 fd=8
>>> ====
>>>
>>> Jobs waiting to reserve a drive:
>>> ====
>>>
>>> Terminated Jobs:
>>>  JobId  Level   Files          Bytes Status   Finished        Name
>>> ======================================================================
>>>     25  Diff        358    117,504,992 OK       30-Mar-08 23:05 Client1
>>>     27  Incr        287     58,745,822 OK       31-Mar-08 23:05 Client1
>>>     29  Incr        281    112,378,049 OK       01-Apr-08 23:05 Client1
>>>     31  Incr        653     95,438,092 OK       02-Apr-08 23:06 Client1
>>>     33  Incr        308    140,323,417 OK       03-Apr-08 23:05 Client1
>>>     35  Incr        285     72,350,997 OK       04-Apr-08 23:05 Client1
>>>     37  Incr        275      5,865,051 OK       05-Apr-08 23:05 Client1
>>>     39  Incr        600     41,696,193 OK       06-Apr-08 12:46 Client1
>>>     40  Full     36,530 29,923,935,658 OK       07-Apr-08 02:58 Client1
>>>     42  Incr      1,291    573,422,556 OK       07-Apr-08 23:07 Client1
>>> ====
>>>
>>> Device status:
>>> Device "FileStorage" (/backup-250g-01) is mounted with
>>> Volume="backup-250g-01" Pool="Default"
>>>     Total Bytes Read=4,731,632,640 Blocks Read=73,345 Bytes/block=64,512
>>>     Positioned at File=1 Block=436,497,449
>>> Device "DLT3" (/dev/st0) open but no Bacula volume is mounted.
>>>     Total Bytes Read=0 Blocks Read=0 Bytes/block=0
>>>     Positioned at File=0 Block=0
>>> ====
>>>
>>> In Use Volume status:
>>> backup-250g-01 on device "FileStorage" (/backup-250g-01)
>>> ====
>>>
>>> Connecting to Client hermes-fd at localhost:9102
>>>
>>> hermes-fd Version: 1.38.11 (28 June 2006)  i486-pc-linux-gnu debian 4.0
>>> Daemon started 06-Apr-08 10:08, 3 Jobs run since started.
>>>
>>> Terminated Jobs:
>>>  JobId  Level     Files         Bytes  Status   Finished        Name
>>> ======================================================================
>>>     25  Diff        358    117,446,543 OK       30-Mar-08 23:05 Client1
>>>     27  Incr        287     58,695,470 OK       31-Mar-08 23:05 Client1
>>>     29  Incr        281    112,328,453 OK       01-Apr-08 23:05 Client1
>>>     31  Incr        653     95,357,542 OK       02-Apr-08 23:06 Client1
>>>     33  Incr        308    140,270,579 OK       03-Apr-08 23:05 Client1
>>>     35  Incr        285     72,301,093 OK       04-Apr-08 23:05 Client1
>>>     37  Incr        275      5,816,324 OK       05-Apr-08 23:05 Client1
>>>     39  Incr        600     41,624,135 OK       06-Apr-08 12:46 Client1
>>>     40  Full     36,530 29,918,835,561 OK       07-Apr-08 02:58 Client1
>>>     42  Incr      1,291    573,238,771 OK       07-Apr-08 23:07 Client1
>>> ====
>>> Running Jobs:
>>> JobId 46 Job RestoreFiles.2008-04-08_14.01.17 is running.
>>>     Restore Job started: 08-Apr-08 14:01
>>>     Files=0 Bytes=0 Bytes/sec=0
>>>     Files Examined=0
>>>     SDReadSeqNo=7 fd=7
>>> Director connected at: 08-Apr-08 14:33
>>> ====
>>> *hermes:/backup-250g-01/bacula-restores#
>>>
>>> So what did I do wrong/missed?
>>>
>>> regards
>>>
>>> Steven
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>>> Register now and save $200. Hurry, offer ends at 11:59 p.m.,
>>> Monday, April 7! Use priority code J8TLD2.
>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>>> _______________________________________________
>>> 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 2008 JavaOne(SM) Conference
>> Register now and save $200. Hurry, offer ends at 11:59 p.m.,
>> Monday, April 7! Use priority code J8TLD2.
>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>> _______________________________________________
>> 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 2008 JavaOne(SM) Conference 
> Register now and save $200. Hurry, offer ends at 11:59 p.m., 
> Monday, April 7! Use priority code J8TLD2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 

-- 
Arno Lehmann
IT-Service Lehmann
www.its-lehmann.de

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users