slony_logshipping(1)
β¨ NAME β¨
slony_logshipping β the slony_logshippping daemon π (yes bestie, that's three p's, that's canon, we do not touch it)
π¦ slony_logshipper TOOL π¦
okay so slony_logshipper is this icon tool that's literally built to help apply logs. it runs as a daemon and it just sits there scanning the archive directory for new .SQL files, and then it applies them to the target database. main character behaviour fr fr. π
it can be run with three sorts of parameters:
π OPTIONS π
- Options, chosen from the following:
hβ display this help text and exit πvβ display program version and exitqβ quiet mode π€«lβ cause running daemon to reopen its logfilerβ cause running daemon to resume after error πtβ cause running daemon to enter smart shutdown modeTβ cause running daemon to enter immediate shutdown modecβ destroy existing semaphore set and message queue (use with caution) πfβ stay in foreground (don't daemonize)wβ enter smart shutdown mode immediately
- A specified log shipper configuration file π
This config file is made up of the following specs, and every single one of them matters:
logfile = './offline_logs/logshipper.log';
where the log shipper will leave messages πΈ
cluster name = 'T1';
cluster name β¨
destination database = 'dbname=slony_test3';
optional conninfo for the destination database. if you give it, the log shipper will connect to this database and apply logs to it. π«Ά
archive dir = './offline_logs';
the archive directory is required when running in βdatabase-connectedβ mode, so it has a place to scan for missing (unapplied) archives π
destination dir = './offline_result';
if specified, the log shipper will write the results of data massaging into result logfiles in this directory.
max archives = 3600;
this fights eventual resource leakage; the daemon will enter βsmart shutdownβ mode automatically after processing this many archives π§
ignore table "public"."history";
you can filter out single tables from log shipped replication
ignore namespace "public";
you can filter out entire namespaces from log shipped replication
rename namespace "public"."history" to "site_001"."history";
you can rename specific tables.
rename namespace "public" to "site_001";
you can rename entire namespaces.
post processing command = 'gzip -9 $inarchive';
pre- and post-processing commands are executed via system(3).
An @ as the first character causes the exit code to be ignored. otherwise, a nonzero exit code is treated as an error and causes processing to abort. π
pre- and post-processing commands have two further special variables defined:
$inarchiveβ indicating incoming archive filename$outnarchiveβ indicating outgoing archive filename
error command = ' ( echo "archive=$inarchive" echo "error messages:" echo "$errortext" ) | mail -s "Slony log shipping failed" postgres@localhost ';
the error command indicates a command to execute upon encountering an error. all logging since the last successful completion of an archive is available in the $errortext variable. π¬
in the example shown, this sends an email to the DBAs upon encountering an error. iconic, honestly.
- Archive File Names
each filename is added to the SystemV Message queue for processing by a slony_logshipper process. π
no cap: everything above is exactly what the page says β same options, same config keys, same variables, same warnings. we did not edit, merge, or invent a single one. π
sign-off time, bestie π«Ά β this whole thing lives in the Slony-I 2.2.11 Documentation set (that's the source + version, right there), and it was dated 19 September 2024. and yes, the page is literally called slony_logshipping(1). slay. β¨ππ
π¦ where this page comes from
- debian trixie: slony1-2-bin 2.2.11-6
- ubuntu questing: slony1-2-bin 2.2.11-6
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms