setup zrepl with a dest. to kif (lord-nibbler) which is broken for now, and ma27's machine for hydra testing
Graham Christensen committed
Oct 22, 2022 at 18:53 UTC
b19b2e885572b92fee1d31276d07cee0aa9668c9
1 file changed
+100
delft/haumea.nix
+100
@@ -207,6 +207,106 @@
207
208
services.zfs.autoScrub.enable = true;
209
210
+ services.zrepl = {
211
+ enable = true;
212
+ settings = {
213
+ global = {
214
+ logging = [
215
+ {
216
+ type = "syslog";
217
+ level = "info";
218
+ format = "human";
219
+ }
220
+ ];
221
+ };
222
+
223
+ jobs = [
224
+ #{ name = "local";
225
+ # type = "snap";
226
+ # filesystems."rpool/local<" = true;
227
+ # snapshotting = {
228
+ # type = "periodic";
229
+ # interval = "5m";
230
+ # prefix = "zrepl_snap_";
231
+ # };
232
+ # pruning.keep = [
233
+ # {
234
+ # type = "grid";
235
+ # regex = "^zrepl_snap_.*";
236
+ # grid = lib.concatStringsSep " | " [
237
+ # "3x5m"
238
+ # "4x15m"
239
+ # "24x1h"
240
+ # "4x1d"
241
+ # "3x1w"
242
+ # ];
243
+ # }
244
+ # ];
245
+ #}
246
+ {
247
+ name = "safe";
248
+ type = "push";
249
+ filesystems."rpool/safe<" = true;
250
+ send.encrypted = true;
251
+ snapshotting = {
252
+ type = "periodic";
253
+ interval = "5m";
254
+ prefix = "zrepl_snap_";
255
+ };
256
+ connect = {
257
+ type = "ssh+stdinserver";
258
+ host = "lord-nibbler.gsc.io";
259
+ user = "hydraexport";
260
+ port = 22;
261
+ };
262
+ pruning = {
263
+ keep_sender = [
264
+ {
265
+ type = "grid";
266
+ regex = "^zrepl_snap_.*";
267
+ grid = lib.concatStringsSep " | " [
268
+ "3x5m"
269
+ "4x15m"
270
+ "24x1h"
271
+ "4x1d"
272
+ "3x1w"
273
+ ];
274
+ }
275
+ ];
276
+ keep_receiver = [
277
+ { type = "grid";
278
+ regex = "^zrepl_snap_.*";
279
+ grid = lib.concatStringsSep " | " [
280
+ "20x5m"
281
+ "96x1h"
282
+ "12x4h"
283
+ "7x1d"
284
+ "52x1w"
285
+ "120x3w"
286
+ ];
287
+ }
288
+ ];
289
+ };
290
+ }
291
+ {
292
+ # run with `zrepl signal wakeup safe_ma27` after
293
+ # snapshots were done from safe.
294
+ name = "safe_ma27";
295
+ type = "push";
296
+ filesystems."rpool/safe/postgres" = true;
297
+ send.encrypted = true;
298
+ snapshotting.type = "manual";
299
+ connect = {
300
+ type = "ssh+stdinserver";
301
+ host = "mbosch.me";
302
+ user = "hno";
303
+ port = 22;
304
+ };
305
+ }
306
+ ];
307
+ };
308
+ };
309
+
310
services.znapzend = {
311
enable = true;
312
autoCreation = true;