]> git.sur5r.net Git - bacula/docs/blob - docs/manual-de/pools.tex
Add base for German manual
[bacula/docs] / docs / manual-de / pools.tex
1 %%
2 %%
3
4 \section*{Using Pools to Manage Volumes}
5 \label{_ChapterStart11}
6 \index[general]{Volumes!Using Pools to Manage }
7 \index[general]{Using Pools to Manage Volumes }
8 \addcontentsline{toc}{section}{Using Pools to Manage Volumes}
9
10 If you manage 5 or 10 machines and have a nice tape backup, you don't need
11 Pools, and you may wonder what they are good for. In this chapter, you will
12 see that Pools can help you optimize disk storage space. The same techniques
13 can be applied to a shop that has multiple tape drives, or that wants to mount
14 various different Volumes to meet their needs. 
15
16 The rest of this chapter will give an example involving backup to disk
17 Volumes, but most of the information applies equally well to tape Volumes. 
18 \label{TheProblem}
19
20 \subsection*{The Problem}
21 \index[general]{Problem }
22 \addcontentsline{toc}{subsection}{Problem}
23
24 A site that I administer (a charitable organization) had a tape DDS-3 tape
25 drive that was failing. The exact reason for the failure is still unknown.
26 Worse yet, their full backup size is about 15GB whereas the capacity of their
27 broken DDS-3 was at best 8GB (rated 6/12). A new DDS-4 tape drive and the
28 necessary cassettes was more expensive than their budget could handle. 
29 \label{TheSolution}
30
31 \subsection*{The Solution}
32 \index[general]{Solution }
33 \addcontentsline{toc}{subsection}{Solution}
34
35 They want to maintain 6 months of backup data, and be able to access the old
36 files on a daily basis for a week, a weekly basis for a month, then monthly
37 for 6 months. In addition, offsite capability was not needed (well perhaps
38 it really is, but it was never used). Their daily changes amount to about
39 300MB on the average, or about 2GB per week. 
40
41 As a consequence, the total volume of data they need to keep to meet their
42 needs is about 100GB (15GB x 6 + 2GB x 5 + 0.3 x 7) = 102.1GB. 
43
44 The chosen solution was to buy a 120GB hard disk for next to nothing -- far
45 less than 1/10th the price of a tape drive and the cassettes to handle the
46 same amount of data, and to have Bacula write to disk files. 
47
48 The rest of this chapter will explain how to setup Bacula so that it would
49 automatically manage a set of disk files with the minimum intervention on my
50 part. The system has been running since 22 January 2004 until today (08 April
51 2004) with no intervention. Since we have not yet crossed the six month
52 boundary, we still lack some data to be sure the system performs as desired. 
53 \label{OverallDesign}
54
55 \subsection*{Overall Design}
56 \index[general]{Overall Design }
57 \index[general]{Design!Overall }
58 \addcontentsline{toc}{subsection}{Overall Design}
59
60 Getting Bacula to write to disk rather than tape in the simplest case is
61 rather easy, and is documented in the previous chapter. In addition, all the
62 directives discussed here are explained in that chapter. We'll leave it to you
63 to look at the details there. If you haven't read it and are not familiar with
64 Pools, you probably should at least read it once quickly for the ideas before
65 continuing here. 
66
67 One needs to consider about what happens if we have only a single large Bacula
68 Volume defined on our hard disk. Everything works fine until the Volume fills,
69 then Bacula will ask you to mount a new Volume. This same problem applies to
70 the use of tape Volumes if your tape fills. Being a hard disk and the only one
71 you have, this will be a bit of a problem. It should be obvious that it is
72 better to use a number of smaller Volumes and arrange for Bacula to
73 automatically recycle them so that the disk storage space can be reused. The
74 other problem with a single Volume, is that at the current time (1.34.0)
75 Bacula does not seek within a disk Volume, so restoring a single file can take
76 more time than one would expect. 
77
78 As mentioned, the solution is to have multiple Volumes, or files on the disk.
79 To do so, we need to limit the use and thus the size of a single Volume, by
80 time, by number of jobs, or by size. Any of these would work, but we chose to
81 limit the use of a single Volume by putting a single job in each Volume with
82 the exception of Volumes containing Incremental backup where there will be 6
83 jobs (a week's worth of data) per volume. The details of this will be
84 discussed shortly. 
85
86 The next problem to resolve is recycling of Volumes. As you noted from above,
87 the requirements are to be able to restore monthly for 6 months, weekly for a
88 month, and daily for a week. So to simplify things, why not do a Full save
89 once a month, a Differential save once a week, and Incremental saves daily.
90 Now since each of these different kinds of saves needs to remain valid for
91 differing periods, the simplest way to do this (and possibly the only) is to
92 have a separate Pool for each backup type. 
93
94 The decision was to use three Pools: one for Full saves, one for Differential
95 saves, and one for Incremental saves, and each would have a different number
96 of volumes and a different Retention period to accomplish the requirements. 
97 \label{FullPool}
98
99 \subsubsection*{Full Pool}
100 \index[general]{Pool!Full }
101 \index[general]{Full Pool }
102 \addcontentsline{toc}{subsubsection}{Full Pool}
103
104 Putting a single Full backup on each Volume, will require six Full save
105 Volumes, and a retention period of six months. The Pool needed to do that is: 
106
107 \footnotesize
108 \begin{verbatim}
109 Pool {
110   Name = Full-Pool
111   Pool Type = Backup
112   Recycle = yes
113   AutoPrune = yes
114   Volume Retention = 6 months
115   Accept Any Volume = yes
116   Maximum Volume Jobs = 1
117   Label Format = Full-
118   Maximum Volumes = 6
119 }
120 \end{verbatim}
121 \normalsize
122
123 Since these are disk Volumes, no space is lost by having separate Volumes for
124 each backup (done once a month in this case). The items to note are the
125 retention period of six months (i.e. they are recycled after 6 months), that
126 there is one job per volume (Maximum Volume Jobs = 1), the volumes will be
127 labeled Full-0001, ... Full-0006 automatically. One could have labeled these
128 manual from the start, but why not use the features of Bacula. 
129 \label{DiffPool}
130
131 \subsubsection*{Differential Pool}
132 \index[general]{Pool!Differential }
133 \index[general]{Differential Pool }
134 \addcontentsline{toc}{subsubsection}{Differential Pool}
135
136 For the Differential backup Pool, we choose a retention period of a bit longer
137 than a month and ensure that there is at least one Volume for each of the
138 maximum of five weeks in a month. So the following works: 
139
140 \footnotesize
141 \begin{verbatim}
142 Pool {
143   Name = Diff-Pool
144   Pool Type = Backup
145   Recycle = yes
146   AutoPrune = yes
147   Volume Retention = 40 days
148   Accept Any Volume = yes
149   Maximum Volume Jobs = 1
150   Label Format = Diff-
151   Maximum Volumes = 6
152 }
153 \end{verbatim}
154 \normalsize
155
156 As you can see, the Differential Pool can grow to a maximum of six volumes,
157 and the Volumes are retained 40 days and thereafter they can be recycled. Finally
158 there is one job per volume. This, of course, could be tightened up a lot, but
159 the expense here is a few GB which is not too serious. 
160 \label{IncPool}
161
162 \subsubsection*{Incremental Pool}
163 \index[general]{Incremental Pool }
164 \index[general]{Pool!Incremental }
165 \addcontentsline{toc}{subsubsection}{Incremental Pool}
166
167 Finally, here is the resource for the Incremental Pool: 
168
169 \footnotesize
170 \begin{verbatim}
171 Pool {
172   Name = Inc-Pool
173   Pool Type = Backup
174   Recycle = yes
175   AutoPrune = yes
176   Volume Retention = 20 days
177   Accept Any Volume = yes
178   Maximum Volume Jobs = 6
179   Label Format = Inc-
180   Maximum Volumes = 5
181 }
182 \end{verbatim}
183 \normalsize
184
185 We keep the data for 20 days rather than just a week as the needs require. To
186 reduce the proliferation of volume names, we keep a week's worth of data (6
187 incremental backups) in each Volume. In practice, the retention period should
188 be set to just a bit more than a week and keep only two or three volumes
189 instead of five. Again, the lost is very little and as the system reaches the
190 full steady state, we can adjust these values so that the total disk usage
191 doesn't exceed the disk capacity. 
192 \label{Example}
193
194 \subsection*{The Actual Conf Files}
195 \index[general]{Files!Actual Conf }
196 \index[general]{Actual Conf Files }
197 \addcontentsline{toc}{subsection}{Actual Conf Files}
198
199 The following example shows you the actual files used, with only a few minor
200 modifications to simplify things. 
201
202 The Director's configuration file is as follows: 
203
204 \footnotesize
205 \begin{verbatim}
206 Director {          # define myself
207   Name = bacula-dir
208   DIRport = 9101
209   QueryFile = "/home/bacula/bin/query.sql"
210   WorkingDirectory = "/home/bacula/working"
211   PidDirectory = "/home/bacula/working"
212   Maximum Concurrent Jobs = 1
213   Password = " "
214   Messages = Standard
215 }
216 #   By default, this job will back up to disk in /tmp
217 Job {
218   Name = client
219   Type = Backup
220   Client = client-fd
221   FileSet = "Full Set"
222   Schedule = "WeeklyCycle"
223   Storage = File
224   Messages = Standard
225   Pool = Default
226   Full Backup Pool = Full-Pool
227   Incremental Backup Pool = Inc-Pool
228   Differential Backup Pool = Diff-Pool
229   Write Bootstrap = "/home/bacula/working/client.bsr"
230   Priority = 10
231 }
232 # List of files to be backed up
233 FileSet {
234   Name = "Full Set"
235   Include = signature=SHA1 compression=GZIP9 {
236     /
237     /usr
238     /home
239   }
240   Exclude = {
241      /proc /tmp /.journal /.fsck
242   }
243 }
244 Schedule {
245   Name = "WeeklyCycle"
246   Run = Full 1st sun at 1:05
247   Run = Differential 2nd-5th sun at 1:05
248   Run = Incremental mon-sat at 1:05
249 }
250 Client {
251   Name = client-fd
252   Address = client
253   FDPort = 9102
254   Catalog = MyCatalog
255   Password = " "
256   AutoPrune = yes      # Prune expired Jobs/Files
257   Job Retention = 6 months
258   File Retention = 60 days
259 }
260 Storage {
261   Name = File
262   Address = localhost
263   SDPort = 9103
264   Password = " "
265   Device = FileStorage
266   Media Type = File
267 }
268 Catalog {
269   Name = MyCatalog
270   dbname = bacula; user = bacula; password = ""
271 }
272 Pool {
273   Name = Full-Pool
274   Pool Type = Backup
275   Recycle = yes           # automatically recycle Volumes
276   AutoPrune = yes         # Prune expired volumes
277   Volume Retention = 6 months
278   Accept Any Volume = yes # write on any volume in the pool
279   Maximum Volume Jobs = 1
280   Label Format = Full-
281   Maximum Volumes = 6
282 }
283 Pool {
284   Name = Inc-Pool
285   Pool Type = Backup
286   Recycle = yes           # automatically recycle Volumes
287   AutoPrune = yes         # Prune expired volumes
288   Volume Retention = 20 days
289   Accept Any Volume = yes
290   Maximum Volume Jobs = 6
291   Label Format = Inc-
292   Maximum Volumes = 5
293 }
294 Pool {
295   Name = Diff-Pool
296   Pool Type = Backup
297   Recycle = yes
298   AutoPrune = yes
299   Volume Retention = 40 days
300   Accept Any Volume = yes
301   Maximum Volume Jobs = 1
302   Label Format = Diff-
303   Maximum Volumes = 6
304 }
305 Messages {
306   Name = Standard
307   mailcommand = "bsmtp -h mail.domain.com -f \"\(Bacula\) %r\"
308       -s \"Bacula: %t %e of %c %l\" %r"
309   operatorcommand = "bsmtp -h mail.domain.com -f \"\(Bacula\) %r\"
310       -s \"Bacula: Intervention needed for %j\" %r"
311   mail = root@domain.com = all, !skipped
312   operator = root@domain.com = mount
313   console = all, !skipped, !saved
314   append = "/home/bacula/bin/log" = all, !skipped
315 }
316 \end{verbatim}
317 \normalsize
318
319 and the Storage daemon's configuration file is: 
320
321 \footnotesize
322 \begin{verbatim}
323 Storage {               # definition of myself
324   Name = bacula-sd
325   SDPort = 9103       # Director's port
326   WorkingDirectory = "/home/bacula/working"
327   Pid Directory = "/home/bacula/working"
328 }
329 Director {
330   Name = bacula-dir
331   Password = " "
332 }
333 Device {
334   Name = FileStorage
335   Media Type = File
336   Archive Device = /files/bacula
337   LabelMedia = yes;    # lets Bacula label unlabeled media
338   Random Access = Yes;
339   AutomaticMount = yes;   # when device opened, read it
340   RemovableMedia = no;
341   AlwaysOpen = no;
342 }
343 Messages {
344   Name = Standard
345   director = bacula-dir = all
346 }
347 \end{verbatim}
348 \normalsize
349