-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #447: haumea/zrepl: reduce snapshot count, etc.
- Loading branch information
Showing
3 changed files
with
80 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
filesystems."rpool/safe<" = true; | ||
snapshotting = { | ||
type = "periodic"; | ||
interval = "15m"; | ||
interval = "30m"; | ||
prefix = "zrepl_snap_"; | ||
hooks = [ { | ||
# https://zrepl.github.io/master/configuration/snapshotting.html#postgres-checkpoint-hook | ||
|
@@ -31,27 +31,52 @@ | |
filesystems."rpool/safe/postgres" = true; | ||
} ]; | ||
}; | ||
|
||
# The current pruning setup is an exponentially growing scheme, at both sides. | ||
pruning = { | ||
keep_sender = [ | ||
{ type = "not_replicated"; } | ||
{ | ||
type = "grid"; | ||
regex = "^zrepl_snap_.*"; | ||
grid = lib.concatStringsSep " | " [ | ||
"4x15m" | ||
"24x1h" | ||
"4x1d" | ||
"3x1w" | ||
"1x1h(keep=all)" | ||
"1x1h" | ||
"1x2h" | ||
"1x4h" | ||
# "grid" acts weird if an interval isn't a whole-number multiple | ||
# of the previous one, so we jump from 8h to 24h | ||
"2x8h" | ||
"1x1d" | ||
"1x2d" | ||
"1x4d" | ||
"1x8d" | ||
# At this point we keep ~10 snapshots spanning 8--16 days (depends on moment), | ||
# with exponentially increasing spacing (almost). | ||
]; | ||
} | ||
]; | ||
keep_receiver = [ | ||
{ type = "grid"; | ||
regex = "^zrepl_snap_.*"; | ||
grid = lib.concatStringsSep " | " [ | ||
"96x1h" | ||
"12x4h" | ||
"7x1d" | ||
"52x1w" | ||
"2x1h(keep=all)" | ||
"2x1h" | ||
"2x2h" | ||
"2x4h" | ||
"4x8h" | ||
# At this point the grid spans 2 days by ~13 snapshots. | ||
# (See note above about 8h -> 24h.) | ||
"2x1d" | ||
"2x2d" | ||
"2x4d" | ||
"2x8d" | ||
"2x16d" | ||
"2x32d" | ||
"2x64d" | ||
"2x128d" | ||
# At this point we keep ~29 snapshots spanning 384--512 days (depends on moment), | ||
# with exponentially increasing spacing (almost). | ||
]; | ||
} | ||
]; | ||
|
@@ -71,18 +96,26 @@ | |
}; | ||
|
||
jobs = [ | ||
# XXX: Broken since 2024-01-10? | ||
# (defaultBackupJob // { | ||
# name = "rsyncnet"; | ||
# connect = { | ||
# identity_file = "/root/.ssh/id_ed25519"; | ||
# type = "ssh+stdinserver"; | ||
# host = "zh2543b.rsync.net"; | ||
# user = "root"; | ||
# port = 22; | ||
# }; | ||
# }) | ||
# Covers 20240629+ | ||
(defaultBackupJob // { | ||
name = "rsyncnet"; | ||
connect = { | ||
identity_file = "/root/.ssh/id_ed25519"; | ||
type = "ssh+stdinserver"; | ||
host = "zh4461b.rsync.net"; | ||
user = "root"; | ||
port = 22; | ||
}; | ||
}) | ||
/* rsync.net provides a VM with FreeBSD | ||
- almost nothing is preserved on upgrades except this "data1" zpool | ||
$ scp ./zrepl.yml [email protected]:/usr/local/etc/zrepl/zrepl.yml | ||
# pkg install zrepl | ||
# service zrepl enable | ||
# service zrepl start | ||
*/ | ||
|
||
/* Covered 2024: 0212 -- 0629 | ||
(defaultBackupJob // { | ||
name = "hexa"; | ||
connect = { | ||
|
@@ -93,6 +126,7 @@ | |
port = 22; | ||
}; | ||
}) | ||
*/ | ||
]; | ||
}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# [email protected]:/usr/local/etc/zrepl/zrepl.yml | ||
# zrepl main configuration file. | ||
# For documentation, refer to https://zrepl.github.io/ | ||
# | ||
global: | ||
logging: | ||
- type: "stdout" | ||
level: "error" | ||
format: "human" | ||
- type: "syslog" | ||
level: "info" | ||
format: "logfmt" | ||
|
||
# mostly from https://blog.lenny.ninja/zrepl-on-rsync-net.html | ||
jobs: | ||
- name: sink | ||
type: sink | ||
serve: | ||
type: stdinserver | ||
client_identities: [ haumea ] | ||
recv: | ||
placeholder: | ||
encryption: off | ||
root_fs: "data1" |