Debian Codegraph @

UG9/en/recent-changes.adoc

raw
1 [[ap-recent-changes]]
2 [appendix]
3 == Recent changes
4
5 This appendix is for users who upgrade from earlier DRBD versions to
6 DRBD 9.0. It highlights some important changes to DRBD's configuration
7 and behavior.
8
9 [[s-recent-changes-connections]]
10 === Connections
11
12 With DRBD 9 data can be replicated across more than two nodes.
13
14 This also means that stacking DRBD volumes is now deprecated (though still
15 possible); and that using DRBD as a network-blockdevice (a
16 <<s-drbd-client,__DRBD client__>>) now makes sense.
17
18 Associated with this change are
19
20 * Metadata size changes (one bitmap per peer)
21
22 * `/proc/drbd` now only gives minimal information, see
23 <<s-drbdadm-status, `drbdadm status`>>
24
25 * Resynchronization from/to <<s-multi-node,multiple peers>>
26
27 * The <<s-activity-log,activity log>> is used even when in
28 <<s-resource-roles,Secondary>> role
29
30 [[s-recent-changes-auto-promote]]
31 === Auto-Promote Feature
32
33 DRBD 9 can be configured to do the _Primary_/_Secondary_ <<s-resource-roles,role switch>>
34 automatically, on demand.
35
36 This feature replaces both the `become-primary-on` configuration value, as well
37 as the old Heartbeat v1 `drbddisk` script.
38
39 Please see <<s-automatic-promotion>> for more details.
40
41 [[s-recent-changes-performance]]
42 === Increased Performance
43
44 DRBD 9 has seen noticeable performance improvements, depending on your specific
45 hardware it's up to two magnitudes faster (measuring number of I/O
46 operations/second for random writes).
47
48 //FIXME: same as 8.4?
49
50
51 [[s-recent-changes-volumes]]
52 === Multiple Volumes in one Resource
53
54 Volumes are a new concept in DRBD 8.4. Prior to 8.4, every resource
55 had only one block device associated with it, thus there was a
56 one-to-one relationship between DRBD devices and resources. Since 8.4,
57 multiple volumes (each corresponding to one block device) may share a
58 single replication connection, which in turn corresponds to a single
59 resource.
60
61 This results in a few other necessary changes in behaviour:
62
63 [[s-recent-changes-volumes-udev]]
64 ==== Changes to udev symlinks
65
66 The DRBD udev integration scripts manage symlinks pointing to
67 individual block device nodes. These exist in the `/dev/drbd/by-res/`
68 and `/dev/drbd/by-disk/` directories.
69
70 Since DRBD 8.4, a single resource may correspond to multiple
71 volumes, `/dev/drbd/by-res/__<resource>__` is a _directory_,
72 containing symlinks pointing to individual volumes:
73
74 .udev managed DRBD symlinks in DRBD 8.4
75 ----------------------------
76 lrwxrwxrwx 1 root root 11 2015-08-09 19:32 /dev/drbd/by-res/home/0 -> ../../drbd0
77 lrwxrwxrwx 1 root root 11 2015-08-09 19:32 /dev/drbd/by-res/data/0 -> ../../drbd1
78 lrwxrwxrwx 1 root root 11 2015-08-09 19:33 /dev/drbd/by-res/nfs-root/0 -> ../../drbd2
79 lrwxrwxrwx 1 root root 11 2015-08-09 19:33 /dev/drbd/by-res/nfs-root/1 -> ../../drbd3
80 ----------------------------
81
82 Configurations where filesystems are referred to by such a symlink must be
83 updated when moving to DRBD 8.4, usually by simply appending `/0` to
84 the symlink path. If the filesystem was referenced via `UUID=` or
85 `/dev/drbd__X__` in `/etc/fstab`, no change is necessary.
86
87
88 [[s-recent-changes-config]]
89 === Changes to the configuration syntax
90
91 This section highlights changes to the configuration syntax. It
92 affects the DRBD configuration files in `/etc/drbd.d`, and
93 `/etc/drbd.conf`.
94
95 IMPORTANT: The `drbdadm` parser still accepts pre-8.4 configuration
96 syntax and automatically translates, internally, into the current
97 syntax. Unless you are planning to use new features from DRBD 9,
98 there is no requirement to modify your
99 configuration to the current syntax. It is, however, recommended that
100 you eventually adopt the new syntax, as the old format will no longer
101 be supported in DRBD 9.
102
103 [[s-recent-changes-config-booleans]]
104 ==== Boolean configuration options
105
106 `drbd.conf` supports a variety of boolean configuration options. In
107 pre DRBD 8.4 syntax, these boolean options would be set as follows:
108
109 .Pre-DRBD 8.4 configuration example with boolean options
110 [source,drbd]
111 ----------------------------
112 resource test {
113 disk {
114 no-md-flushes;
115 }
116 }
117 ----------------------------
118
119 This led to configuration issues if you wanted to set a boolean
120 variable in the `common` configuration section, and then override it
121 for individual resources:
122
123 .Pre-DRBD 8.4 configuration example with boolean options in `common` section
124 [source,drbd]
125 ----------------------------
126 common {
127 disk {
128 no-md-flushes;
129 }
130 }
131 resource test {
132 disk {
133 # No facility to enable disk flushes previously disabled in
134 # "common"
135 }
136 }
137 ----------------------------
138
139 In DRBD 8.4, all boolean options take a value of `yes` or `no`, making
140 them easily configurable both from `common` and from individual
141 `resource` sections:
142
143 .DRBD 8.4 configuration example with boolean options in `common` section
144 [source,drbd]
145 ----------------------------
146 common {
147 md-flushes no;
148 }
149 resource test {
150 disk {
151 md-flushes yes;
152 }
153 }
154 ----------------------------
155
156 [[s-recent-changes-config-syncer]]
157 ==== `syncer` section no longer exists
158
159 Prior to DRBD 8.4, the configuration syntax allowed for a `syncer`
160 section which has become obsolete in 8.4. All previously existing
161 `syncer` options have now moved into the `net` or `disk` sections of
162 resources.
163
164 .Pre-DRBD 8.4 configuration example with `syncer` section
165 [source,drbd]
166 ----------------------------
167 resource test {
168 syncer {
169 al-extents 3389;
170 verify-alg md5;
171 }
172 ...
173 }
174 ----------------------------
175
176 The above example is expressed, in DRBD 8.4 syntax, as follows:
177
178 .DRBD 8.4 configuration example with `syncer` section replaced
179 [source,drbd]
180 ----------------------------
181 resource test {
182 disk {
183 al-extents 3389;
184 }
185 net {
186 verify-alg md5;
187 }
188 ...
189 }
190 ----------------------------
191
192 [[s-recent-changes-config-protocol]]
193 ==== `protocol` option is no longer special
194
195 In prior DRBD releases, the `protocol` option was awkwardly (and
196 counter-intuitively) required to be specified on its own, rather than
197 as part of the `net` section. DRBD 8.4 removes this anomaly:
198
199 .Pre-DRBD 8.4 configuration example with standalone `protocol` option
200 [source,drbd]
201 ----------------------------
202 resource test {
203 protocol C;
204 ...
205 net {
206 ...
207 }
208 ...
209 }
210 ----------------------------
211
212 The equivalent DRBD 8.4 configuration syntax is:
213
214 .DRBD 8.4 configuration example with `protocol` option within `net` section
215 [source,drbd]
216 ----------------------------
217 resource test {
218 net {
219 protocol C;
220 ...
221 }
222 ...
223 }
224 ----------------------------
225
226
227 [[s-recent-changes-config-options]]
228 ==== New per-resource `options` section
229
230 DRBD 8.4 introduces a new `options` section that may be specified
231 either in a `resource` or in the `common` section. The `cpu-mask`
232 option has moved into this section from the `syncer` section in which
233 it was awkwardly configured before. The `on-no-data-accessible` option
234 has also moved to this section, rather than being in `disk` where
235 it had been in pre-8.4 releases.
236
237 .Pre-DRBD 8.4 configuration example with `cpu-mask` and `on-no-data-accessible`
238 [source,drbd]
239 ----------------------------
240 resource test {
241 syncer {
242 cpu-mask ff;
243 }
244 disk {
245 on-no-data-accessible suspend-io;
246 }
247 ...
248 }
249 ----------------------------
250
251 The equivalent DRBD 8.4 configuration syntax is:
252
253 .DRBD 8.4 configuration example with `options` section
254 [source,drbd]
255 ----------------------------
256 resource test {
257 options {
258 cpu-mask ff;
259 on-no-data-accessible suspend-io;
260 }
261 ...
262 }
263 ----------------------------
264
265
266 [[s-recent-changes-net]]
267 === On-line changes to network communications
268
269 [[s-recent-changes-change-protocol]]
270 ==== Changing the replication protocol
271
272 Prior to DRBD 8.4, changes to the replication protocol were impossible
273 while the resource was on-line and active. You would have to change
274 the `protocol` option in your resource configuration file, then issue
275 `drbdadm disconnect` and finally `drbdadm connect` on both nodes.
276
277 In DRBD 8.4, the replication protocol can be changed on the fly. You
278 may, for example, temporarily switch a connection to asynchronous
279 replication from its normal, synchronous replication mode.
280
281 .Changing replication protocol while connection is established
282 ----------------------------
283 drbdadm net-options --protocol=A <resource>
284 ----------------------------
285
286 [[s-recent-changes-switch-dual-primary]]
287 ==== Changing from single-Primary to dual-Primary replication
288
289 Prior to DRBD 8.4, it was impossible to switch between single-Primary
290 to dual-Primary or back while the resource was on-line and active. You
291 would have to change the `allow-two-primaries` option in your resource
292 configuration file, then issue `drbdadm disconnect` and finally
293 `drbdadm connect` on both nodes.
294
295 In DRBD 8.4, it is possible to switch modes on-line.
296
297 CAUTION: It is _required_ for an application using DRBD dual-Primary
298 mode to use a clustered file system or some other distributed locking
299 mechanism. This applies regardless of whether dual-Primary mode is
300 enabled on a temporary or permanent basis.
301
302 Refer to <<s-enable-dual-primary-temporary>> for switching to
303 dual-Primary mode while the resource is on-line.
304
305
306 [[s-recent-changes-drbdadm]]
307 === Changes to the `drbdadm` command
308
309 [[s-recent-changes-drbdadm-passthrough-options]]
310 ==== Changes to pass-through options
311
312 Prior to DRBD 8.4, if you wanted `drbdadm` to pass special options through to
313 `drbdsetup`, you had to use the arcane `--{nbsp}--<option>` syntax, as in the
314 following example:
315
316 .Pre-DRBD 8.4 `drbdadm` pass-through options
317 ----------------------------
318 drbdadm -- --discard-my-data connect <resource>
319 ----------------------------
320
321 Instead, `drbdadm` now accepts those pass-through options as normal options:
322
323 .DRBD 8.4 `drbdadm` pass-through options
324 ----------------------------
325 drbdadm connect --discard-my-data <resource>
326 ----------------------------
327
328 NOTE: The old syntax is still supported, but its use is strongly
329 discouraged. However, if you choose to use the new, more
330 straightforward syntax, you must specify the option
331 (`--discard-my-data`) _after_ the subcommand (`connect`) and _before_
332 the resource identifier.
333
334 [[s-recent-changes-drbdadm-force]]
335 ==== `--force` option replaces `--overwrite-data-of-peer`
336
337 The `--overwrite-data-of-peer` option is no longer present in DRBD
338 8.4. It has been replaced by the simpler `--force`. Thus, to kick off
339 an initial resource synchronization, you no longer use the following
340 command:
341
342 .Pre-DRBD 8.4 initial sync `drbdadm` commands
343 ----------------------------
344 drbdadm -- --overwrite-data-of-peer primary <resource>
345 ----------------------------
346
347 Use the command below instead:
348
349 .DRBD 8.4 initial sync `drbdadm` commands
350 ----------------------------
351 drbdadm primary --force <resource>
352 ----------------------------
353
354
355 [[s-recent-changes-defaults]]
356 === Changed default values
357
358 In DRBD 8.4, several `drbd.conf` default values have been updated to
359 match improvements in the Linux kernel and available server hardware.
360
361 [[s-recent-changes-defaults-al-extents]]
362 ==== Number of concurrently active Activity Log extents (`al-extents`)
363
364 ``al-extents``' previous default of 127 has changed to 1237, allowing
365 for better performance by reducing the amount of metadata disk write
366 operations. The associated extended resynchronization time after a
367 primary node crash, which this change introduces, is marginal given
368 the ubiquity of Gigabit Ethernet and higher-bandwidth replication
369 links.
370
371 [[s-recent-changes-defaults-use-rle]]
372 ==== Run-length encoding (`use-rle`)
373
374 Run-length encoding (RLE) for bitmap transfers is enabled by default
375 in DRBD 8.4; the default for the `use-rle` option is `yes`. RLE
376 greatly reduces the amount of data transferred during the
377 <<s-quick-sync-bitmap,quick-sync bitmap>> exchange (which occurs any
378 time two disconnected nodes reconnect).
379
380 [[s-recent-changes-on-io-error]]
381 ==== I/O error handling strategy (`on-io-error`)
382
383 DRBD 8.4 defaults to <<fp-io-error-detach,masking I/O errors>>, which
384 replaces the earlier behavior of <<fp-io-error-pass-on,passing them on>>
385 to upper layers in the I/O stack. This means that a DRBD volume
386 operating on a faulty drive automatically switches to the _Diskless_
387 disk state and continues to serve data from its peer node.
388
389 [[s-recent-changes-defaults-variable-rate-sync]]
390 ==== Variable-rate synchronization
391
392 <<s-variable-rate-sync,Variable-rate synchronization>> is on by
393 default in DRBD 8.4. The default settings are equivalent to the
394 following configuration options:
395
396 .DRBD 8.4 default options for variable-rate synchronization
397 [source,drbd]
398 ----------------------------
399 resource test {
400 disk {
401 c-plan-ahead 20;
402 c-fill-target 50k;
403 c-min-rate 250k;
404 }
405 ...
406 ----------------------------
407
408 [[s-recent-changes-defaults-minor-count]]
409 ==== Number of configurable DRBD devices (`minor-count`)
410
411 The maximum number of configurable DRBD devices (previously 255) is
412 1,048,576 (2^20^) in DRBD 8.4. This is more of a theoretical limit
413 that is unlikely to be reached in production systems.