]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manual/disk.tex
Updates
[bacula/docs] / docs / manual / disk.tex
index 90495327d1f1db11499ce594d9b23c73a728296c..35aa7e21ceedfbd5e14184e0fd610d602e70e6b1 100644 (file)
@@ -75,6 +75,12 @@ Although this is quite simple, there are a number of problems. The first is
 that unless you specify otherwise, Bacula will always write to the same volume
 until you run out of disk space. This problem is addressed below.
 
+In addition, if you want to use concurrent jobs that write to several
+different volumes at the same time, you will need to understand a number
+of other details. An example of such a configuration is given
+at the end of this chapter under \ilink{Concurrent Disk
+Jobs}{ConcurrentDiskJobs}.
+
 \subsubsection*{Pool Options to Limit the Volume Usage}
 \index[general]{Usage!Pool Options to Limit the Volume }
 \index[general]{Pool Options to Limit the Volume Usage }
@@ -282,6 +288,48 @@ also be done by setting {\bf Recycle Oldest Volume = yes} or {\bf Recycle
 Current Volume = yes}. In this case, when Bacula needs a new Volume, it will
 prune the specified volume. 
 
+\label{ConcurrentDiskJobs}
+\subsection*{Concurrent Disk Jobs}
+\index[general]{Concurrent Disk Jobs}
+\addcontentsline{toc}{subsection}{Concurrent Disk Jobs}
+Above, we discussed how you could have a single device named {\bf
+FileBackup} that writes to volumes in {\bf /home/bacula/backups}. 
+You can, in fact, run multiple concurrent jobs using the 
+Storage definition given with this example, and all the jobs will
+simultaneously write into the Volume that is being written.
+
+Now suppose you want to use multiple Pools, which means multiple
+Volumes, or suppose you want each client to have its own Volume
+and perhaps its own directory such as {\bf /home/bacula/client1}
+and {\bf /home/bacula/client2} ... With the single Storage and Device
+definition above, neither of these two is possible.  Why?  Because
+Bacula disk storage follows the same rules as tape devices. Only
+one Volume can be mounted on any Device at any time. If you want
+to simultaneously write multiple Volumes, you will need multiple
+Device resources in your bacula-sd.conf file, and thus multiple
+Storage resources in your bacula-dir.conf.
+
+OK, so now you should understand that you need multiple Device definitions
+in the case of different directories or different Pools, but you also 
+need to know that the catalog data that Bacula keeps contains only
+the Media Type and not the specific storage device.  This permits a tape 
+for example to be re-read on any compatible tape drive.  The compatibility
+being determined by the Media Type.  The same applies to disk storage.
+Since a volume that is written by a Device in say directory {\bf
+/home/bacula/backups}  cannot be read by a Device with an Archive Device
+definition of {\bf /home/bacula/client1}, you will not be able to
+restore all your files if you give both those devices 
+{\bf Media Type = File}. During the restore, Bacula will simply choose 
+the first available device, which may not be the correct one.  If this
+is confusing, just remember that the Directory has only the Media Type
+and the Volume name.  It does not know the {\bf Archive Device} (or the
+full path) that is specified in the Storage daemon.  Thus you must
+explicitly tie your Volumes to the correct Device by using the Media Type.
+
+The example shown below shows a case where there are two clients, each
+using its own Pool and storing their Volumes in different directories.
+
 \label{Example2}
 \subsection*{An Example}
 \index[general]{Example }
@@ -289,9 +337,14 @@ prune the specified volume.
 
 The following example is not very practical, but can be used to demonstrate
 the proof of concept in a relatively short period of time. The example
-consists of a single client that is backed up to a set of 12 archive files
-(Volumes). Each Volume is used (written) only once, and there are four Full
-saves done every hour (so the whole thing cycles around after three hours). 
+consists of a two clients that are backed up to a set of 12 archive files
+(Volumes) for each client into different directories on the Storage
+machine.  Each Volume is used (written) only once, and there are four Full
+saves done every hour (so the whole thing cycles around after three hours).
+
+What is key here is that each physical device on the Storage daemon 
+has a different Media Type. This allows the Director to choose the
+correct device for restores ...
 
 The Director's configuration file is as follows: 
 
@@ -306,10 +359,10 @@ Director {
 }
 Schedule {
   Name = "FourPerHour"
-  Run = Level=Full Pool=Recycle Storage=FileStorage hourly at 0:05
-  Run = Level=Full Pool=Recycle Storage=FileStorage hourly at 0:20
-  Run = Level=Full Pool=Recycle Storage=FileStorage hourly at 0:35
-  Run = Level=Full Pool=Recycle Storage=FileStorage hourly at 0:50
+  Run = Level=Full hourly at 0:05
+  Run = Level=Full hourly at 0:20
+  Run = Level=Full hourly at 0:35
+  Run = Level=Full hourly at 0:50
 }
 Job {
   Name = "RecycleExample"
@@ -322,6 +375,19 @@ Job {
   Pool = Recycle
   Schedule = FourPerHour
 }
+
+Job {
+  Name = "RecycleExample2"
+  Type = Backup
+  Level = Full
+  Client = Roxie
+  FileSet= "Example FileSet"
+  Messages = Standard
+  Storage = FileStorage1
+  Pool = Recycle1
+  Schedule = FourPerHour
+}
+
 FileSet {
   Name = "Example FileSet"
   Include = compression=GZIP signature=SHA1 {
@@ -334,6 +400,14 @@ Client {
   Catalog = BackupDB
   Password = client_password
 }
+
+Client {
+  Name = Roxie
+  Address = roxie
+  Catalog = BackupDB
+  Password = client1_password
+}
+
 Storage {
   Name = FileStorage
   Address = rufus
@@ -341,6 +415,15 @@ Storage {
   Device = RecycleDir
   Media Type = File
 }
+
+Storage {
+  Name = FileStorage1
+  Address = rufus
+  Password = local_storage_password
+  Device = RecycleDir1
+  Media Type = File1
+}
+
 Catalog {
   Name = BackupDB
   dbname = bacula; user = bacula; password = ""
@@ -353,12 +436,24 @@ Pool {
   Name = Recycle
   Use Volume Once = yes
   Pool Type = Backup
-  LabelFormat = "Vol"
+  LabelFormat = "Recycle-"
   AutoPrune = yes
   VolumeRetention = 2h
   Maximum Volumes = 12
   Recycle = yes
 }
+
+Pool {
+  Name = Recycle1
+  Use Volume Once = yes
+  Pool Type = Backup
+  LabelFormat = "Recycle1-"
+  AutoPrune = yes
+  VolumeRetention = 2h
+  Maximum Volumes = 12
+  Recycle = yes
+}
+
 \end{verbatim}
 \normalsize
 
@@ -386,6 +481,18 @@ Device {
   RemovableMedia = no;
   AlwaysOpen = no;
 }
+
+Device {
+  Name = RecycleDir1
+  Media Type = File1
+  Archive Device = /home/bacula/backups1
+  LabelMedia = yes;
+  Random Access = Yes;
+  AutomaticMount = yes;
+  RemovableMedia = no;
+  AlwaysOpen = no;
+}
+
 Messages {
   Name = Standard
   director = my-dir = all
@@ -393,12 +500,6 @@ Messages {
 \end{verbatim}
 \normalsize
 
-In this example, the Jobs will be backed up to directory {\bf
-/home/bacula/backups} with Volume names Vol0001, Vol0002, ... Vol0012. Every
-backup Job will write a new volume cycling through the volume numbers, and two
-hours after a job has started, the volume will be pruned {\bf Volume Retention
-= 2h}. 
-
 With a little bit of work, you can change the above example into a weekly or
 monthly cycle (take care about the amount of archive disk space used). 
 
@@ -464,11 +565,11 @@ as much as it can. This means that you can only have a single Volume
 mounted at one time on a disk as defined in your Device resource in
 the Storage daemon's conf file.  You can have multiple concurrent 
 jobs running that all write to the one Volume that is being used, but
-if you want to have multiple concurrent jobs that are writting to
+if you want to have multiple concurrent jobs that are writing to
 separate disks drives (or partitions), you will need to define 
 separate Device resources for each one, exactly as you would do for
 two different tape drives.  There is one fundamental difference, however.
-The Volumes that you creat on the two drives cannot be easily exchanged
+The Volumes that you create on the two drives cannot be easily exchanged
 as they can for a tape drive, because they are physically resident (already
 mounted in a sense) on the particular drive.  As a consequence, you will
 probably want to give them different Media Types so that Bacula can
@@ -510,7 +611,7 @@ Storage resource in the Director when doing a restore.
 \label{MultipleClients}
 \subsection*{Considerations for Multiple Clients}
 \index[general]{Clients!Considerations for Multiple }
-\index[general]{Considerations for Multiple Clients }
+\index[general]{Multiple Clients}
 \addcontentsline{toc}{subsection}{Considerations for Multiple Clients}
 
 If we take the above example and add a second Client, here are a few
@@ -591,20 +692,21 @@ Client {
   Catalog = BackupDB
   Password = client2_password
 }
-# Two Storage definitions permits different directories
+# Two Storage definitions with different Media Types
+#  permits different directories
 Storage {
   Name = File1
   Address = rufus
   Password = local_storage_password
   Device = client1
-  Media Type = File
+  Media Type = File1
 }
 Storage {
   Name = File2
   Address = rufus
   Password = local_storage_password
   Device = client2
-  Media Type = File
+  Media Type = File2
 }
 Catalog {
   Name = BackupDB
@@ -657,7 +759,7 @@ Director {
 # Archive directory for Client1
 Device {
   Name = client1
-  Media Type = File
+  Media Type = File1
   Archive Device = /home/bacula/client1
   LabelMedia = yes;
   Random Access = Yes;
@@ -668,7 +770,7 @@ Device {
 # Archive directory for Client2
 Device {
   Name = client2
-  Media Type = File
+  Media Type = File2
   Archive Device = /home/bacula/client2
   LabelMedia = yes;
   Random Access = Yes;