mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-14 10:13:05 +02:00
aadc9e2fe6
Bug Fixes: * Fix resume after partial delete of backup by prior resume. (Reviewed by Cynthia Shang. Reported by Tom Swartz.) Features: * Add repo-ls command. (Reviewed by Cynthia Shang, Stefan Fercot.) * Add repo-get command. (Contributed by Stefan Fercot, David Steele. Reviewed by Cynthia Shang.) * Add archive-mode-check option. (Contributed by Stefan Fercot. Reviewed by David Steele, Michael Banck.) Improvements: * Improve archive-get performance. (Reviewed by Cynthia Shang.)
17134 lines
653 KiB
Plaintext
17134 lines
653 KiB
Plaintext
{
|
|
"default" : {
|
|
"all" : {
|
|
"contributing" : [
|
|
{
|
|
"key" : {
|
|
"id" : "contrib",
|
|
"image" : "pgbackrest/doc:contrib",
|
|
"name" : "pgbackrest-dev",
|
|
"option" : "-v /var/run/docker.sock:/var/run/docker.sock -v /home/vagrant/test:/home/vagrant/test",
|
|
"os" : "u18",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.8"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get update"
|
|
],
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get install rsync git devscripts build-essential valgrind lcov autoconf \\",
|
|
" autoconf-archive libssl-dev zlib1g-dev libxml2-dev libpq-dev pkg-config \\",
|
|
" libxml-checker-perl libyaml-perl libdbd-pg-perl liblz4-dev liblz4-tool \\",
|
|
" zstd libzstd-dev bzip2 libbz2-dev"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"pgbackrest/test/test.pl --clean-only"
|
|
],
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"curl -fsSL https://get.docker.com | sudo sh"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo usermod -aG docker `whoami`"
|
|
],
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 666 /var/run/docker.sock"
|
|
],
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"pgbackrest/test/test.pl --vm=none --dry-run"
|
|
],
|
|
"cmd-extra" : "--no-log-timestamp",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"[0-9]+ tests selected|DRY RUN COMPLETED SUCCESSFULLY"
|
|
]
|
|
},
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: test begin - log level info",
|
|
"P00 INFO: builds required: bin",
|
|
"P00 INFO: 68 tests selected",
|
|
" ",
|
|
"P00 INFO: P1-T01/68 - vm=none, module=common, test=error",
|
|
" [filtered 65 lines of output]",
|
|
"P00 INFO: P1-T67/68 - vm=none, module=performance, test=type",
|
|
"P00 INFO: P1-T68/68 - vm=none, module=performance, test=storage",
|
|
"P00 INFO: DRY RUN COMPLETED SUCCESSFULLY"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"pgbackrest/test/test.pl --vm=none --dev --vm-out --module=common --test=wait"
|
|
],
|
|
"cmd-extra" : "--no-log-timestamp",
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: test begin - log level info",
|
|
"P00 INFO: check code autogenerate",
|
|
"P00 INFO: cleanup old data",
|
|
"P00 INFO: builds required: none",
|
|
"P00 INFO: 1 test selected",
|
|
" ",
|
|
"P00 INFO: P1-T1/1 - vm=none, module=common, test=wait",
|
|
" ",
|
|
" run 1 - waitNew(), waitMore, and waitFree()",
|
|
" l0018 expect AssertError: assertion 'waitTime <= 999999000' failed",
|
|
" ",
|
|
" run 1/1 ------------- l0021 0ms wait",
|
|
" l0025 new wait",
|
|
" l0026 check remaining time",
|
|
" l0027 check wait time",
|
|
" l0028 check sleep time",
|
|
" l0029 check sleep prev time",
|
|
" l0030 no wait more",
|
|
" l0033 new wait = 0.2 sec",
|
|
" l0034 check remaining time",
|
|
" l0035 check wait time",
|
|
" l0036 check sleep time",
|
|
" l0037 check sleep prev time",
|
|
" l0038 check begin time",
|
|
" l0044 lower range check",
|
|
" l0045 upper range check",
|
|
" l0047 free wait",
|
|
" l0052 new wait = 1.1 sec",
|
|
" l0053 check wait time",
|
|
" l0054 check sleep time",
|
|
" l0055 check sleep prev time",
|
|
" l0056 check begin time",
|
|
" l0062 lower range check",
|
|
" l0063 upper range check",
|
|
" l0065 free wait",
|
|
" ",
|
|
" TESTS COMPLETED SUCCESSFULLY",
|
|
"",
|
|
"P00 INFO: P1-T1/1 - vm=none, module=common, test=wait",
|
|
"P00 INFO: tested modules have full coverage",
|
|
"P00 INFO: writing C coverage report",
|
|
"P00 INFO: TESTS COMPLETED SUCCESSFULLY"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"pgbackrest/test/test.pl --vm=none --dev --module=postgres"
|
|
],
|
|
"cmd-extra" : "--no-log-timestamp",
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: test begin - log level info",
|
|
"P00 INFO: check code autogenerate",
|
|
"P00 INFO: cleanup old data",
|
|
"P00 INFO: builds required: none",
|
|
"P00 INFO: 2 tests selected",
|
|
" ",
|
|
"P00 INFO: P1-T1/2 - vm=none, module=postgres, test=client",
|
|
"P00 INFO: P1-T2/2 - vm=none, module=postgres, test=interface",
|
|
"P00 INFO: tested modules have full coverage",
|
|
"P00 INFO: writing C coverage report",
|
|
"P00 INFO: TESTS COMPLETED SUCCESSFULLY"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"pgbackrest/test/test.pl --vm-build --vm=u18"
|
|
],
|
|
"cmd-extra" : "--no-log-timestamp",
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: test begin - log level info",
|
|
"P00 INFO: Using cached pgbackrest/test:u18-base-20200924A image (d95d53e642fc1cea4a2b8e935ea7d9739f7d1c46) ...",
|
|
"P00 INFO: Building pgbackrest/test:u18-test image ...",
|
|
"P00 INFO: Build Complete"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"pgbackrest/test/test.pl --vm=u18 --dev --module=mock --test=archive --run=2"
|
|
],
|
|
"cmd-extra" : "--no-log-timestamp",
|
|
"host" : "pgbackrest-dev",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: test begin - log level info",
|
|
"P00 INFO: check code autogenerate",
|
|
"P00 INFO: cleanup old data and containers",
|
|
"P00 INFO: builds required: bin, bin host",
|
|
"P00 INFO: bin dependencies have changed for u18, rebuilding...",
|
|
"P00 INFO: build bin for u18 (/home/vagrant/test/bin/u18)",
|
|
"P00 INFO: bin dependencies have changed for none, rebuilding...",
|
|
"P00 INFO: build bin for none (/home/vagrant/test/bin/none)",
|
|
"P00 INFO: 1 test selected",
|
|
" ",
|
|
"P00 INFO: P1-T1/1 - vm=u18, module=mock, test=archive, run=2",
|
|
"P00 INFO: no code modules had all tests run required for coverage",
|
|
"P00 INFO: TESTS COMPLETED SUCCESSFULLY"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"user-guide" : [
|
|
{
|
|
"key" : {
|
|
"id" : "azure",
|
|
"image" : "mcr.microsoft.com/azure-storage/azurite",
|
|
"name" : "azure-server",
|
|
"option" : "-v {[host-repo-path]}/doc/resource/fake-cert/azure-server.crt:/root/public.crt:ro -v {[host-repo-path]}/doc/resource/fake-cert/azure-server.key:/root/private.key:ro -e AZURITE_ACCOUNTS='pgbackrest:YXpLZXk='",
|
|
"os" : "debian",
|
|
"param" : "azurite-blob --blobPort 443 --blobHost 0.0.0.0 --cert=/root/public.crt --key=/root/private.key",
|
|
"update-hosts" : false
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.2"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "s3",
|
|
"image" : "minio/minio",
|
|
"name" : "s3-server",
|
|
"option" : "-v {[host-repo-path]}/doc/resource/fake-cert/s3-server.crt:/root/.minio/certs/public.crt:ro -v {[host-repo-path]}/doc/resource/fake-cert/s3-server.key:/root/.minio/certs/private.key:ro -e MINIO_REGION=us-east-1 -e MINIO_DOMAIN=s3.us-east-1.amazonaws.com -e MINIO_BROWSER=off -e MINIO_ACCESS_KEY=accessKey1 -e MINIO_SECRET_KEY=verySecretKey1",
|
|
"os" : "debian",
|
|
"param" : "server /data --address :443",
|
|
"update-hosts" : false
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.3"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "build",
|
|
"image" : "pgbackrest/doc:debian",
|
|
"name" : "build",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "debian",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.4"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo cp -r /pgbackrest/src /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown -R vagrant /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get update"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get install make gcc libpq-dev libssl-dev libxml2-dev pkg-config \\",
|
|
" liblz4-dev libzstd-dev libbz2-dev libz-dev"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"cd /build/pgbackrest-release-2.32/src && ./configure && make"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "pg1",
|
|
"image" : "pgbackrest/doc:debian",
|
|
"name" : "pg-primary",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "debian",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.5"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get install postgresql-client libxml2"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"pgBackRest 2.32 - General help",
|
|
"",
|
|
"Usage:",
|
|
" pgbackrest [options] [command]",
|
|
"",
|
|
"Commands:",
|
|
" archive-get Get a WAL segment from the archive.",
|
|
" archive-push Push a WAL segment to the archive.",
|
|
" backup Backup a database cluster.",
|
|
" check Check the configuration.",
|
|
" expire Expire backups that exceed retention.",
|
|
" help Get help.",
|
|
" info Retrieve information about backups.",
|
|
" repo-get Get files from a repository.",
|
|
" repo-ls List files in a repository.",
|
|
" restore Restore a database cluster.",
|
|
" stanza-create Create the required stanza data.",
|
|
" stanza-delete Delete a stanza.",
|
|
" stanza-upgrade Upgrade a stanza.",
|
|
" start Allow pgBackRest processes to run.",
|
|
" stop Stop pgBackRest processes from running.",
|
|
" version Get version.",
|
|
"",
|
|
"Use 'pgbackrest help [command]' for more information."
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres /usr/lib/postgresql/12/bin/initdb \\",
|
|
" -D /var/lib/postgresql/12/demo -k -A peer"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_createcluster 12 demo"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"Configuring already existing cluster (configuration: /etc/postgresql/12/demo, data: /var/lib/postgresql/12/demo, owner: 106:110)",
|
|
"Ver Cluster Port Status Owner Data directory Log file",
|
|
"12 demo 5432 down postgres /var/lib/postgresql/12/demo /var/log/postgresql/postgresql-12-demo.log"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/postgresql/12/demo/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"listen_addresses" : {
|
|
"value" : "'*'"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/postgresql/12/demo/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'",
|
|
"log_line_prefix = ''"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/postgresql/12/demo"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres bash -c ' \\",
|
|
" export PGBACKREST_LOG_PATH=/path/set/by/env && \\",
|
|
" pgbackrest --log-level-console=error help backup log-path'"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"current\\: \\/path\\/set\\/by\\/env"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"pgBackRest 2.32 - 'backup' command - 'log-path' option help",
|
|
"",
|
|
"Path where log files are stored.",
|
|
"",
|
|
"The log path provides a location for pgBackRest to store log files. Note that",
|
|
"if log-level-file=off then no log path is required.",
|
|
"",
|
|
"current: /path/set/by/env",
|
|
"default: /var/log/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 750 /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-path" : {
|
|
"value" : "/var/lib/pgbackrest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/postgresql/12/demo/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "replica"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"listen_addresses = '*'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = replica"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo restart"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global:archive-push" : {
|
|
"compress-level" : {
|
|
"value" : "3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-cipher-pass" : {
|
|
"value" : "zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO"
|
|
},
|
|
"repo1-cipher-type" : {
|
|
"value" : "aes-256-cbc"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=402-a2fd40f1 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
" successfully archived to "
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=410-d5e67b32 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: check repo1 configuration (primary)",
|
|
"P00 INFO: check repo1 archive for WAL (primary)",
|
|
"P00 INFO: WAL segment 000000010000000000000001 successfully archived to '/var/lib/pgbackrest/archive/demo/12-1/0000000100000000/000000010000000000000001-297cd25f802ca9e2a017977bc8477e44c0d65136.gz' on repo1",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=421-d2235fa1 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the next regular checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000010000000000000002, lsn = 0/2000028",
|
|
" [filtered 973 lines of output]",
|
|
"P01 INFO: backup file /var/lib/postgresql/12/demo/base/1/13201 (0B, 100%)",
|
|
"P01 INFO: backup file /var/lib/postgresql/12/demo/base/1/13196 (0B, 100%)",
|
|
"P00 INFO: full backup size = 23.4MB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000010000000000000002, lsn = 0/2000138",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-171428F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"diff backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 4 lines of output]",
|
|
"P01 INFO: backup file /var/lib/postgresql/12/demo/global/pg_control (8KB, 99%) checksum 5d26f2d1d330d477188c8282f45b754137e6e75e",
|
|
"P01 INFO: backup file /var/lib/postgresql/12/demo/pg_logical/replorigin_checkpoint (8B, 100%) checksum 347fc8f2df71bd4436e38bd1516ccd7ea0d46532",
|
|
"P00 INFO: diff backup size = 8KB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000010000000000000003, lsn = 0/3000100",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"(full|incr|diff) backup"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: aes-256-cbc",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (12): 000000010000000000000001/000000010000000000000003",
|
|
"",
|
|
" full backup: 20210205-171428F",
|
|
" timestamp start/stop: 2021-02-05 17:14:28 / 2021-02-05 17:14:38",
|
|
" wal start/stop: 000000010000000000000002 / 000000010000000000000002",
|
|
" database size: 23.4MB, database backup size: 23.4MB",
|
|
" repo1: backup set size: 2.8MB, backup size: 2.8MB",
|
|
"",
|
|
" diff backup: 20210205-171428F_20210205-171439D",
|
|
" timestamp start/stop: 2021-02-05 17:14:39 / 2021-02-05 17:14:41",
|
|
" wal start/stop: 000000010000000000000003 / 000000010000000000000003",
|
|
" database size: 23.4MB, database backup size: 8.3KB",
|
|
" repo1: backup set size: 2.8MB, backup size: 496B",
|
|
" backup reference list: 20210205-171428F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres rm /var/lib/postgresql/12/demo/global/pg_control"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"could not find the database system"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"Error: /usr/lib/postgresql/12/bin/pg_ctl /usr/lib/postgresql/12/bin/pg_ctl start -D /var/lib/postgresql/12/demo -l /var/log/postgresql/postgresql-12-demo.log -s -o -c config_file=\"/etc/postgresql/12/demo/postgresql.conf\" exited with status 1: ",
|
|
"postgres: could not find the database system",
|
|
"Expected to find it in the directory \"/var/lib/postgresql/12/demo\",",
|
|
"but could not open file \"/var/lib/postgresql/12/demo/global/pg_control\": No such file or directory",
|
|
"Examine the log output."
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres find /var/lib/postgresql/12/demo -mindepth 1 -delete"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup begins after the next regular checkpoint completes"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=563-4d2ec306 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --type=incr",
|
|
"P00 INFO: last backup label = 20210205-171428F_20210205-171439D, version = 2.32",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the next regular checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000020000000000000005, lsn = 0/5000028",
|
|
"P00 WARN: a timeline switch has occurred since the 20210205-171428F_20210205-171439D backup, enabling delta checksum",
|
|
" [filtered 10 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"start-fast" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup begins after the requested immediate checkpoint completes"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=595-6c483a44 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr",
|
|
"P00 INFO: last backup label = 20210205-171428F_20210205-171459I, version = 2.32",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000020000000000000006, lsn = 0/6000028",
|
|
"P01 INFO: backup file /var/lib/postgresql/12/demo/global/pg_control (8KB, 99%) checksum 2f817e7be182a30c92efa11e7053d57c376a5b79",
|
|
" [filtered 8 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -p /var/lib/postgresql/pgbackrest/doc/example"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cp -r /pgbackrest/doc/example/* \\",
|
|
" /var/lib/postgresql/pgbackrest/doc/example"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat \\",
|
|
" /var/lib/postgresql/pgbackrest/doc/example/pgsql-pgbackrest-info.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-- An example of monitoring pgBackRest from within PostgreSQL",
|
|
"--",
|
|
"-- Use copy to export data from the pgBackRest info command into the jsonb",
|
|
"-- type so it can be queried directly by PostgreSQL.",
|
|
"",
|
|
"-- Create monitor schema",
|
|
"create schema monitor;",
|
|
"",
|
|
"-- Get pgBackRest info in JSON format",
|
|
"create function monitor.pgbackrest_info()",
|
|
" returns jsonb AS $$",
|
|
"declare",
|
|
" data jsonb;",
|
|
"begin",
|
|
" -- Create a temp table to hold the JSON data",
|
|
" create temp table temp_pgbackrest_data (data jsonb);",
|
|
"",
|
|
" -- Copy data into the table directly from the pgBackRest info command",
|
|
" copy temp_pgbackrest_data (data)",
|
|
" from program",
|
|
" 'pgbackrest --output=json info' (format text);",
|
|
"",
|
|
" select temp_pgbackrest_data.data",
|
|
" into data",
|
|
" from temp_pgbackrest_data;",
|
|
"",
|
|
" drop table temp_pgbackrest_data;",
|
|
"",
|
|
" return data;",
|
|
"end $$ language plpgsql;"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -f \\",
|
|
" /var/lib/postgresql/pgbackrest/doc/example/pgsql-pgbackrest-info.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat \\",
|
|
" /var/lib/postgresql/pgbackrest/doc/example/pgsql-pgbackrest-query.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-- Get last successful backup for each stanza",
|
|
"--",
|
|
"-- Requires the monitor.pgbackrest_info function.",
|
|
"with stanza as",
|
|
"(",
|
|
" select data->'name' as name,",
|
|
" data->'backup'->(",
|
|
" jsonb_array_length(data->'backup') - 1) as last_backup,",
|
|
" data->'archive'->(",
|
|
" jsonb_array_length(data->'archive') - 1) as current_archive",
|
|
" from jsonb_array_elements(monitor.pgbackrest_info()) as data",
|
|
")",
|
|
"select name,",
|
|
" to_timestamp(",
|
|
" (last_backup->'timestamp'->>'stop')::numeric) as last_successful_backup,",
|
|
" current_archive->>'max' as last_archived_wal",
|
|
" from stanza;"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -f \\",
|
|
" /var/lib/postgresql/pgbackrest/doc/example/pgsql-pgbackrest-query.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" name | last_successful_backup | last_archived_wal ",
|
|
"--------+------------------------+--------------------------",
|
|
" \"demo\" | 2021-02-05 17:15:03+00 | 000000020000000000000006",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get install jq"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --output=json --stanza=demo info | \\",
|
|
" jq '.[0] | .backup[-1] | .timestamp.stop'"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"1612545303"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --output=json --stanza=demo info | \\",
|
|
" jq '.[0] | .archive[-1] | .max'"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"\"000000020000000000000006\""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=full \\",
|
|
" --log-level-console=detail backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"archive retention on backup 20210205-171428F|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 984 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=751-d8dc4ea8 --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 DETAIL: archive retention on backup 20210205-171428F repo1: 12-1, start = 000000010000000000000002",
|
|
"P00 DETAIL: remove archive repo1: 12-1, start = 000000010000000000000001, stop = 000000010000000000000001",
|
|
"P00 INFO: expire command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-171508F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=full \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"expire full backup set repo1\\: 20210205-171428F|archive retention on backup 20210205-171508F|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 983 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=780-9e985e08 --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 INFO: expire full backup set repo1: 20210205-171428F, 20210205-171428F_20210205-171439D, 20210205-171428F_20210205-171459I, 20210205-171428F_20210205-171502I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-171428F_20210205-171502I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-171428F_20210205-171459I",
|
|
" [filtered 2 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-diff" : {
|
|
"value" : "1"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-diff=1",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-171520F_20210205-171536D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"expire diff backup set repo1: 20210205-171520F_20210205-171536D"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 11 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=851-a3e2f11d --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=1 --repo1-retention-full=2 --stanza=demo",
|
|
"P00 INFO: expire diff backup set repo1: 20210205-171520F_20210205-171536D, 20210205-171520F_20210205-171540I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-171520F_20210205-171540I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-171520F_20210205-171536D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-diff" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-171520F_20210205-171542D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select pg_create_restore_point('generate WAL'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('generate WAL'); select pg_switch_wal();\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"new backup label"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 8 lines of output]",
|
|
"P00 INFO: backup stop archive = 000000020000000000000010, lsn = 0/10000100",
|
|
"P00 INFO: check archive for segment(s) 000000020000000000000010:000000020000000000000010",
|
|
"P00 INFO: new backup label = 20210205-171520F_20210205-171546D",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=910-2d58bcf5 --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-171520F_20210205-171546D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=detail \\",
|
|
" --repo1-retention-archive-type=diff --repo1-retention-archive=1 expire"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"archive retention on backup 20210205-171520F_20210205-171542D|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: expire command begin 2.32: --exec-id=935-a9dd70ed --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-archive=1 --repo1-retention-archive-type=diff --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo",
|
|
"P00 DETAIL: archive retention on backup 20210205-171508F repo1: 12-1, start = 000000020000000000000008, stop = 000000020000000000000008",
|
|
"P00 DETAIL: archive retention on backup 20210205-171520F repo1: 12-1, start = 000000020000000000000009, stop = 000000020000000000000009",
|
|
"P00 DETAIL: archive retention on backup 20210205-171520F_20210205-171542D repo1: 12-1, start = 00000002000000000000000D, stop = 00000002000000000000000D",
|
|
"P00 DETAIL: archive retention on backup 20210205-171520F_20210205-171546D repo1: 12-1, start = 000000020000000000000010",
|
|
"P00 DETAIL: remove archive repo1: 12-1, start = 00000002000000000000000A, stop = 00000002000000000000000C",
|
|
"P00 DETAIL: remove archive repo1: 12-1, start = 00000002000000000000000E, stop = 00000002000000000000000F",
|
|
"P00 INFO: expire command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --log-level-console=detail restore"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"demo\\/PG_VERSION - exists and matches backup|remove invalid files|rename global\\/pg_control"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 2 lines of output]",
|
|
"P00 DETAIL: check '/var/lib/postgresql/12/demo' exists",
|
|
"P00 DETAIL: remove 'global/pg_control' so cluster will not start if restore does not complete",
|
|
"P00 INFO: remove invalid files/links/paths from '/var/lib/postgresql/12/demo'",
|
|
"P00 DETAIL: remove invalid file '/var/lib/postgresql/12/demo/backup_label.old'",
|
|
"P00 DETAIL: remove invalid file '/var/lib/postgresql/12/demo/base/1/pg_internal.init'",
|
|
" [filtered 815 lines of output]",
|
|
"P01 DETAIL: restore file /var/lib/postgresql/12/demo/base/13358/PG_VERSION - exists and matches backup (3B, 99%) checksum ad552e6dc057d1d825bf49df79d6b98eba846ebe",
|
|
"P01 DETAIL: restore file /var/lib/postgresql/12/demo/base/1/PG_VERSION - exists and matches backup (3B, 99%) checksum ad552e6dc057d1d825bf49df79d6b98eba846ebe",
|
|
"P01 DETAIL: restore file /var/lib/postgresql/12/demo/PG_VERSION - exists and matches backup (3B, 100%) checksum ad552e6dc057d1d825bf49df79d6b98eba846ebe",
|
|
"P01 DETAIL: restore file /var/lib/postgresql/12/demo/global/6100 - exists and is zero size (0B, 100%)",
|
|
"P01 DETAIL: restore file /var/lib/postgresql/12/demo/global/6000 - exists and is zero size (0B, 100%)",
|
|
" [filtered 201 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create database test1;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create database test2;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create table test1_table (id int); \\",
|
|
" insert into test1_table (id) values (1);\" test1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"INSERT 0 1"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create table test2_table (id int); \\",
|
|
" insert into test2_table (id) values (2);\" test2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"INSERT 0 1"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -Atc \"select oid from pg_database where datname = 'test1'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres du -sh /var/lib/postgresql/12/demo/base/24576"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"7.8M\t/var/lib/postgresql/12/demo/base/24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-171520F_20210205-171554I"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --set=20210205-171520F_20210205-171554I info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"database list"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 11 lines of output]",
|
|
" repo1: backup set size: 4.7MB, backup size: 1.9MB",
|
|
" backup reference list: 20210205-171520F, 20210205-171520F_20210205-171546D",
|
|
" database list: postgres (13359), test1 (24576), test2 (24577)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --db-include=test2 restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from test2_table;\" test2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" id ",
|
|
"----",
|
|
" 2",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from test1_table;\" test1"
|
|
],
|
|
"err-expect" : "2",
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"relation mapping file.*contains invalid data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"psql: error: FATAL: relation mapping file \"base/24576/pg_filenode.map\" contains invalid data"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres du -sh /var/lib/postgresql/12/demo/base/24576"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"176K\t/var/lib/postgresql/12/demo/base/24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"drop database test1;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"DROP DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select oid, datname from pg_database order by oid;\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"test2"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" oid | datname ",
|
|
"-------+-----------",
|
|
" 1 | template1",
|
|
" 13358 | template0",
|
|
" 13359 | postgres",
|
|
" 24577 | test2",
|
|
"(4 rows)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" create table important_table (message text); \\",
|
|
" insert into important_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -Atc \"select current_timestamp\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"2021-02-05 17:16:20.152859+00"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" drop table important_table; \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: ...le important_table; commit; select * from important_...",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --type=time \"--target=2021-02-05 17:16:20.152859+00\" \\",
|
|
" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/postgresql/12/demo/postgresql.auto.conf"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery_target_time"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 12 lines of output]",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:16:22",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"recovery_target_time = '2021-02-05 17:16:20.152859+00'",
|
|
"recovery_target_action = 'promote'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery stopping before|last completed transaction|starting point-in-time recovery"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 3 lines of output]",
|
|
"LOG: listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"",
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 17:16:13 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 17:16:20.152859+00",
|
|
"LOG: restored log file \"00000004.history\" from archive",
|
|
"LOG: restored log file \"000000040000000000000015\" from archive",
|
|
" [filtered 2 lines of output]",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: restored log file \"000000040000000000000016\" from archive",
|
|
"LOG: recovery stopping before commit of transaction 495, time 2021-02-05 17:16:21.44252+00",
|
|
"LOG: redo done at 0/16019DD8",
|
|
"LOG: last completed transaction was at log time 2021-02-05 17:16:18.87819+00",
|
|
"LOG: selected new timeline ID: 5",
|
|
"LOG: archive recovery complete",
|
|
"LOG: database system is ready to accept connections"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" drop table important_table; \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: ...le important_table; commit; select * from important_...",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-171520F_20210205-171628I"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"20210205-171520F_20210205-171628I"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: aes-256-cbc",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (12): 000000020000000000000008/000000050000000000000017",
|
|
"",
|
|
" full backup: 20210205-171508F",
|
|
" timestamp start/stop: 2021-02-05 17:15:08 / 2021-02-05 17:15:19",
|
|
" wal start/stop: 000000020000000000000008 / 000000020000000000000008",
|
|
" database size: 23.4MB, database backup size: 23.4MB",
|
|
" repo1: backup set size: 2.8MB, backup size: 2.8MB",
|
|
"",
|
|
" full backup: 20210205-171520F",
|
|
" timestamp start/stop: 2021-02-05 17:15:20 / 2021-02-05 17:15:34",
|
|
" wal start/stop: 000000020000000000000009 / 000000020000000000000009",
|
|
" database size: 23.4MB, database backup size: 23.4MB",
|
|
" repo1: backup set size: 2.8MB, backup size: 2.8MB",
|
|
"",
|
|
" diff backup: 20210205-171520F_20210205-171546D",
|
|
" timestamp start/stop: 2021-02-05 17:15:46 / 2021-02-05 17:15:47",
|
|
" wal start/stop: 000000020000000000000010 / 000000020000000000000010",
|
|
" database size: 23.4MB, database backup size: 8.3KB",
|
|
" repo1: backup set size: 2.8MB, backup size: 512B",
|
|
" backup reference list: 20210205-171520F",
|
|
"",
|
|
" incr backup: 20210205-171520F_20210205-171554I",
|
|
" timestamp start/stop: 2021-02-05 17:15:54 / 2021-02-05 17:16:03",
|
|
" wal start/stop: 000000030000000000000012 / 000000030000000000000012",
|
|
" database size: 38.6MB, database backup size: 15.8MB",
|
|
" repo1: backup set size: 4.7MB, backup size: 1.9MB",
|
|
" backup reference list: 20210205-171520F, 20210205-171520F_20210205-171546D",
|
|
"",
|
|
" diff backup: 20210205-171520F_20210205-171612D",
|
|
" timestamp start/stop: 2021-02-05 17:16:12 / 2021-02-05 17:16:18",
|
|
" wal start/stop: 000000040000000000000015 / 000000040000000000000015",
|
|
" database size: 31MB, database backup size: 8.2MB",
|
|
" repo1: backup set size: 3.8MB, backup size: 1007.8KB",
|
|
" backup reference list: 20210205-171520F",
|
|
"",
|
|
" incr backup: 20210205-171520F_20210205-171628I",
|
|
" timestamp start/stop: 2021-02-05 17:16:28 / 2021-02-05 17:16:30",
|
|
" wal start/stop: 000000050000000000000017 / 000000050000000000000017",
|
|
" database size: 31MB, database backup size: 2.2MB",
|
|
" repo1: backup set size: 3.8MB, backup size: 234.0KB",
|
|
" backup reference list: 20210205-171520F, 20210205-171520F_20210205-171612D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --set=20210205-171520F_20210205-171628I \\",
|
|
" --type=time \"--target=2021-02-05 17:16:20.152859+00\" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: select * from important_table",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"starting point-in-time recovery|consistent recovery state reached"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 3 lines of output]",
|
|
"LOG: listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"",
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 17:16:29 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 17:16:20.152859+00",
|
|
"LOG: restored log file \"00000005.history\" from archive",
|
|
"LOG: restored log file \"000000050000000000000017\" from archive",
|
|
"LOG: redo starts at 0/17000028",
|
|
"LOG: consistent recovery state reached at 0/17000100",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: redo done at 0/17000100",
|
|
" [filtered 7 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --type=time \"--target=2021-02-05 17:16:20.152859+00\" \\",
|
|
" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery stopping before|last completed transaction|starting point-in-time recovery"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 6 lines of output]",
|
|
"LOG: restored log file \"00000005.history\" from archive",
|
|
"LOG: restored log file \"00000006.history\" from archive",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 17:16:20.152859+00",
|
|
"LOG: restored log file \"00000006.history\" from archive",
|
|
"LOG: restored log file \"000000040000000000000015\" from archive",
|
|
" [filtered 4 lines of output]",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: restored log file \"000000050000000000000016\" from archive",
|
|
"LOG: recovery stopping before commit of transaction 496, time 2021-02-05 17:16:28.190209+00",
|
|
"LOG: redo done at 0/16022408",
|
|
"LOG: last completed transaction was at log time 2021-02-05 17:16:18.87819+00",
|
|
"LOG: selected new timeline ID: 7",
|
|
"LOG: archive recovery complete",
|
|
"LOG: database system is ready to accept connections"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "4"
|
|
},
|
|
"repo1-azure-account" : {
|
|
"value" : "pgbackrest"
|
|
},
|
|
"repo1-azure-container" : {
|
|
"value" : "demo-container"
|
|
},
|
|
"repo1-azure-host" : {
|
|
"value" : "blob.core.windows.net"
|
|
},
|
|
"repo1-azure-key" : {
|
|
"value" : "YXpLZXk="
|
|
},
|
|
"repo1-path" : {
|
|
"value" : "/demo-repo"
|
|
},
|
|
"repo1-type" : {
|
|
"value" : "azure"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"process-max=4",
|
|
"repo1-azure-account=pgbackrest",
|
|
"repo1-azure-container=demo-container",
|
|
"repo1-azure-key=YXpLZXk=",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/demo-repo",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"repo1-type=azure",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"echo \"172.17.0.2 blob.core.windows.net\" | tee -a /etc/hosts"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-create"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=1765-42426369 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-azure-account=<redacted> --repo1-azure-container=demo-container --repo1-azure-host=blob.core.windows.net --repo1-azure-key=<redacted> --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-type=azure --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1773-24ec0360 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --process-max=4 --repo1-azure-account=<redacted> --repo1-azure-container=demo-container --repo1-azure-host=blob.core.windows.net --repo1-azure-key=<redacted> --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-type=azure --stanza=demo --start-fast",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000070000000000000017, lsn = 0/17000028",
|
|
" [filtered 1279 lines of output]",
|
|
"P03 INFO: backup file /var/lib/postgresql/12/demo/base/1/13206 (0B, 100%)",
|
|
"P02 INFO: backup file /var/lib/postgresql/12/demo/base/1/13196 (0B, 100%)",
|
|
"P00 INFO: full backup size = 31MB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000070000000000000017, lsn = 0/17000100",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "4"
|
|
},
|
|
"repo1-path" : {
|
|
"value" : "/demo-repo"
|
|
},
|
|
"repo1-s3-bucket" : {
|
|
"value" : "demo-bucket"
|
|
},
|
|
"repo1-s3-endpoint" : {
|
|
"value" : "s3.us-east-1.amazonaws.com"
|
|
},
|
|
"repo1-s3-key" : {
|
|
"value" : "accessKey1"
|
|
},
|
|
"repo1-s3-key-secret" : {
|
|
"value" : "verySecretKey1"
|
|
},
|
|
"repo1-s3-region" : {
|
|
"value" : "us-east-1"
|
|
},
|
|
"repo1-type" : {
|
|
"value" : "s3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"process-max=4",
|
|
"repo1-azure-account=pgbackrest",
|
|
"repo1-azure-container=demo-container",
|
|
"repo1-azure-key=YXpLZXk=",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/demo-repo",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"repo1-s3-bucket=demo-bucket",
|
|
"repo1-s3-endpoint=s3.us-east-1.amazonaws.com",
|
|
"repo1-s3-key=accessKey1",
|
|
"repo1-s3-key-secret=verySecretKey1",
|
|
"repo1-s3-region=us-east-1",
|
|
"repo1-type=s3",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"echo \"172.17.0.3 demo-bucket.s3.us-east-1.amazonaws.com s3.us-east-1.amazonaws.com\" | tee -a /etc/hosts"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-create"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=1825-0fd99e76 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1835-4cbcabb1 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --process-max=4 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo --start-fast",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000070000000000000019, lsn = 0/19000028",
|
|
" [filtered 1279 lines of output]",
|
|
"P04 INFO: backup file /var/lib/postgresql/12/demo/base/1/13201 (0B, 100%)",
|
|
"P01 INFO: backup file /var/lib/postgresql/12/demo/base/1/13196 (0B, 100%)",
|
|
"P00 INFO: full backup size = 31MB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000070000000000000019, lsn = 0/19000100",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stop"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stop command begin 2.32: --exec-id=1865-84530d5c --log-level-console=info --log-level-stderr=off --no-log-timestamp --stanza=demo",
|
|
"P00 INFO: stop command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-delete"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-delete command begin 2.32: --exec-id=1872-7e7fb0e7 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo",
|
|
"P00 INFO: stanza-delete command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "repo1",
|
|
"image" : "pgbackrest/doc:debian",
|
|
"name" : "repository",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "debian",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.6"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo adduser --disabled-password --gecos \"\" pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get install postgresql-client libxml2"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /var/log/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 750 /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest mkdir -m 750 /home/pgbackrest/.ssh"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh-keygen -f /home/pgbackrest/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -m 750 -p /var/lib/postgresql/.ssh"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh-keygen -f /var/lib/postgresql/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@pg-primary cat /var/lib/postgresql/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u pgbackrest tee -a /home/pgbackrest/.ssh/authorized_keys"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@repository cat /home/pgbackrest/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u postgres tee -a /var/lib/postgresql/.ssh/authorized_keys"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh postgres@pg-primary"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh pgbackrest@repository"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-path" : {
|
|
"value" : "/var/lib/pgbackrest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-host" : {
|
|
"value" : "pg-primary"
|
|
},
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/postgresql/12/demo"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
},
|
|
"start-fast" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/postgresql/12/demo"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-file" : {
|
|
"value" : "detail"
|
|
},
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-host" : {
|
|
"value" : "repository"
|
|
}
|
|
}
|
|
},
|
|
"reset" : true
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo stanza-create"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"timestamp start/stop"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: none",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (12): 00000008000000000000001E/00000008000000000000001F",
|
|
"",
|
|
" full backup: 20210205-171746F",
|
|
" timestamp start/stop: 2021-02-05 17:17:46 / 2021-02-05 17:18:03",
|
|
" wal start/stop: 00000008000000000000001E / 00000008000000000000001E",
|
|
" database size: 31MB, database backup size: 31MB",
|
|
" repo1: backup set size: 3.7MB, backup size: 3.7MB",
|
|
"",
|
|
" full backup: 20210205-171805F",
|
|
" timestamp start/stop: 2021-02-05 17:18:05 / 2021-02-05 17:18:13",
|
|
" wal start/stop: 00000008000000000000001F / 00000008000000000000001F",
|
|
" database size: 31MB, database backup size: 31MB",
|
|
" repo1: backup set size: 3.7MB, backup size: 3.7MB"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"err-expect" : "56",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"\\: stop file exists for all stanzas"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-1: [StopError] raised from remote-0 protocol on 'pg-primary': stop file exists for all stanzas",
|
|
"P00 ERROR: [056]: unable to find primary cluster - cannot proceed"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: stop file already exists for all stanzas"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"err-expect" : "56",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"\\: stop file exists for stanza demo"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-1: [StopError] raised from remote-0 protocol on 'pg-primary': stop file exists for stanza demo",
|
|
"P00 ERROR: [056]: unable to find primary cluster - cannot proceed"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "pg2",
|
|
"image" : "pgbackrest/doc:debian",
|
|
"name" : "pg-standby",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "debian",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.7"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo apt-get install postgresql-client libxml2"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -m 750 -p /var/lib/postgresql/.ssh"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh-keygen -f /var/lib/postgresql/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@pg-standby cat /var/lib/postgresql/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u pgbackrest tee -a /home/pgbackrest/.ssh/authorized_keys"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@repository cat /home/pgbackrest/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u postgres tee -a /var/lib/postgresql/.ssh/authorized_keys"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh postgres@pg-standby"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh pgbackrest@repository"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/postgresql/12/demo"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-file" : {
|
|
"value" : "detail"
|
|
},
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-host" : {
|
|
"value" : "repository"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_createcluster 12 demo"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/postgresql/12/demo/postgresql.auto.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Do not edit this file manually!",
|
|
"# It will be overwritten by the ALTER SYSTEM command.",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:14:53",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:15:48",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:16:06",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:16:37",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"# Removed by pgBackRest restore on 2021-02-05 17:17:39 # recovery_target_time = '2021-02-05 17:16:20.152859+00'",
|
|
"# Removed by pgBackRest restore on 2021-02-05 17:17:39 # recovery_target_action = 'promote'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:17:39",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:18:33",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/postgresql/12/demo/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
},
|
|
"log_filename" : {
|
|
"value" : "'postgresql.log'"
|
|
},
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "replica"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"hot_standby = on",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = replica"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"entering standby mode|database system is ready to accept read only connections"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 4 lines of output]",
|
|
"LOG: listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"",
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 17:18:06 UTC",
|
|
"LOG: entering standby mode",
|
|
"LOG: restored log file \"00000008.history\" from archive",
|
|
"LOG: restored log file \"00000008000000000000001F\" from archive",
|
|
"LOG: redo starts at 0/1F000028",
|
|
"LOG: consistent recovery state reached at 0/1F000138",
|
|
"LOG: database system is ready to accept read only connections"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" begin; \\",
|
|
" create table replicated_table (message text); \\",
|
|
" insert into replicated_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select * from replicated_table\";"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from replicated_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"replicated_table\" does not exist",
|
|
"LINE 1: select * from replicated_table;",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select *, current_timestamp from pg_switch_wal()\";"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" pg_switch_wal | current_timestamp ",
|
|
"---------------+-------------------------------",
|
|
" 0/20021718 | 2021-02-05 17:18:40.930351+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select *, current_timestamp from replicated_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | current_timestamp ",
|
|
"----------------+-------------------------------",
|
|
" Important Data | 2021-02-05 17:18:41.969154+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"because this is a standby"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=496-9110d5fe --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-host=repository --stanza=demo",
|
|
"P00 INFO: check repo1 (standby)",
|
|
"P00 INFO: switch wal not performed because this is a standby",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" create user replicator password 'jw8s0F4' replication\";"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'echo \\",
|
|
" \"host replication replicator 172.17.0.7/32 md5\" \\",
|
|
" >> /etc/postgresql/12/demo/pg_hba.conf'"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo reload"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"recovery-option" : {
|
|
"value" : "primary_conninfo=host=172.17.0.5 port=5432 user=replicator"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'echo \\",
|
|
" \"172.17.0.5:*:replication:replicator:jw8s0F4\" \\",
|
|
" >> /var/lib/postgresql/.pgpass'"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres chmod 600 /var/lib/postgresql/.pgpass"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/postgresql/12/demo/postgresql.auto.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Do not edit this file manually!",
|
|
"# It will be overwritten by the ALTER SYSTEM command.",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:14:53",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:15:48",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:16:06",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:16:37",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"# Removed by pgBackRest restore on 2021-02-05 17:17:39 # recovery_target_time = '2021-02-05 17:16:20.152859+00'",
|
|
"# Removed by pgBackRest restore on 2021-02-05 17:17:39 # recovery_target_action = 'promote'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:17:39",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"",
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:18:46",
|
|
"primary_conninfo = 'host=172.17.0.5 port=5432 user=replicator'",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo start"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/postgresql/postgresql-12-demo.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"started streaming WAL from primary"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 11 lines of output]",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: restored log file \"000000080000000000000020\" from archive",
|
|
"LOG: started streaming WAL from primary at 0/21000000 on timeline 8"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" begin; \\",
|
|
" create table stream_table (message text); \\",
|
|
" insert into stream_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select *, current_timestamp from stream_table\";"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | current_timestamp ",
|
|
"----------------+-------------------------------",
|
|
" Important Data | 2021-02-05 17:18:52.125935+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select *, current_timestamp from stream_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | current_timestamp ",
|
|
"----------------+-------------------------------",
|
|
" Important Data | 2021-02-05 17:18:52.361098+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 750 /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 750 /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"archive-async" : {
|
|
"value" : "y"
|
|
},
|
|
"spool-path" : {
|
|
"value" : "/var/spool/pgbackrest"
|
|
}
|
|
},
|
|
"global:archive-get" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
},
|
|
"global:archive-push" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"global" : {
|
|
"archive-async" : {
|
|
"value" : "y"
|
|
},
|
|
"spool-path" : {
|
|
"value" : "/var/spool/pgbackrest"
|
|
}
|
|
},
|
|
"global:archive-get" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
},
|
|
"global:archive-push" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"alter user replicator password 'bogus'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ALTER ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo restart"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres rm -f /var/log/pgbackrest/demo-archive-push-async.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal();\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"WAL segment"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=2483-f3b57658 --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --repo1-host=repository --stanza=demo",
|
|
"P00 INFO: check repo1 configuration (primary)",
|
|
"P00 INFO: check repo1 archive for WAL (primary)",
|
|
"P00 INFO: WAL segment 000000080000000000000026 successfully archived to '/var/lib/pgbackrest/archive/demo/12-1/0000000800000000/000000080000000000000026-a925d703a5aa8bb86809e231a7c41874b65a36c0.gz' on repo1",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/pgbackrest/demo-archive-push-async.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
" WAL file\\(s\\) to archive|pushed WAL file \\'0000000"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/postgresql/12/demo/pg_wal] --archive-async --exec-id=2469-ee6069d3 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000021",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000021' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully",
|
|
"",
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/postgresql/12/demo/pg_wal] --archive-async --exec-id=2486-e9aac745 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 4 WAL file(s) to archive: 000000080000000000000022...000000080000000000000025",
|
|
"P02 DETAIL: pushed WAL file '000000080000000000000023' to the archive",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000022' to the archive",
|
|
"P02 DETAIL: pushed WAL file '000000080000000000000024' to the archive",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000025' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully",
|
|
"",
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/postgresql/12/demo/pg_wal] --archive-async --exec-id=2503-0a946e23 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000026",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000026' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 5"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/pgbackrest/demo-archive-get-async.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"found [0-F]{24} in the .* archive"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-get:async command begin 2.32: [00000008000000000000001F, 000000080000000000000020, 000000080000000000000021, 000000080000000000000022, 000000080000000000000023, 000000080000000000000024, 000000080000000000000025, 000000080000000000000026] --archive-async --exec-id=701-1e1b2d49 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: get 8 WAL file(s) from archive: 00000008000000000000001F...000000080000000000000026",
|
|
"P01 DETAIL: found 00000008000000000000001F in the repo1:12-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000020 in the repo1:12-1 archive",
|
|
"P00 DETAIL: unable to find 000000080000000000000021 in the archive",
|
|
"P00 INFO: archive-get:async command end: completed successfully",
|
|
" [filtered 8 lines of output]",
|
|
"P00 INFO: archive-get:async command begin 2.32: [000000080000000000000021, 000000080000000000000022, 000000080000000000000023, 000000080000000000000024, 000000080000000000000025, 000000080000000000000026, 000000080000000000000027, 000000080000000000000028] --archive-async --exec-id=748-be9f5d6c --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/12/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000021...000000080000000000000028",
|
|
"P01 DETAIL: found 000000080000000000000021 in the repo1:12-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000022 in the repo1:12-1 archive",
|
|
"P01 DETAIL: found 000000080000000000000023 in the repo1:12-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000024 in the repo1:12-1 archive",
|
|
"P01 DETAIL: found 000000080000000000000025 in the repo1:12-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000026 in the repo1:12-1 archive",
|
|
"P00 DETAIL: unable to find 000000080000000000000027 in the archive",
|
|
"P00 INFO: archive-get:async command end: completed successfully",
|
|
" [filtered 3 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"alter user replicator password 'jw8s0F4'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ALTER ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg2-host" : {
|
|
"value" : "pg-standby"
|
|
},
|
|
"pg2-path" : {
|
|
"value" : "/var/lib/postgresql/12/demo"
|
|
}
|
|
},
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/postgresql/12/demo",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/postgresql/12/demo",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=y",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --log-level-console=detail backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup file pg-primary|replay on the standby"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 2 lines of output]",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000080000000000000028, lsn = 0/28000028",
|
|
"P00 INFO: wait for replay on the standby to reach 0/28000028",
|
|
"P00 INFO: replay on the standby reached 0/28000028",
|
|
"P01 INFO: backup file pg-primary:/var/lib/postgresql/12/demo/global/pg_control (8KB, 0%) checksum 10383dbdabdd178833336b87a16b26b1550d2235",
|
|
"P03 INFO: backup file pg-standby:/var/lib/postgresql/12/demo/base/13359/1249 (440KB, 19%) checksum 1eee8a7be87885d4d28dd4e129f905af408434a9",
|
|
"P04 INFO: backup file pg-standby:/var/lib/postgresql/12/demo/base/13359/2674 (344KB, 33%) checksum 526d061f2e177d09ab5e82fe1053e996dc9e8af5",
|
|
"P01 INFO: backup file pg-primary:/var/lib/postgresql/12/demo/pg_logical/replorigin_checkpoint (8B, 33%) checksum 347fc8f2df71bd4436e38bd1516ccd7ea0d46532",
|
|
"P02 INFO: backup file pg-standby:/var/lib/postgresql/12/demo/base/13359/2608 (456KB, 53%) checksum 8da8302ffa4389867b7b3bc25f2c5044978f6d97",
|
|
"P02 INFO: backup file pg-standby:/var/lib/postgresql/12/demo/base/13359/1259 (104KB, 57%) checksum 45d387254470b30f1f4e91bc778603dc837b91f2",
|
|
" [filtered 1291 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 12 demo stop"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres /usr/lib/postgresql/13/bin/initdb \\",
|
|
" -D /var/lib/postgresql/13/demo -k -A peer"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_createcluster 13 demo"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'cd /var/lib/postgresql && \\",
|
|
" /usr/lib/postgresql/13/bin/pg_upgrade \\",
|
|
" --old-bindir=/usr/lib/postgresql/12/bin \\",
|
|
" --new-bindir=/usr/lib/postgresql/13/bin \\",
|
|
" --old-datadir=/var/lib/postgresql/12/demo \\",
|
|
" --new-datadir=/var/lib/postgresql/13/demo \\",
|
|
" --old-options=\" -c config_file=/etc/postgresql/12/demo/postgresql.conf\" \\",
|
|
" --new-options=\" -c config_file=/etc/postgresql/13/demo/postgresql.conf\"'"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Upgrade Complete"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 63 lines of output]",
|
|
"Creating script to delete old cluster ok",
|
|
"",
|
|
"Upgrade Complete",
|
|
"----------------",
|
|
"Optimizer statistics are not transferred by pg_upgrade so,",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/postgresql/13/demo/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"listen_addresses" : {
|
|
"value" : "'*'"
|
|
},
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"port" : {
|
|
"value" : "5432"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "replica"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"listen_addresses = '*'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"port = 5432",
|
|
"wal_level = replica"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/postgresql/13/demo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/13/demo",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/postgresql/13/demo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/postgresql/13/demo",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/postgresql/13/demo"
|
|
},
|
|
"pg2-path" : {
|
|
"value" : "/var/lib/postgresql/13/demo"
|
|
}
|
|
},
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "n"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/postgresql/13/demo",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/postgresql/13/demo",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=n",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo cp /etc/postgresql/12/demo/pg_hba.conf \\",
|
|
" /etc/postgresql/13/demo/pg_hba.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --no-online \\",
|
|
" --log-level-console=info stanza-upgrade"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-upgrade command begin 2.32: --no-backup-standby --exec-id=1379-0c06aa19 --log-level-console=info --log-level-stderr=off --no-log-timestamp --no-online --pg1-host=pg-primary --pg2-host=pg-standby --pg1-path=/var/lib/postgresql/13/demo --pg2-path=/var/lib/postgresql/13/demo --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: stanza-upgrade for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-upgrade command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 13 demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pg_lsclusters"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"Ver Cluster Port Status Owner Data directory Log file",
|
|
"12 demo 5432 down postgres /var/lib/postgresql/12/demo /var/log/postgresql/postgresql-12-demo.log",
|
|
"13 demo 5432 online postgres /var/lib/postgresql/13/demo /var/log/postgresql/postgresql-13-demo.log"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_dropcluster 12 demo"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_dropcluster 12 demo"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_createcluster 13 demo"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-2: [DbConnectError] raised from remote-0 protocol on 'pg-standby': unable to connect to 'dbname='postgres' port=5432': could not connect to server: No such file or directory",
|
|
" \tIs the server running locally and accepting",
|
|
" \tconnections on Unix domain socket \"/var/run/postgresql/.s.PGSQL.5432\"?"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/postgresql/13/demo/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"hot_standby = on"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo pg_ctlcluster 13 demo start"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/postgresql/13/demo",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/postgresql/13/demo",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=y",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"{\"os-type\":\"centos7\"}" : {
|
|
"all" : {
|
|
"user-guide" : [
|
|
{
|
|
"key" : {
|
|
"id" : "azure",
|
|
"image" : "mcr.microsoft.com/azure-storage/azurite",
|
|
"name" : "azure-server",
|
|
"option" : "-v {[host-repo-path]}/doc/resource/fake-cert/azure-server.crt:/root/public.crt:ro -v {[host-repo-path]}/doc/resource/fake-cert/azure-server.key:/root/private.key:ro -e AZURITE_ACCOUNTS='pgbackrest:YXpLZXk='",
|
|
"os" : "centos7",
|
|
"param" : "azurite-blob --blobPort 443 --blobHost 0.0.0.0 --cert=/root/public.crt --key=/root/private.key",
|
|
"update-hosts" : false
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.2"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "s3",
|
|
"image" : "minio/minio",
|
|
"name" : "s3-server",
|
|
"option" : "-v {[host-repo-path]}/doc/resource/fake-cert/s3-server.crt:/root/.minio/certs/public.crt:ro -v {[host-repo-path]}/doc/resource/fake-cert/s3-server.key:/root/.minio/certs/private.key:ro -e MINIO_REGION=us-east-1 -e MINIO_DOMAIN=s3.us-east-1.amazonaws.com -e MINIO_BROWSER=off -e MINIO_ACCESS_KEY=accessKey1 -e MINIO_SECRET_KEY=verySecretKey1",
|
|
"os" : "centos7",
|
|
"param" : "server /data --address :443",
|
|
"update-hosts" : false
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.3"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "build",
|
|
"image" : "pgbackrest/doc:centos7",
|
|
"name" : "build",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos7",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.4"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo cp -r /pgbackrest/src /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown -R vagrant /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install make gcc postgresql95-devel \\",
|
|
" openssl-devel libxml2-devel lz4-devel libzstd-devel bzip2-devel"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"cd /build/pgbackrest-release-2.32/src && ./configure && make"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "pg1",
|
|
"image" : "pgbackrest/doc:centos7",
|
|
"name" : "pg-primary",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos7",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.5"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install postgresql-libs"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"pgBackRest 2.32 - General help",
|
|
"",
|
|
"Usage:",
|
|
" pgbackrest [options] [command]",
|
|
"",
|
|
"Commands:",
|
|
" archive-get Get a WAL segment from the archive.",
|
|
" archive-push Push a WAL segment to the archive.",
|
|
" backup Backup a database cluster.",
|
|
" check Check the configuration.",
|
|
" expire Expire backups that exceed retention.",
|
|
" help Get help.",
|
|
" info Retrieve information about backups.",
|
|
" repo-get Get files from a repository.",
|
|
" repo-ls List files in a repository.",
|
|
" restore Restore a database cluster.",
|
|
" stanza-create Create the required stanza data.",
|
|
" stanza-delete Delete a stanza.",
|
|
" stanza-upgrade Upgrade a stanza.",
|
|
" start Allow pgBackRest processes to run.",
|
|
" stop Stop pgBackRest processes from running.",
|
|
" version Get version.",
|
|
"",
|
|
"Use 'pgbackrest help [command]' for more information."
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres /usr/pgsql-9.5/bin/initdb \\",
|
|
" -D /var/lib/pgsql/9.5/data -k -A peer"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.5/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"listen_addresses" : {
|
|
"value" : "'*'"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.5/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'",
|
|
"log_line_prefix = ''"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.5/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"log_filename" : {
|
|
"value" : "'postgresql.log'"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/9.5/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres bash -c ' \\",
|
|
" export PGBACKREST_LOG_PATH=/path/set/by/env && \\",
|
|
" pgbackrest --log-level-console=error help backup log-path'"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"current\\: \\/path\\/set\\/by\\/env"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"pgBackRest 2.32 - 'backup' command - 'log-path' option help",
|
|
"",
|
|
"Path where log files are stored.",
|
|
"",
|
|
"The log path provides a location for pgBackRest to store log files. Note that",
|
|
"if log-level-file=off then no log path is required.",
|
|
"",
|
|
"current: /path/set/by/env",
|
|
"default: /var/log/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 750 /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-path" : {
|
|
"value" : "/var/lib/pgbackrest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.5/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "hot_standby"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"listen_addresses = '*'",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = hot_standby"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl restart postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global:archive-push" : {
|
|
"compress-level" : {
|
|
"value" : "3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-cipher-pass" : {
|
|
"value" : "zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO"
|
|
},
|
|
"repo1-cipher-type" : {
|
|
"value" : "aes-256-cbc"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=743-bc7fa832 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
" successfully archived to "
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=764-6ed77530 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: check repo1 configuration (primary)",
|
|
"P00 INFO: check repo1 archive for WAL (primary)",
|
|
"P00 INFO: WAL segment 000000010000000000000001 successfully archived to '/var/lib/pgbackrest/archive/demo/9.5-1/0000000100000000/000000010000000000000001-c0dcb04e63f58f75fa5ad7f3f88ffb653813368c.gz' on repo1",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=786-851c4b14 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the next regular checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000010000000000000002, lsn = 0/2000028",
|
|
" [filtered 851 lines of output]",
|
|
"P01 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12280 (0B, 100%)",
|
|
"P01 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12275 (0B, 100%)",
|
|
"P00 INFO: full backup size = 20.6MB",
|
|
"P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000010000000000000002, lsn = 0/2000130",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-165431F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"diff backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 4 lines of output]",
|
|
"P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 97%) checksum 202393655c0d7cf1f28a670540bba606c9ad625b",
|
|
"P01 INFO: backup file /var/lib/pgsql/9.5/data/backup_label (246B, 100%) checksum 46073d1502361a4544ec23bdf6894bbabbd65e08",
|
|
"P00 INFO: diff backup size = 8.2KB",
|
|
"P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000010000000000000003, lsn = 0/30000F8",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"(full|incr|diff) backup"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: aes-256-cbc",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (9.5): 000000010000000000000001/000000010000000000000003",
|
|
"",
|
|
" full backup: 20210205-165431F",
|
|
" timestamp start/stop: 2021-02-05 16:54:31 / 2021-02-05 16:54:44",
|
|
" wal start/stop: 000000010000000000000002 / 000000010000000000000002",
|
|
" database size: 20.6MB, database backup size: 20.6MB",
|
|
" repo1: backup set size: 2.4MB, backup size: 2.4MB",
|
|
"",
|
|
" diff backup: 20210205-165431F_20210205-165446D",
|
|
" timestamp start/stop: 2021-02-05 16:54:46 / 2021-02-05 16:54:48",
|
|
" wal start/stop: 000000010000000000000003 / 000000010000000000000003",
|
|
" database size: 20.6MB, database backup size: 8.2KB",
|
|
" repo1: backup set size: 2.4MB, backup size: 400B",
|
|
" backup reference list: 20210205-165431F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres rm /var/lib/pgsql/9.5/data/global/pg_control"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"err-expect" : "1",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl status postgresql-9.5.service"
|
|
],
|
|
"err-expect" : "3",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Failed to start PostgreSQL"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 10 lines of output]",
|
|
"Feb 05 16:54:50 pg-primary pg_ctl[922]: but could not open file \"/var/lib/pgsql/9.5/data/global/pg_control\": No such file or directory",
|
|
"Feb 05 16:54:51 pg-primary systemd[1]: postgresql-9.5.service: control process exited, code=exited status=1",
|
|
"Feb 05 16:54:51 pg-primary systemd[1]: Failed to start PostgreSQL 9.5 database server.",
|
|
"Feb 05 16:54:51 pg-primary systemd[1]: Unit postgresql-9.5.service entered failed state.",
|
|
"Feb 05 16:54:51 pg-primary systemd[1]: postgresql-9.5.service failed."
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres find /var/lib/pgsql/9.5/data -mindepth 1 -delete"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup begins after the next regular checkpoint completes"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1067-000b81c7 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --type=incr",
|
|
"P00 INFO: last backup label = 20210205-165431F_20210205-165446D, version = 2.32",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the next regular checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000020000000000000005, lsn = 0/5000028",
|
|
"P00 WARN: a timeline switch has occurred since the 20210205-165431F_20210205-165446D backup, enabling delta checksum",
|
|
" [filtered 11 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"start-fast" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup begins after the requested immediate checkpoint completes"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1124-6f38c8a8 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr",
|
|
"P00 INFO: last backup label = 20210205-165431F_20210205-165507I, version = 2.32",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000020000000000000006, lsn = 0/6000028",
|
|
"P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 97%) checksum 57a7d94955d83e1ac4d22d546244c7dae3a24bd0",
|
|
" [filtered 8 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 550 /var/lib/pgbackrest/backup/demo/"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"err-expect" : "47",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"ERROR:"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 2 lines of output]",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000020000000000000007, lsn = 0/7000028",
|
|
"P00 ERROR: [047]: unable to create path '/var/lib/pgbackrest/backup/demo/20210205-165431F_20210205-165515I': [13] Permission denied",
|
|
"P00 INFO: backup command end: aborted with exception [047]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 750 /var/lib/pgbackrest/backup/demo/"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"err-expect" : "57",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"ERROR:"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1206-0b7dc21e --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr",
|
|
"P00 INFO: last backup label = 20210205-165431F_20210205-165511I, version = 2.32",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 ERROR: [057]: unable to execute query 'select lsn::text as lsn,",
|
|
" pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name",
|
|
" from pg_catalog.pg_start_backup('pgBackRest backup started at ' || current_timestamp, true) as lsn': ERROR: a backup is already in progress",
|
|
" HINT: Run pg_stop_backup() and try again.",
|
|
"P00 INFO: backup command end: aborted with exception [057]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"stop-auto" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"stop-auto=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"cluster is already in backup mode|backup begins after the requested immediate checkpoint completes"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1254-92da5e6c --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --stop-auto --type=incr",
|
|
"P00 INFO: last backup label = 20210205-165431F_20210205-165511I, version = 2.32",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 WARN: the cluster is already in backup mode but no pgBackRest backup process is running. pg_stop_backup() will be called so a new backup can be started.",
|
|
"P00 INFO: backup start archive = 000000020000000000000008, lsn = 0/8000028",
|
|
"P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 84%) checksum c9f47622dfa373afc9146b91294a3466a36f9bd9",
|
|
" [filtered 9 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -p /var/lib/pgsql/pgbackrest/doc/example"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cp -r /pgbackrest/doc/example/* \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-info.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-- An example of monitoring pgBackRest from within PostgreSQL",
|
|
"--",
|
|
"-- Use copy to export data from the pgBackRest info command into the jsonb",
|
|
"-- type so it can be queried directly by PostgreSQL.",
|
|
"",
|
|
"-- Create monitor schema",
|
|
"create schema monitor;",
|
|
"",
|
|
"-- Get pgBackRest info in JSON format",
|
|
"create function monitor.pgbackrest_info()",
|
|
" returns jsonb AS $$",
|
|
"declare",
|
|
" data jsonb;",
|
|
"begin",
|
|
" -- Create a temp table to hold the JSON data",
|
|
" create temp table temp_pgbackrest_data (data jsonb);",
|
|
"",
|
|
" -- Copy data into the table directly from the pgBackRest info command",
|
|
" copy temp_pgbackrest_data (data)",
|
|
" from program",
|
|
" 'pgbackrest --output=json info' (format text);",
|
|
"",
|
|
" select temp_pgbackrest_data.data",
|
|
" into data",
|
|
" from temp_pgbackrest_data;",
|
|
"",
|
|
" drop table temp_pgbackrest_data;",
|
|
"",
|
|
" return data;",
|
|
"end $$ language plpgsql;"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -f \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-info.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-query.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-- Get last successful backup for each stanza",
|
|
"--",
|
|
"-- Requires the monitor.pgbackrest_info function.",
|
|
"with stanza as",
|
|
"(",
|
|
" select data->'name' as name,",
|
|
" data->'backup'->(",
|
|
" jsonb_array_length(data->'backup') - 1) as last_backup,",
|
|
" data->'archive'->(",
|
|
" jsonb_array_length(data->'archive') - 1) as current_archive",
|
|
" from jsonb_array_elements(monitor.pgbackrest_info()) as data",
|
|
")",
|
|
"select name,",
|
|
" to_timestamp(",
|
|
" (last_backup->'timestamp'->>'stop')::numeric) as last_successful_backup,",
|
|
" current_archive->>'max' as last_archived_wal",
|
|
" from stanza;"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -f \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-query.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" name | last_successful_backup | last_archived_wal ",
|
|
"--------+------------------------+--------------------------",
|
|
" \"demo\" | 2021-02-05 16:55:23+00 | 000000020000000000000008",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"stop-auto=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=full \\",
|
|
" --log-level-console=detail backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"archive retention on backup 20210205-165431F|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 861 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=1430-76c28d3b --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 DETAIL: archive retention on backup 20210205-165431F repo1: 9.5-1, start = 000000010000000000000002",
|
|
"P00 DETAIL: remove archive repo1: 9.5-1, start = 000000010000000000000001, stop = 000000010000000000000001",
|
|
"P00 INFO: expire command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-165527F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=full \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"expire full backup set repo1\\: 20210205-165431F|archive retention on backup 20210205-165527F|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 861 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=1475-868e099d --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 INFO: expire full backup set repo1: 20210205-165431F, 20210205-165431F_20210205-165446D, 20210205-165431F_20210205-165507I, 20210205-165431F_20210205-165511I, 20210205-165431F_20210205-165519I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-165431F_20210205-165519I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-165431F_20210205-165511I",
|
|
" [filtered 3 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-diff" : {
|
|
"value" : "1"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-diff=1",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"stop-auto=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-165540F_20210205-165557D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"expire diff backup set repo1: 20210205-165540F_20210205-165557D"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 12 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=1599-d8d7300c --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=1 --repo1-retention-full=2 --stanza=demo",
|
|
"P00 INFO: expire diff backup set repo1: 20210205-165540F_20210205-165557D, 20210205-165540F_20210205-165600I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-165540F_20210205-165600I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-165540F_20210205-165557D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-diff" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"stop-auto=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-165540F_20210205-165604D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select pg_create_restore_point('generate WAL'); select pg_switch_xlog(); \\",
|
|
" select pg_create_restore_point('generate WAL'); select pg_switch_xlog();\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"new backup label"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 10 lines of output]",
|
|
"P00 INFO: backup stop archive = 000000020000000000000012, lsn = 0/120000F8",
|
|
"P00 INFO: check archive for segment(s) 000000020000000000000012:000000020000000000000012",
|
|
"P00 INFO: new backup label = 20210205-165540F_20210205-165610D",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=1699-c687092e --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-165540F_20210205-165610D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=detail \\",
|
|
" --repo1-retention-archive-type=diff --repo1-retention-archive=1 expire"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"archive retention on backup 20210205-165540F_20210205-165604D|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: expire command begin 2.32: --exec-id=1744-d0df660c --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-archive=1 --repo1-retention-archive-type=diff --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo",
|
|
"P00 DETAIL: archive retention on backup 20210205-165527F repo1: 9.5-1, start = 00000002000000000000000A, stop = 00000002000000000000000A",
|
|
"P00 DETAIL: archive retention on backup 20210205-165540F repo1: 9.5-1, start = 00000002000000000000000B, stop = 00000002000000000000000B",
|
|
"P00 DETAIL: archive retention on backup 20210205-165540F_20210205-165604D repo1: 9.5-1, start = 00000002000000000000000F, stop = 00000002000000000000000F",
|
|
"P00 DETAIL: archive retention on backup 20210205-165540F_20210205-165610D repo1: 9.5-1, start = 000000020000000000000012",
|
|
"P00 DETAIL: remove archive repo1: 9.5-1, start = 00000002000000000000000C, stop = 00000002000000000000000E",
|
|
"P00 DETAIL: remove archive repo1: 9.5-1, start = 000000020000000000000010, stop = 000000020000000000000011",
|
|
"P00 INFO: expire command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --log-level-console=detail restore"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"demo\\/PG_VERSION - exists and matches backup|remove invalid files|rename global\\/pg_control"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 2 lines of output]",
|
|
"P00 DETAIL: check '/var/lib/pgsql/9.5/data' exists",
|
|
"P00 DETAIL: remove 'global/pg_control' so cluster will not start if restore does not complete",
|
|
"P00 INFO: remove invalid files/links/paths from '/var/lib/pgsql/9.5/data'",
|
|
"P00 DETAIL: remove invalid file '/var/lib/pgsql/9.5/data/backup_label.old'",
|
|
"P00 DETAIL: remove invalid file '/var/lib/pgsql/9.5/data/base/12442/pg_internal.init'",
|
|
" [filtered 901 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create database test1;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create database test2;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create table test1_table (id int); \\",
|
|
" insert into test1_table (id) values (1);\" test1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"INSERT 0 1"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create table test2_table (id int); \\",
|
|
" insert into test2_table (id) values (2);\" test2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"INSERT 0 1"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -Atc \"select oid from pg_database where datname = 'test1'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres du -sh /var/lib/pgsql/9.5/data/base/24576"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"6.9M\t/var/lib/pgsql/9.5/data/base/24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-165540F_20210205-165620I"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --set=20210205-165540F_20210205-165620I info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"database list"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 11 lines of output]",
|
|
" repo1: backup set size: 4MB, backup size: 1.6MB",
|
|
" backup reference list: 20210205-165540F, 20210205-165540F_20210205-165610D",
|
|
" database list: postgres (12442), test1 (24576), test2 (24577)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --db-include=test2 restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from test2_table;\" test2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" id ",
|
|
"----",
|
|
" 2",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from test1_table;\" test1"
|
|
],
|
|
"err-expect" : "2",
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"relation mapping file.*contains invalid data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"psql: FATAL: relation mapping file \"base/24576/pg_filenode.map\" contains invalid data"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres du -sh /var/lib/pgsql/9.5/data/base/24576"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"152K\t/var/lib/pgsql/9.5/data/base/24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"drop database test1;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"DROP DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select oid, datname from pg_database order by oid;\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"test2"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" oid | datname ",
|
|
"-------+-----------",
|
|
" 1 | template1",
|
|
" 12437 | template0",
|
|
" 12442 | postgres",
|
|
" 24577 | test2",
|
|
"(4 rows)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" create table important_table (message text); \\",
|
|
" insert into important_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -Atc \"select current_timestamp\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"2021-02-05 16:56:46.69886+00"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" drop table important_table; \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: ...le important_table; commit; select * from important_...",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --type=time \"--target=2021-02-05 16:56:46.69886+00\" \\",
|
|
" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/recovery.conf"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery_target_time"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 16:56:49",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"recovery_target_time = '2021-02-05 16:56:46.69886+00'",
|
|
"recovery_target_action = 'promote'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery stopping before|last completed transaction|starting point-in-time recovery"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 16:56:38 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 16:56:46.69886+00",
|
|
"LOG: restored log file \"00000004.history\" from archive",
|
|
"LOG: restored log file \"000000040000000000000017\" from archive",
|
|
"LOG: redo starts at 0/17000028",
|
|
"LOG: consistent recovery state reached at 0/170000F8",
|
|
"LOG: restored log file \"000000040000000000000018\" from archive",
|
|
"LOG: recovery stopping before commit of transaction 712, time 2021-02-05 16:56:47.985721+00",
|
|
"LOG: redo done at 0/1801B950",
|
|
"LOG: last completed transaction was at log time 2021-02-05 16:56:45.373011+00",
|
|
"LOG: selected new timeline ID: 5",
|
|
"LOG: archive recovery complete",
|
|
" [filtered 3 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" drop table important_table; \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: ...le important_table; commit; select * from important_...",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-165540F_20210205-165654I"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"20210205-165540F_20210205-165654I"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: aes-256-cbc",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (9.5): 00000002000000000000000A/000000050000000000000019",
|
|
"",
|
|
" full backup: 20210205-165527F",
|
|
" timestamp start/stop: 2021-02-05 16:55:27 / 2021-02-05 16:55:39",
|
|
" wal start/stop: 00000002000000000000000A / 00000002000000000000000A",
|
|
" database size: 20.6MB, database backup size: 20.6MB",
|
|
" repo1: backup set size: 2.4MB, backup size: 2.4MB",
|
|
"",
|
|
" full backup: 20210205-165540F",
|
|
" timestamp start/stop: 2021-02-05 16:55:40 / 2021-02-05 16:55:55",
|
|
" wal start/stop: 00000002000000000000000B / 00000002000000000000000B",
|
|
" database size: 20.6MB, database backup size: 20.6MB",
|
|
" repo1: backup set size: 2.4MB, backup size: 2.4MB",
|
|
"",
|
|
" diff backup: 20210205-165540F_20210205-165610D",
|
|
" timestamp start/stop: 2021-02-05 16:56:10 / 2021-02-05 16:56:13",
|
|
" wal start/stop: 000000020000000000000012 / 000000020000000000000012",
|
|
" database size: 20.6MB, database backup size: 113.9KB",
|
|
" repo1: backup set size: 2.4MB, backup size: 12.6KB",
|
|
" backup reference list: 20210205-165540F",
|
|
"",
|
|
" incr backup: 20210205-165540F_20210205-165620I",
|
|
" timestamp start/stop: 2021-02-05 16:56:20 / 2021-02-05 16:56:30",
|
|
" wal start/stop: 000000030000000000000014 / 000000030000000000000014",
|
|
" database size: 34.0MB, database backup size: 13.4MB",
|
|
" repo1: backup set size: 4MB, backup size: 1.6MB",
|
|
" backup reference list: 20210205-165540F, 20210205-165540F_20210205-165610D",
|
|
"",
|
|
" diff backup: 20210205-165540F_20210205-165638D",
|
|
" timestamp start/stop: 2021-02-05 16:56:38 / 2021-02-05 16:56:45",
|
|
" wal start/stop: 000000040000000000000017 / 000000040000000000000017",
|
|
" database size: 27.3MB, database backup size: 6.9MB",
|
|
" repo1: backup set size: 3.2MB, backup size: 834.9KB",
|
|
" backup reference list: 20210205-165540F",
|
|
"",
|
|
" incr backup: 20210205-165540F_20210205-165654I",
|
|
" timestamp start/stop: 2021-02-05 16:56:54 / 2021-02-05 16:56:57",
|
|
" wal start/stop: 000000050000000000000019 / 000000050000000000000019",
|
|
" database size: 27.3MB, database backup size: 2.0MB",
|
|
" repo1: backup set size: 3.2MB, backup size: 209.3KB",
|
|
" backup reference list: 20210205-165540F, 20210205-165540F_20210205-165638D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --set=20210205-165540F_20210205-165654I \\",
|
|
" --type=time \"--target=2021-02-05 16:56:46.69886+00\" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: select * from important_table",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"starting point-in-time recovery|consistent recovery state reached"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 16:56:54 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 16:56:46.69886+00",
|
|
"LOG: restored log file \"00000005.history\" from archive",
|
|
"LOG: restored log file \"000000050000000000000019\" from archive",
|
|
"LOG: redo starts at 0/19000028",
|
|
"LOG: consistent recovery state reached at 0/190000F8",
|
|
"LOG: redo done at 0/190000F8",
|
|
"LOG: restored log file \"000000050000000000000019\" from archive",
|
|
" [filtered 7 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --type=time \"--target=2021-02-05 16:56:46.69886+00\" \\",
|
|
" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery stopping before|last completed transaction|starting point-in-time recovery"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 16:56:38 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 16:56:46.69886+00",
|
|
"LOG: restored log file \"00000004.history\" from archive",
|
|
"LOG: restored log file \"000000040000000000000017\" from archive",
|
|
"LOG: redo starts at 0/17000028",
|
|
"LOG: consistent recovery state reached at 0/170000F8",
|
|
"LOG: restored log file \"000000040000000000000018\" from archive",
|
|
"LOG: recovery stopping before commit of transaction 712, time 2021-02-05 16:56:47.985721+00",
|
|
"LOG: redo done at 0/1801B950",
|
|
"LOG: last completed transaction was at log time 2021-02-05 16:56:45.373011+00",
|
|
"LOG: restored log file \"00000005.history\" from archive",
|
|
"LOG: restored log file \"00000006.history\" from archive",
|
|
" [filtered 5 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "4"
|
|
},
|
|
"repo1-azure-account" : {
|
|
"value" : "pgbackrest"
|
|
},
|
|
"repo1-azure-container" : {
|
|
"value" : "demo-container"
|
|
},
|
|
"repo1-azure-host" : {
|
|
"value" : "blob.core.windows.net"
|
|
},
|
|
"repo1-azure-key" : {
|
|
"value" : "YXpLZXk="
|
|
},
|
|
"repo1-path" : {
|
|
"value" : "/demo-repo"
|
|
},
|
|
"repo1-type" : {
|
|
"value" : "azure"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"process-max=4",
|
|
"repo1-azure-account=pgbackrest",
|
|
"repo1-azure-container=demo-container",
|
|
"repo1-azure-key=YXpLZXk=",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/demo-repo",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"repo1-type=azure",
|
|
"start-fast=y",
|
|
"stop-auto=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"echo \"172.17.0.2 blob.core.windows.net\" | tee -a /etc/hosts"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-create"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=3050-0c4e5d04 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-azure-account=<redacted> --repo1-azure-container=demo-container --repo1-azure-host=blob.core.windows.net --repo1-azure-key=<redacted> --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-type=azure --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=3071-26c31dfe --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=4 --repo1-azure-account=<redacted> --repo1-azure-container=demo-container --repo1-azure-host=blob.core.windows.net --repo1-azure-key=<redacted> --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-type=azure --stanza=demo --start-fast --stop-auto",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000070000000000000019, lsn = 0/19000028",
|
|
" [filtered 1119 lines of output]",
|
|
"P03 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12280 (0B, 100%)",
|
|
"P02 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12275 (0B, 100%)",
|
|
"P00 INFO: full backup size = 27.3MB",
|
|
"P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000070000000000000019, lsn = 0/190000F8",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "4"
|
|
},
|
|
"repo1-path" : {
|
|
"value" : "/demo-repo"
|
|
},
|
|
"repo1-s3-bucket" : {
|
|
"value" : "demo-bucket"
|
|
},
|
|
"repo1-s3-endpoint" : {
|
|
"value" : "s3.us-east-1.amazonaws.com"
|
|
},
|
|
"repo1-s3-key" : {
|
|
"value" : "accessKey1"
|
|
},
|
|
"repo1-s3-key-secret" : {
|
|
"value" : "verySecretKey1"
|
|
},
|
|
"repo1-s3-region" : {
|
|
"value" : "us-east-1"
|
|
},
|
|
"repo1-type" : {
|
|
"value" : "s3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"process-max=4",
|
|
"repo1-azure-account=pgbackrest",
|
|
"repo1-azure-container=demo-container",
|
|
"repo1-azure-key=YXpLZXk=",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/demo-repo",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"repo1-s3-bucket=demo-bucket",
|
|
"repo1-s3-endpoint=s3.us-east-1.amazonaws.com",
|
|
"repo1-s3-key=accessKey1",
|
|
"repo1-s3-key-secret=verySecretKey1",
|
|
"repo1-s3-region=us-east-1",
|
|
"repo1-type=s3",
|
|
"start-fast=y",
|
|
"stop-auto=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"echo \"172.17.0.3 demo-bucket.s3.us-east-1.amazonaws.com s3.us-east-1.amazonaws.com\" | tee -a /etc/hosts"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-create"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=3164-d5561449 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=3185-b3129eb1 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=4 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo --start-fast --stop-auto",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 00000007000000000000001B, lsn = 0/1B000028",
|
|
" [filtered 1119 lines of output]",
|
|
"P02 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12285 (0B, 100%)",
|
|
"P03 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12280 (0B, 100%)",
|
|
"P00 INFO: full backup size = 27.3MB",
|
|
"P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 00000007000000000000001B, lsn = 0/1B0000F8",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stop"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stop command begin 2.32: --exec-id=3232-ddb4059e --log-level-console=info --log-level-stderr=off --no-log-timestamp --stanza=demo",
|
|
"P00 INFO: stop command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-delete"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-delete command begin 2.32: --exec-id=3251-30e12a69 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo",
|
|
"P00 INFO: stanza-delete command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "repo1",
|
|
"image" : "pgbackrest/doc:centos7",
|
|
"name" : "repository",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos7",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.6"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo groupadd pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo adduser -gpgbackrest -n pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install postgresql-libs"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /var/log/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 750 /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest mkdir -m 750 /home/pgbackrest/.ssh"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh-keygen -f /home/pgbackrest/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -m 750 -p /var/lib/pgsql/.ssh"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh-keygen -f /var/lib/pgsql/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@pg-primary cat /var/lib/pgsql/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u pgbackrest tee -a /home/pgbackrest/.ssh/authorized_keys"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@repository cat /home/pgbackrest/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u postgres tee -a /var/lib/pgsql/.ssh/authorized_keys"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh postgres@pg-primary"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh pgbackrest@repository"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-path" : {
|
|
"value" : "/var/lib/pgbackrest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-host" : {
|
|
"value" : "pg-primary"
|
|
},
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/9.5/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
},
|
|
"start-fast" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/9.5/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-file" : {
|
|
"value" : "detail"
|
|
},
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-host" : {
|
|
"value" : "repository"
|
|
}
|
|
}
|
|
},
|
|
"reset" : true
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo stanza-create"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"timestamp start/stop"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: none",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (9.5): 000000080000000000000021/000000080000000000000022",
|
|
"",
|
|
" full backup: 20210205-165807F",
|
|
" timestamp start/stop: 2021-02-05 16:58:07 / 2021-02-05 16:58:24",
|
|
" wal start/stop: 000000080000000000000021 / 000000080000000000000021",
|
|
" database size: 27.3MB, database backup size: 27.3MB",
|
|
" repo1: backup set size: 3.2MB, backup size: 3.2MB",
|
|
"",
|
|
" full backup: 20210205-165826F",
|
|
" timestamp start/stop: 2021-02-05 16:58:26 / 2021-02-05 16:58:34",
|
|
" wal start/stop: 000000080000000000000022 / 000000080000000000000022",
|
|
" database size: 27.3MB, database backup size: 27.3MB",
|
|
" repo1: backup set size: 3.2MB, backup size: 3.2MB"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"err-expect" : "56",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"\\: stop file exists for all stanzas"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-1: [StopError] raised from remote-0 protocol on 'pg-primary': stop file exists for all stanzas",
|
|
"P00 ERROR: [056]: unable to find primary cluster - cannot proceed"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: stop file already exists for all stanzas"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"err-expect" : "56",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"\\: stop file exists for stanza demo"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-1: [StopError] raised from remote-0 protocol on 'pg-primary': stop file exists for stanza demo",
|
|
"P00 ERROR: [056]: unable to find primary cluster - cannot proceed"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "pg2",
|
|
"image" : "pgbackrest/doc:centos7",
|
|
"name" : "pg-standby",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos7",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.7"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install postgresql-libs"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -m 750 -p /var/lib/pgsql/.ssh"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh-keygen -f /var/lib/pgsql/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@pg-standby cat /var/lib/pgsql/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u pgbackrest tee -a /home/pgbackrest/.ssh/authorized_keys"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@repository cat /home/pgbackrest/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u postgres tee -a /var/lib/pgsql/.ssh/authorized_keys"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh postgres@pg-standby"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh pgbackrest@repository"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/9.5/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-file" : {
|
|
"value" : "detail"
|
|
},
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-host" : {
|
|
"value" : "repository"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -p -m 700 /var/lib/pgsql/9.5/data"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/recovery.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 16:58:52",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"standby_mode = 'on'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.5/data/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
},
|
|
"log_filename" : {
|
|
"value" : "'postgresql.log'"
|
|
},
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "hot_standby"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"hot_standby = on",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = hot_standby"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"entering standby mode|database system is ready to accept read only connections"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 16:58:26 UTC",
|
|
"LOG: entering standby mode",
|
|
"LOG: restored log file \"00000008.history\" from archive",
|
|
"LOG: restored log file \"000000080000000000000022\" from archive",
|
|
"LOG: redo starts at 0/22000028",
|
|
"LOG: consistent recovery state reached at 0/22000130",
|
|
"LOG: database system is ready to accept read only connections"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" begin; \\",
|
|
" create table replicated_table (message text); \\",
|
|
" insert into replicated_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select * from replicated_table\";"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from replicated_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"replicated_table\" does not exist",
|
|
"LINE 1: select * from replicated_table;",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select *, current_timestamp from pg_switch_xlog()\";"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" pg_switch_xlog | now ",
|
|
"----------------+-------------------------------",
|
|
" 0/2301F398 | 2021-02-05 16:58:57.878661+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select *, current_timestamp from replicated_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | now ",
|
|
"----------------+-------------------------------",
|
|
" Important Data | 2021-02-05 16:59:00.573596+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"because this is a standby"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=864-2851a5de --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-host=repository --stanza=demo",
|
|
"P00 INFO: check repo1 (standby)",
|
|
"P00 INFO: switch wal not performed because this is a standby",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" create user replicator password 'jw8s0F4' replication\";"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'echo \\",
|
|
" \"host replication replicator 172.17.0.7/32 md5\" \\",
|
|
" >> /var/lib/pgsql/9.5/data/pg_hba.conf'"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl reload postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"recovery-option" : {
|
|
"value" : "primary_conninfo=host=172.17.0.5 port=5432 user=replicator"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'echo \\",
|
|
" \"172.17.0.5:*:replication:replicator:jw8s0F4\" \\",
|
|
" >> /var/lib/pgsql/.pgpass'"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres chmod 600 /var/lib/pgsql/.pgpass"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/recovery.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 16:59:04",
|
|
"primary_conninfo = 'host=172.17.0.5 port=5432 user=replicator'",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"standby_mode = 'on'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.5/data/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"hot_standby = on",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = hot_standby"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/9.5/data/pg_log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"started streaming WAL from primary"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 6 lines of output]",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: restored log file \"000000080000000000000023\" from archive",
|
|
"LOG: started streaming WAL from primary at 0/24000000 on timeline 8"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" begin; \\",
|
|
" create table stream_table (message text); \\",
|
|
" insert into stream_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select *, current_timestamp from stream_table\";"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | now ",
|
|
"----------------+------------------------------",
|
|
" Important Data | 2021-02-05 16:59:09.71836+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select *, current_timestamp from stream_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | now ",
|
|
"----------------+-------------------------------",
|
|
" Important Data | 2021-02-05 16:59:09.940225+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 750 /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 750 /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"archive-async" : {
|
|
"value" : "y"
|
|
},
|
|
"spool-path" : {
|
|
"value" : "/var/spool/pgbackrest"
|
|
}
|
|
},
|
|
"global:archive-get" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
},
|
|
"global:archive-push" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"global" : {
|
|
"archive-async" : {
|
|
"value" : "y"
|
|
},
|
|
"spool-path" : {
|
|
"value" : "/var/spool/pgbackrest"
|
|
}
|
|
},
|
|
"global:archive-get" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
},
|
|
"global:archive-push" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"alter user replicator password 'bogus'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ALTER ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl restart postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres rm -f /var/log/pgbackrest/demo-archive-push-async.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_xlog();\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"WAL segment"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=4012-eb76679f --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-host=repository --stanza=demo",
|
|
"P00 INFO: check repo1 configuration (primary)",
|
|
"P00 INFO: check repo1 archive for WAL (primary)",
|
|
"P00 INFO: WAL segment 000000080000000000000029 successfully archived to '/var/lib/pgbackrest/archive/demo/9.5-1/0000000800000000/000000080000000000000029-a109113d898cfea4889435dbb6bd78790575729d.gz' on repo1",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/pgbackrest/demo-archive-push-async.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
" WAL file\\(s\\) to archive|pushed WAL file \\'0000000"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/pgsql/9.5/data/pg_xlog] --archive-async --exec-id=3987-cdcedbf5 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000024",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000024' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully",
|
|
"",
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/pgsql/9.5/data/pg_xlog] --archive-async --exec-id=4014-fe700395 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 4 WAL file(s) to archive: 000000080000000000000025...000000080000000000000028",
|
|
"P02 DETAIL: pushed WAL file '000000080000000000000026' to the archive",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000025' to the archive",
|
|
"P02 DETAIL: pushed WAL file '000000080000000000000027' to the archive",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000028' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully",
|
|
"",
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/pgsql/9.5/data/pg_xlog] --archive-async --exec-id=4026-3d8c6206 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000029",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000029' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 5"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/pgbackrest/demo-archive-get-async.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"found [0-F]{24} in the .* archive"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-get:async command begin 2.32: [000000080000000000000022, 000000080000000000000023, 000000080000000000000024, 000000080000000000000025, 000000080000000000000026, 000000080000000000000027, 000000080000000000000028, 000000080000000000000029] --archive-async --exec-id=1268-1c62c1ec --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000022...000000080000000000000029",
|
|
"P01 DETAIL: found 000000080000000000000022 in the repo1:9.5-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000023 in the repo1:9.5-1 archive",
|
|
"P00 DETAIL: unable to find 000000080000000000000024 in the archive",
|
|
"P00 INFO: archive-get:async command end: completed successfully",
|
|
" [filtered 8 lines of output]",
|
|
"P00 INFO: archive-get:async command begin 2.32: [000000080000000000000024, 000000080000000000000025, 000000080000000000000026, 000000080000000000000027, 000000080000000000000028, 000000080000000000000029, 00000008000000000000002A, 00000008000000000000002B] --archive-async --exec-id=1308-5b1d8c25 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000024...00000008000000000000002B",
|
|
"P01 DETAIL: found 000000080000000000000024 in the repo1:9.5-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000025 in the repo1:9.5-1 archive",
|
|
"P01 DETAIL: found 000000080000000000000026 in the repo1:9.5-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000027 in the repo1:9.5-1 archive",
|
|
"P01 DETAIL: found 000000080000000000000028 in the repo1:9.5-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000029 in the repo1:9.5-1 archive",
|
|
"P00 DETAIL: unable to find 00000008000000000000002A in the archive",
|
|
"P00 INFO: archive-get:async command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"alter user replicator password 'jw8s0F4'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ALTER ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg2-host" : {
|
|
"value" : "pg-standby"
|
|
},
|
|
"pg2-path" : {
|
|
"value" : "/var/lib/pgsql/9.5/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/9.5/data",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/pgsql/9.5/data",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=y",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --log-level-console=detail backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup file pg-primary|replay on the standby"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 2 lines of output]",
|
|
"P00 INFO: execute exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 00000008000000000000002B, lsn = 0/2B000028",
|
|
"P00 INFO: wait for replay on the standby to reach 0/2B000028",
|
|
"P00 INFO: replay on the standby reached 0/2B000028",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/global/pg_control (8KB, 0%) checksum 265faf1b4137c3efe531326c60d092ef43befc5b",
|
|
"P04 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/1249 (360KB, 17%) checksum 39bf547813af646df7054e03004308682fc289ff",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/pg_log/postgresql.log (5.4KB, 17%) checksum 36cf01574dcda526901b5052ddd57d367db64a8a",
|
|
"P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/2608 (432KB, 37%) checksum 485311801975f4ba213e106dca6a7fc0364ff1b2",
|
|
"P03 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/2674 (360KB, 54%) checksum 669b8d315aa643fd94c8947e0ab132603fa7ca06",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/pg_hba.conf (4.2KB, 54%) checksum f28f3f76528c7fd372aa22474954691c6341da76",
|
|
"P04 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/2673 (296KB, 68%) checksum e6b30183fed8b609f3b8fb3920c58ae0884feac5",
|
|
"P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/2658 (112KB, 73%) checksum 0354ce04355ba8b174b549e069e349e8824201aa",
|
|
"P03 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/1259 (104KB, 78%) checksum 92dca8bffe9ace6dac3025f848be5777982daf1f",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/backup_label (248B, 78%) checksum ac7db625007153fc4e7e0acbf083e9fbd5d7c85a",
|
|
"P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/2659 (72KB, 82%) checksum bcbcbc43777fc004f5b0055a76ed91630ed06afd",
|
|
"P03 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12442/1247 (72KB, 85%) checksum db66c64d1246dcf91005a12a43b73107e4a4ff19",
|
|
" [filtered 1124 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-9.5.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres /usr/pgsql-9.6/bin/initdb \\",
|
|
" -D /var/lib/pgsql/9.6/data -k -A peer"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'cd /var/lib/pgsql && \\",
|
|
" /usr/pgsql-9.6/bin/pg_upgrade \\",
|
|
" --old-bindir=/usr/pgsql-9.5/bin \\",
|
|
" --new-bindir=/usr/pgsql-9.6/bin \\",
|
|
" --old-datadir=/var/lib/pgsql/9.5/data \\",
|
|
" --new-datadir=/var/lib/pgsql/9.6/data \\",
|
|
" --old-options=\" -c config_file=/var/lib/pgsql/9.5/data/postgresql.conf\" \\",
|
|
" --new-options=\" -c config_file=/var/lib/pgsql/9.6/data/postgresql.conf\"'"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Upgrade Complete"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 70 lines of output]",
|
|
"Creating script to delete old cluster ok",
|
|
"",
|
|
"Upgrade Complete",
|
|
"----------------",
|
|
"Optimizer statistics are not transferred by pg_upgrade so,",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.6/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"listen_addresses" : {
|
|
"value" : "'*'"
|
|
},
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"port" : {
|
|
"value" : "5432"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "hot_standby"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"listen_addresses = '*'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"port = 5432",
|
|
"wal_level = hot_standby"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/9.6/data"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.6/data",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/9.6/data"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/9.6/data",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/9.6/data"
|
|
},
|
|
"pg2-path" : {
|
|
"value" : "/var/lib/pgsql/9.6/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "n"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/9.6/data",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/pgsql/9.6/data",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=n",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo cp /var/lib/pgsql/9.5/data/pg_hba.conf \\",
|
|
" /var/lib/pgsql/9.6/data/pg_hba.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --no-online \\",
|
|
" --log-level-console=info stanza-upgrade"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-upgrade command begin 2.32: --no-backup-standby --exec-id=1640-0d4d3fee --log-level-console=info --log-level-stderr=off --no-log-timestamp --no-online --pg1-host=pg-primary --pg2-host=pg-standby --pg1-path=/var/lib/pgsql/9.6/data --pg2-path=/var/lib/pgsql/9.6/data --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: stanza-upgrade for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-upgrade command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.6.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres systemctl status postgresql-9.6.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"● postgresql-9.6.service - PostgreSQL 9.6 database server",
|
|
" Loaded: loaded (/usr/lib/systemd/system/postgresql-9.6.service; disabled; vendor preset: disabled)",
|
|
" Active: active (running) since Fri 2021-02-05 16:59:49 UTC; 154ms ago",
|
|
" Docs: https://www.postgresql.org/docs/9.6/static/",
|
|
" Process: 4426 ExecStartPre=/usr/pgsql-9.6/bin/postgresql96-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)",
|
|
" Main PID: 4431 (postmaster)",
|
|
" CGroup: /docker/6f0b9e8ada626fc23681422e258db0fded51da003e01d3bf2c5938d24c16b1ee/system.slice/postgresql-9.6.service",
|
|
" ├─4431 /usr/pgsql-9.6/bin/postmaster -D /var/lib/pgsql/9.6/data/",
|
|
" ├─4432 postgres: logger process ",
|
|
" ├─4434 postgres: checkpointer process ",
|
|
" ├─4435 postgres: writer process ",
|
|
" ├─4436 postgres: wal writer process ",
|
|
" ├─4437 postgres: autovacuum launcher process ",
|
|
" ├─4438 postgres: archiver process ",
|
|
" └─4439 postgres: stats collector process "
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm -rf /var/lib/pgsql/9.5/data"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm -rf /var/lib/pgsql/9.5/data"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -p -m 700 /usr/pgsql-9.6/bin"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-2: [DbConnectError] raised from remote-0 protocol on 'pg-standby': unable to connect to 'dbname='postgres' port=5432': could not connect to server: No such file or directory",
|
|
" \tIs the server running locally and accepting",
|
|
" \tconnections on Unix domain socket \"/var/run/postgresql/.s.PGSQL.5432\"?"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/9.6/data/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"hot_standby = on"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-9.6.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/9.6/data",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/pgsql/9.6/data",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=y",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"{\"os-type\":\"centos8\"}" : {
|
|
"all" : {
|
|
"user-guide" : [
|
|
{
|
|
"key" : {
|
|
"id" : "azure",
|
|
"image" : "mcr.microsoft.com/azure-storage/azurite",
|
|
"name" : "azure-server",
|
|
"option" : "-v {[host-repo-path]}/doc/resource/fake-cert/azure-server.crt:/root/public.crt:ro -v {[host-repo-path]}/doc/resource/fake-cert/azure-server.key:/root/private.key:ro -e AZURITE_ACCOUNTS='pgbackrest:YXpLZXk='",
|
|
"os" : "centos8",
|
|
"param" : "azurite-blob --blobPort 443 --blobHost 0.0.0.0 --cert=/root/public.crt --key=/root/private.key",
|
|
"update-hosts" : false
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.2"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "s3",
|
|
"image" : "minio/minio",
|
|
"name" : "s3-server",
|
|
"option" : "-v {[host-repo-path]}/doc/resource/fake-cert/s3-server.crt:/root/.minio/certs/public.crt:ro -v {[host-repo-path]}/doc/resource/fake-cert/s3-server.key:/root/.minio/certs/private.key:ro -e MINIO_REGION=us-east-1 -e MINIO_DOMAIN=s3.us-east-1.amazonaws.com -e MINIO_BROWSER=off -e MINIO_ACCESS_KEY=accessKey1 -e MINIO_SECRET_KEY=verySecretKey1",
|
|
"os" : "centos8",
|
|
"param" : "server /data --address :443",
|
|
"update-hosts" : false
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.3"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "build",
|
|
"image" : "pgbackrest/doc:centos8",
|
|
"name" : "build",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos8",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.4"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo cp -r /pgbackrest/src /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown -R vagrant /build/pgbackrest-release-2.32"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install make gcc postgresql10-devel \\",
|
|
" openssl-devel libxml2-devel lz4-devel libzstd-devel bzip2-devel"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"cd /build/pgbackrest-release-2.32/src && ./configure && make"
|
|
],
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "pg1",
|
|
"image" : "pgbackrest/doc:centos8",
|
|
"name" : "pg-primary",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos8",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.5"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install postgresql-libs"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"pgBackRest 2.32 - General help",
|
|
"",
|
|
"Usage:",
|
|
" pgbackrest [options] [command]",
|
|
"",
|
|
"Commands:",
|
|
" archive-get Get a WAL segment from the archive.",
|
|
" archive-push Push a WAL segment to the archive.",
|
|
" backup Backup a database cluster.",
|
|
" check Check the configuration.",
|
|
" expire Expire backups that exceed retention.",
|
|
" help Get help.",
|
|
" info Retrieve information about backups.",
|
|
" repo-get Get files from a repository.",
|
|
" repo-ls List files in a repository.",
|
|
" restore Restore a database cluster.",
|
|
" stanza-create Create the required stanza data.",
|
|
" stanza-delete Delete a stanza.",
|
|
" stanza-upgrade Upgrade a stanza.",
|
|
" start Allow pgBackRest processes to run.",
|
|
" stop Stop pgBackRest processes from running.",
|
|
" version Get version.",
|
|
"",
|
|
"Use 'pgbackrest help [command]' for more information."
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres /usr/pgsql-10/bin/initdb \\",
|
|
" -D /var/lib/pgsql/10/data -k -A peer"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/10/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"listen_addresses" : {
|
|
"value" : "'*'"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/10/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'",
|
|
"log_line_prefix = ''"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/10/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"log_filename" : {
|
|
"value" : "'postgresql.log'"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"listen_addresses = '*'",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/10/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres bash -c ' \\",
|
|
" export PGBACKREST_LOG_PATH=/path/set/by/env && \\",
|
|
" pgbackrest --log-level-console=error help backup log-path'"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"current\\: \\/path\\/set\\/by\\/env"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"pgBackRest 2.32 - 'backup' command - 'log-path' option help",
|
|
"",
|
|
"Path where log files are stored.",
|
|
"",
|
|
"The log path provides a location for pgBackRest to store log files. Note that",
|
|
"if log-level-file=off then no log path is required.",
|
|
"",
|
|
"current: /path/set/by/env",
|
|
"default: /var/log/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 750 /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/lib/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-path" : {
|
|
"value" : "/var/lib/pgbackrest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/10/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "replica"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"listen_addresses = '*'",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = replica"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl restart postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global:archive-push" : {
|
|
"compress-level" : {
|
|
"value" : "3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-cipher-pass" : {
|
|
"value" : "zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO"
|
|
},
|
|
"repo1-cipher-type" : {
|
|
"value" : "aes-256-cbc"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=1018-cbc05e88 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
" successfully archived to "
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=1055-5fd933d4 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: check repo1 configuration (primary)",
|
|
"P00 INFO: check repo1 archive for WAL (primary)",
|
|
"P00 INFO: WAL segment 000000010000000000000001 successfully archived to '/var/lib/pgbackrest/archive/demo/10-1/0000000100000000/000000010000000000000001-922c8e39c578cdfc669affcfc09a7f39bce3b315.gz' on repo1",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1093-af8b6a43 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the next regular checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000010000000000000002, lsn = 0/2000028",
|
|
" [filtered 946 lines of output]",
|
|
"P01 INFO: backup file /var/lib/pgsql/10/data/base/1/12859 (0B, 100%)",
|
|
"P01 INFO: backup file /var/lib/pgsql/10/data/base/1/12854 (0B, 100%)",
|
|
"P00 INFO: full backup size = 22.5MB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000010000000000000002, lsn = 0/2000130",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-170215F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"diff backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 5 lines of output]",
|
|
"P01 INFO: backup file /var/lib/pgsql/10/data/log/postgresql.log (700B, 99%) checksum f9581022ba0bc116bdb9e178d7a2cd90d7e09abe",
|
|
"P01 INFO: backup file /var/lib/pgsql/10/data/pg_logical/replorigin_checkpoint (8B, 100%) checksum 347fc8f2df71bd4436e38bd1516ccd7ea0d46532",
|
|
"P00 INFO: diff backup size = 8.7KB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000010000000000000003, lsn = 0/30000F8",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"(full|incr|diff) backup"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: aes-256-cbc",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (10): 000000010000000000000001/000000010000000000000003",
|
|
"",
|
|
" full backup: 20210205-170215F",
|
|
" timestamp start/stop: 2021-02-05 17:02:15 / 2021-02-05 17:02:26",
|
|
" wal start/stop: 000000010000000000000002 / 000000010000000000000002",
|
|
" database size: 22.5MB, database backup size: 22.5MB",
|
|
" repo1: backup set size: 2.7MB, backup size: 2.7MB",
|
|
"",
|
|
" diff backup: 20210205-170215F_20210205-170227D",
|
|
" timestamp start/stop: 2021-02-05 17:02:27 / 2021-02-05 17:02:29",
|
|
" wal start/stop: 000000010000000000000003 / 000000010000000000000003",
|
|
" database size: 22.5MB, database backup size: 8.9KB",
|
|
" repo1: backup set size: 2.7MB, backup size: 800B",
|
|
" backup reference list: 20210205-170215F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres rm /var/lib/pgsql/10/data/global/pg_control"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"err-expect" : "1",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl status postgresql-10.service"
|
|
],
|
|
"err-expect" : "3",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Failed to start PostgreSQL"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 12 lines of output]",
|
|
"Feb 05 17:02:30 pg-primary systemd[1]: postgresql-10.service: Main process exited, code=exited, status=2/INVALIDARGUMENT",
|
|
"Feb 05 17:02:30 pg-primary systemd[1]: postgresql-10.service: Failed with result 'exit-code'.",
|
|
"Feb 05 17:02:30 pg-primary systemd[1]: Failed to start PostgreSQL 10 database server."
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres find /var/lib/pgsql/10/data -mindepth 1 -delete"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup begins after the next regular checkpoint completes"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1552-b6ca84d7 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --type=incr",
|
|
"P00 INFO: last backup label = 20210205-170215F_20210205-170227D, version = 2.32",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the next regular checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000020000000000000005, lsn = 0/5000028",
|
|
"P00 WARN: a timeline switch has occurred since the 20210205-170215F_20210205-170227D backup, enabling delta checksum",
|
|
" [filtered 10 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"start-fast" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup begins after the requested immediate checkpoint completes"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=1634-eb420826 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr",
|
|
"P00 INFO: last backup label = 20210205-170215F_20210205-170244I, version = 2.32",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000020000000000000006, lsn = 0/6000028",
|
|
"P01 INFO: backup file /var/lib/pgsql/10/data/global/pg_control (8KB, 84%) checksum 9113d1cf2f70795df51af31fd489cd6710434d53",
|
|
" [filtered 9 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -p /var/lib/pgsql/pgbackrest/doc/example"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cp -r /pgbackrest/doc/example/* \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-info.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-- An example of monitoring pgBackRest from within PostgreSQL",
|
|
"--",
|
|
"-- Use copy to export data from the pgBackRest info command into the jsonb",
|
|
"-- type so it can be queried directly by PostgreSQL.",
|
|
"",
|
|
"-- Create monitor schema",
|
|
"create schema monitor;",
|
|
"",
|
|
"-- Get pgBackRest info in JSON format",
|
|
"create function monitor.pgbackrest_info()",
|
|
" returns jsonb AS $$",
|
|
"declare",
|
|
" data jsonb;",
|
|
"begin",
|
|
" -- Create a temp table to hold the JSON data",
|
|
" create temp table temp_pgbackrest_data (data jsonb);",
|
|
"",
|
|
" -- Copy data into the table directly from the pgBackRest info command",
|
|
" copy temp_pgbackrest_data (data)",
|
|
" from program",
|
|
" 'pgbackrest --output=json info' (format text);",
|
|
"",
|
|
" select temp_pgbackrest_data.data",
|
|
" into data",
|
|
" from temp_pgbackrest_data;",
|
|
"",
|
|
" drop table temp_pgbackrest_data;",
|
|
"",
|
|
" return data;",
|
|
"end $$ language plpgsql;"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -f \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-info.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-query.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-- Get last successful backup for each stanza",
|
|
"--",
|
|
"-- Requires the monitor.pgbackrest_info function.",
|
|
"with stanza as",
|
|
"(",
|
|
" select data->'name' as name,",
|
|
" data->'backup'->(",
|
|
" jsonb_array_length(data->'backup') - 1) as last_backup,",
|
|
" data->'archive'->(",
|
|
" jsonb_array_length(data->'archive') - 1) as current_archive",
|
|
" from jsonb_array_elements(monitor.pgbackrest_info()) as data",
|
|
")",
|
|
"select name,",
|
|
" to_timestamp(",
|
|
" (last_backup->'timestamp'->>'stop')::numeric) as last_successful_backup,",
|
|
" current_archive->>'max' as last_archived_wal",
|
|
" from stanza;"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -f \\",
|
|
" /var/lib/pgsql/pgbackrest/doc/example/pgsql-pgbackrest-query.sql"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" name | last_successful_backup | last_archived_wal ",
|
|
"--------+------------------------+--------------------------",
|
|
" \"demo\" | 2021-02-05 17:02:48+00 | 000000020000000000000006",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=full \\",
|
|
" --log-level-console=detail backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"archive retention on backup 20210205-170215F|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 957 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=1886-cd386c40 --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 DETAIL: archive retention on backup 20210205-170215F repo1: 10-1, start = 000000010000000000000002",
|
|
"P00 DETAIL: remove archive repo1: 10-1, start = 000000010000000000000001, stop = 000000010000000000000001",
|
|
"P00 INFO: expire command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-170251F"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=full \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"expire full backup set repo1\\: 20210205-170215F|archive retention on backup 20210205-170251F|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 956 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=1965-a6d42a04 --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo",
|
|
"P00 INFO: expire full backup set repo1: 20210205-170215F, 20210205-170215F_20210205-170227D, 20210205-170215F_20210205-170244I, 20210205-170215F_20210205-170247I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-170215F_20210205-170247I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-170215F_20210205-170244I",
|
|
" [filtered 2 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-diff" : {
|
|
"value" : "1"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-diff=1",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-170305F_20210205-170320D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"expire diff backup set repo1: 20210205-170305F_20210205-170320D"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 12 lines of output]",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=2169-4062586d --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=1 --repo1-retention-full=2 --stanza=demo",
|
|
"P00 INFO: expire diff backup set repo1: 20210205-170305F_20210205-170320D, 20210205-170305F_20210205-170323I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-170305F_20210205-170323I",
|
|
"P00 INFO: remove expired backup repo1: 20210205-170305F_20210205-170320D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-retention-diff" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-170305F_20210205-170326D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select pg_create_restore_point('generate WAL'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('generate WAL'); select pg_switch_wal();\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"new backup label"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 9 lines of output]",
|
|
"P00 INFO: backup stop archive = 000000020000000000000010, lsn = 0/100000F8",
|
|
"P00 INFO: check archive for segment(s) 000000020000000000000010:000000020000000000000010",
|
|
"P00 INFO: new backup label = 20210205-170305F_20210205-170330D",
|
|
"P00 INFO: backup command end: completed successfully",
|
|
"P00 INFO: expire command begin 2.32: --exec-id=2309-0c4618b9 --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-170305F_20210205-170330D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=detail \\",
|
|
" --repo1-retention-archive-type=diff --repo1-retention-archive=1 expire"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"archive retention on backup 20210205-170305F_20210205-170326D|remove archive"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: expire command begin 2.32: --exec-id=2384-ad2df8f6 --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-archive=1 --repo1-retention-archive-type=diff --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo",
|
|
"P00 DETAIL: archive retention on backup 20210205-170251F repo1: 10-1, start = 000000020000000000000008, stop = 000000020000000000000008",
|
|
"P00 DETAIL: archive retention on backup 20210205-170305F repo1: 10-1, start = 000000020000000000000009, stop = 000000020000000000000009",
|
|
"P00 DETAIL: archive retention on backup 20210205-170305F_20210205-170326D repo1: 10-1, start = 00000002000000000000000D, stop = 00000002000000000000000D",
|
|
"P00 DETAIL: archive retention on backup 20210205-170305F_20210205-170330D repo1: 10-1, start = 000000020000000000000010",
|
|
"P00 DETAIL: remove archive repo1: 10-1, start = 00000002000000000000000A, stop = 00000002000000000000000C",
|
|
"P00 DETAIL: remove archive repo1: 10-1, start = 00000002000000000000000E, stop = 00000002000000000000000F",
|
|
"P00 INFO: expire command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --log-level-console=detail restore"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"demo\\/PG_VERSION - exists and matches backup|remove invalid files|rename global\\/pg_control"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 2 lines of output]",
|
|
"P00 DETAIL: check '/var/lib/pgsql/10/data' exists",
|
|
"P00 DETAIL: remove 'global/pg_control' so cluster will not start if restore does not complete",
|
|
"P00 INFO: remove invalid files/links/paths from '/var/lib/pgsql/10/data'",
|
|
"P00 DETAIL: remove invalid file '/var/lib/pgsql/10/data/backup_label.old'",
|
|
"P00 DETAIL: remove invalid file '/var/lib/pgsql/10/data/base/13017/pg_internal.init'",
|
|
" [filtered 997 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create database test1;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create database test2;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create table test1_table (id int); \\",
|
|
" insert into test1_table (id) values (1);\" test1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"INSERT 0 1"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"create table test2_table (id int); \\",
|
|
" insert into test2_table (id) values (2);\" test2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"INSERT 0 1"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -Atc \"select oid from pg_database where datname = 'test1'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres du -sh /var/lib/pgsql/10/data/base/24576"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"7.5M\t/var/lib/pgsql/10/data/base/24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-170305F_20210205-170337I"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --set=20210205-170305F_20210205-170337I info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"database list"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 11 lines of output]",
|
|
" repo1: backup set size: 4.4MB, backup size: 1.8MB",
|
|
" backup reference list: 20210205-170305F, 20210205-170305F_20210205-170330D",
|
|
" database list: postgres (13017), test1 (24576), test2 (24577)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --db-include=test2 restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from test2_table;\" test2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" id ",
|
|
"----",
|
|
" 2",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from test1_table;\" test1"
|
|
],
|
|
"err-expect" : "2",
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"relation mapping file.*contains invalid data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"psql: FATAL: relation mapping file \"base/24576/pg_filenode.map\" contains invalid data"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres du -sh /var/lib/pgsql/10/data/base/24576"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"176K\t/var/lib/pgsql/10/data/base/24576"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"drop database test1;\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"DROP DATABASE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select oid, datname from pg_database order by oid;\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"test2"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" oid | datname ",
|
|
"-------+-----------",
|
|
" 1 | template1",
|
|
" 13016 | template0",
|
|
" 13017 | postgres",
|
|
" 24577 | test2",
|
|
"(4 rows)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=diff backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" create table important_table (message text); \\",
|
|
" insert into important_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -Atc \"select current_timestamp\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"2021-02-05 17:04:00.912624+00"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" drop table important_table; \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: ...le important_table; commit; select * from important_...",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --type=time \"--target=2021-02-05 17:04:00.912624+00\" \\",
|
|
" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/recovery.conf"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery_target_time"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:04:03",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"recovery_target_time = '2021-02-05 17:04:00.912624+00'",
|
|
"recovery_target_action = 'promote'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery stopping before|last completed transaction|starting point-in-time recovery"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 17:03:53 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 17:04:00.912624+00",
|
|
"LOG: restored log file \"00000004.history\" from archive",
|
|
"LOG: restored log file \"000000040000000000000015\" from archive",
|
|
" [filtered 2 lines of output]",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: restored log file \"000000040000000000000016\" from archive",
|
|
"LOG: recovery stopping before commit of transaction 564, time 2021-02-05 17:04:02.229414+00",
|
|
"LOG: redo done at 0/16021848",
|
|
"LOG: last completed transaction was at log time 2021-02-05 17:03:59.564012+00",
|
|
"LOG: selected new timeline ID: 5",
|
|
"LOG: archive recovery complete",
|
|
"LOG: database system is ready to accept connections"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"begin; \\",
|
|
" drop table important_table; \\",
|
|
" commit; \\",
|
|
" select * from important_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: ...le important_table; commit; select * from important_...",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=incr backup"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-ls backup/demo --filter=\"(F|D|I)$\" --sort=desc | head -1"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"20210205-170305F_20210205-170407I"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"20210205-170305F_20210205-170407I"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: aes-256-cbc",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (10): 000000020000000000000008/000000050000000000000017",
|
|
"",
|
|
" full backup: 20210205-170251F",
|
|
" timestamp start/stop: 2021-02-05 17:02:51 / 2021-02-05 17:03:04",
|
|
" wal start/stop: 000000020000000000000008 / 000000020000000000000008",
|
|
" database size: 22.5MB, database backup size: 22.5MB",
|
|
" repo1: backup set size: 2.7MB, backup size: 2.7MB",
|
|
"",
|
|
" full backup: 20210205-170305F",
|
|
" timestamp start/stop: 2021-02-05 17:03:05 / 2021-02-05 17:03:19",
|
|
" wal start/stop: 000000020000000000000009 / 000000020000000000000009",
|
|
" database size: 22.5MB, database backup size: 22.5MB",
|
|
" repo1: backup set size: 2.7MB, backup size: 2.7MB",
|
|
"",
|
|
" diff backup: 20210205-170305F_20210205-170330D",
|
|
" timestamp start/stop: 2021-02-05 17:03:30 / 2021-02-05 17:03:32",
|
|
" wal start/stop: 000000020000000000000010 / 000000020000000000000010",
|
|
" database size: 22.5MB, database backup size: 11KB",
|
|
" repo1: backup set size: 2.7MB, backup size: 1KB",
|
|
" backup reference list: 20210205-170305F",
|
|
"",
|
|
" incr backup: 20210205-170305F_20210205-170337I",
|
|
" timestamp start/stop: 2021-02-05 17:03:37 / 2021-02-05 17:03:46",
|
|
" wal start/stop: 000000030000000000000012 / 000000030000000000000012",
|
|
" database size: 37.2MB, database backup size: 15.1MB",
|
|
" repo1: backup set size: 4.4MB, backup size: 1.8MB",
|
|
" backup reference list: 20210205-170305F, 20210205-170305F_20210205-170330D",
|
|
"",
|
|
" diff backup: 20210205-170305F_20210205-170353D",
|
|
" timestamp start/stop: 2021-02-05 17:03:53 / 2021-02-05 17:03:59",
|
|
" wal start/stop: 000000040000000000000015 / 000000040000000000000015",
|
|
" database size: 29.9MB, database backup size: 7.8MB",
|
|
" repo1: backup set size: 3.6MB, backup size: 951.2KB",
|
|
" backup reference list: 20210205-170305F",
|
|
"",
|
|
" incr backup: 20210205-170305F_20210205-170407I",
|
|
" timestamp start/stop: 2021-02-05 17:04:07 / 2021-02-05 17:04:08",
|
|
" wal start/stop: 000000050000000000000017 / 000000050000000000000017",
|
|
" database size: 29.9MB, database backup size: 2.1MB",
|
|
" repo1: backup set size: 3.6MB, backup size: 218.8KB",
|
|
" backup reference list: 20210205-170305F, 20210205-170305F_20210205-170353D"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --set=20210205-170305F_20210205-170407I \\",
|
|
" --type=time \"--target=2021-02-05 17:04:00.912624+00\" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"important_table\" does not exist",
|
|
"LINE 1: select * from important_table",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"starting point-in-time recovery|consistent recovery state reached"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 17:04:07 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 17:04:00.912624+00",
|
|
"LOG: restored log file \"00000005.history\" from archive",
|
|
"LOG: restored log file \"000000050000000000000017\" from archive",
|
|
"LOG: redo starts at 0/17000028",
|
|
"LOG: consistent recovery state reached at 0/170000F8",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: redo done at 0/170000F8",
|
|
" [filtered 7 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta \\",
|
|
" --type=time \"--target=2021-02-05 17:04:00.912624+00\" \\",
|
|
" --target-action=promote restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from important_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"recovery stopping before|last completed transaction|starting point-in-time recovery"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 17:03:53 UTC",
|
|
"LOG: starting point-in-time recovery to 2021-02-05 17:04:00.912624+00",
|
|
"LOG: restored log file \"00000004.history\" from archive",
|
|
"LOG: restored log file \"000000040000000000000015\" from archive",
|
|
" [filtered 2 lines of output]",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: restored log file \"000000040000000000000016\" from archive",
|
|
"LOG: recovery stopping before commit of transaction 564, time 2021-02-05 17:04:02.229414+00",
|
|
"LOG: redo done at 0/16021848",
|
|
"LOG: last completed transaction was at log time 2021-02-05 17:03:59.564012+00",
|
|
"LOG: restored log file \"00000005.history\" from archive",
|
|
"LOG: restored log file \"00000006.history\" from archive",
|
|
" [filtered 3 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "4"
|
|
},
|
|
"repo1-azure-account" : {
|
|
"value" : "pgbackrest"
|
|
},
|
|
"repo1-azure-container" : {
|
|
"value" : "demo-container"
|
|
},
|
|
"repo1-azure-host" : {
|
|
"value" : "blob.core.windows.net"
|
|
},
|
|
"repo1-azure-key" : {
|
|
"value" : "YXpLZXk="
|
|
},
|
|
"repo1-path" : {
|
|
"value" : "/demo-repo"
|
|
},
|
|
"repo1-type" : {
|
|
"value" : "azure"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"process-max=4",
|
|
"repo1-azure-account=pgbackrest",
|
|
"repo1-azure-container=demo-container",
|
|
"repo1-azure-key=YXpLZXk=",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/demo-repo",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"repo1-type=azure",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"echo \"172.17.0.2 blob.core.windows.net\" | tee -a /etc/hosts"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-create"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=4342-2b318538 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-azure-account=<redacted> --repo1-azure-container=demo-container --repo1-azure-host=blob.core.windows.net --repo1-azure-key=<redacted> --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-type=azure --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=4369-93cd1fd3 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --process-max=4 --repo1-azure-account=<redacted> --repo1-azure-container=demo-container --repo1-azure-host=blob.core.windows.net --repo1-azure-key=<redacted> --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-type=azure --stanza=demo --start-fast",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000070000000000000017, lsn = 0/17000028",
|
|
" [filtered 1243 lines of output]",
|
|
"P01 INFO: backup file /var/lib/pgsql/10/data/base/1/12859 (0B, 100%)",
|
|
"P02 INFO: backup file /var/lib/pgsql/10/data/base/1/12854 (0B, 100%)",
|
|
"P00 INFO: full backup size = 29.9MB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000070000000000000017, lsn = 0/170000F8",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "4"
|
|
},
|
|
"repo1-path" : {
|
|
"value" : "/demo-repo"
|
|
},
|
|
"repo1-s3-bucket" : {
|
|
"value" : "demo-bucket"
|
|
},
|
|
"repo1-s3-endpoint" : {
|
|
"value" : "s3.us-east-1.amazonaws.com"
|
|
},
|
|
"repo1-s3-key" : {
|
|
"value" : "accessKey1"
|
|
},
|
|
"repo1-s3-key-secret" : {
|
|
"value" : "verySecretKey1"
|
|
},
|
|
"repo1-s3-region" : {
|
|
"value" : "us-east-1"
|
|
},
|
|
"repo1-type" : {
|
|
"value" : "s3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"process-max=4",
|
|
"repo1-azure-account=pgbackrest",
|
|
"repo1-azure-container=demo-container",
|
|
"repo1-azure-key=YXpLZXk=",
|
|
"repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO",
|
|
"repo1-cipher-type=aes-256-cbc",
|
|
"repo1-path=/demo-repo",
|
|
"repo1-retention-diff=2",
|
|
"repo1-retention-full=2",
|
|
"repo1-s3-bucket=demo-bucket",
|
|
"repo1-s3-endpoint=s3.us-east-1.amazonaws.com",
|
|
"repo1-s3-key=accessKey1",
|
|
"repo1-s3-key-secret=verySecretKey1",
|
|
"repo1-s3-region=us-east-1",
|
|
"repo1-type=s3",
|
|
"start-fast=y",
|
|
"",
|
|
"[global:archive-push]",
|
|
"compress-level=3"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"echo \"172.17.0.3 demo-bucket.s3.us-east-1.amazonaws.com s3.us-east-1.amazonaws.com\" | tee -a /etc/hosts"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest repo-create"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-create"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-create command begin 2.32: --exec-id=4511-ee83cd0d --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo",
|
|
"P00 INFO: stanza-create for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-create command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo \\",
|
|
" --log-level-console=info backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"no prior backup exists|full backup size"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: backup command begin 2.32: --exec-id=4548-bb36eeb4 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --process-max=4 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo --start-fast",
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000070000000000000018, lsn = 0/18000028",
|
|
" [filtered 1243 lines of output]",
|
|
"P03 INFO: backup file /var/lib/pgsql/10/data/base/1/12859 (0B, 100%)",
|
|
"P01 INFO: backup file /var/lib/pgsql/10/data/base/1/12854 (0B, 100%)",
|
|
"P00 INFO: full backup size = 29.9MB",
|
|
"P00 INFO: execute non-exclusive pg_stop_backup() and wait for all WAL segments to archive",
|
|
"P00 INFO: backup stop archive = 000000070000000000000018, lsn = 0/18000130",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stop"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stop command begin 2.32: --exec-id=4628-238cca56 --log-level-console=info --log-level-stderr=off --no-log-timestamp --stanza=demo",
|
|
"P00 INFO: stop command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info stanza-delete"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-delete command begin 2.32: --exec-id=4663-8571ace1 --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/demo-repo --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.us-east-1.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --repo1-type=s3 --stanza=demo",
|
|
"P00 INFO: stanza-delete command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "repo1",
|
|
"image" : "pgbackrest/doc:centos8",
|
|
"name" : "repository",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos8",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.6"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo groupadd pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo adduser -gpgbackrest -n pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install postgresql-libs"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /var/log/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 750 /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown pgbackrest:pgbackrest /var/lib/pgbackrest"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest mkdir -m 750 /home/pgbackrest/.ssh"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh-keygen -f /home/pgbackrest/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -m 750 -p /var/lib/pgsql/.ssh"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh-keygen -f /var/lib/pgsql/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@pg-primary cat /var/lib/pgsql/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u pgbackrest tee -a /home/pgbackrest/.ssh/authorized_keys"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@repository cat /home/pgbackrest/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u postgres tee -a /var/lib/pgsql/.ssh/authorized_keys"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh postgres@pg-primary"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh pgbackrest@repository"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"repo1-path" : {
|
|
"value" : "/var/lib/pgbackrest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-host" : {
|
|
"value" : "pg-primary"
|
|
},
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/10/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-retention-full" : {
|
|
"value" : "2"
|
|
},
|
|
"start-fast" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/10/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-file" : {
|
|
"value" : "detail"
|
|
},
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-host" : {
|
|
"value" : "repository"
|
|
}
|
|
}
|
|
},
|
|
"reset" : true
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo stanza-create"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: no prior backup exists, incr backup has been changed to full"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta restore"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"process-max" : {
|
|
"value" : "3"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest info"
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"timestamp start/stop"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"stanza: demo",
|
|
" status: ok",
|
|
" cipher: none",
|
|
"",
|
|
" db (current)",
|
|
" wal archive min/max (10): 00000008000000000000001D/00000008000000000000001E",
|
|
"",
|
|
" full backup: 20210205-170511F",
|
|
" timestamp start/stop: 2021-02-05 17:05:11 / 2021-02-05 17:05:29",
|
|
" wal start/stop: 00000008000000000000001D / 00000008000000000000001D",
|
|
" database size: 29.9MB, database backup size: 29.9MB",
|
|
" repo1: backup set size: 3.5MB, backup size: 3.5MB",
|
|
"",
|
|
" full backup: 20210205-170531F",
|
|
" timestamp start/stop: 2021-02-05 17:05:31 / 2021-02-05 17:05:38",
|
|
" wal start/stop: 00000008000000000000001E / 00000008000000000000001E",
|
|
" database size: 29.9MB, database backup size: 29.9MB",
|
|
" repo1: backup set size: 3.5MB, backup size: 3.5MB"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"err-expect" : "56",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"\\: stop file exists for all stanzas"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-1: [StopError] raised from remote-0 protocol on 'pg-primary': stop file exists for all stanzas",
|
|
"P00 ERROR: [056]: unable to find primary cluster - cannot proceed"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: stop file already exists for all stanzas"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo stop"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo backup"
|
|
],
|
|
"err-expect" : "56",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"\\: stop file exists for stanza demo"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-1: [StopError] raised from remote-0 protocol on 'pg-primary': stop file exists for stanza demo",
|
|
"P00 ERROR: [056]: unable to find primary cluster - cannot proceed"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo start"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"id" : "pg2",
|
|
"image" : "pgbackrest/doc:centos8",
|
|
"name" : "pg-standby",
|
|
"option" : "-v /sys/fs/cgroup:/sys/fs/cgroup:rw -v /tmp/$(mktemp -d):/run",
|
|
"os" : "centos8",
|
|
"update-hosts" : true
|
|
},
|
|
"type" : "host",
|
|
"value" : {
|
|
"ip" : "172.17.0.7"
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo yum install postgresql-libs"
|
|
],
|
|
"cmd-extra" : "-y 2>&1",
|
|
"host" : "build",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo scp build:/build/pgbackrest-release-2.32/src/pgbackrest /usr/bin"
|
|
],
|
|
"cmd-extra" : "2>&1",
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 755 /usr/bin/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 770 /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/log/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p /etc/pgbackrest/conf.d"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo touch /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chmod 640 /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -m 750 -p /var/lib/pgsql/.ssh"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh-keygen -f /var/lib/pgsql/.ssh/id_rsa \\",
|
|
" -t rsa -b 4096 -N \"\""
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@pg-standby cat /var/lib/pgsql/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u pgbackrest tee -a /home/pgbackrest/.ssh/authorized_keys"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"(echo -n 'no-agent-forwarding,no-X11-forwarding,no-port-forwarding,' && \\",
|
|
" echo -n 'command=\"/usr/bin/pgbackrest ${SSH_ORIGINAL_COMMAND#* }\" ' && \\",
|
|
" sudo ssh root@repository cat /home/pgbackrest/.ssh/id_rsa.pub) | \\",
|
|
" sudo -u postgres tee -a /var/lib/pgsql/.ssh/authorized_keys"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : "root"
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest ssh postgres@pg-standby"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres ssh pgbackrest@repository"
|
|
],
|
|
"cmd-extra" : "-o StrictHostKeyChecking=no",
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/10/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"log-level-file" : {
|
|
"value" : "detail"
|
|
},
|
|
"log-level-stderr" : {
|
|
"value" : "off"
|
|
},
|
|
"log-timestamp" : {
|
|
"value" : "n"
|
|
},
|
|
"repo1-host" : {
|
|
"value" : "repository"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -p -m 700 /var/lib/pgsql/10/data"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/recovery.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:05:59",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"standby_mode = 'on'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/10/data/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
},
|
|
"log_filename" : {
|
|
"value" : "'postgresql.log'"
|
|
},
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "replica"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"hot_standby = on",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = replica"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"entering standby mode|database system is ready to accept read only connections"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"LOG: database system was interrupted; last known up at 2021-02-05 17:05:32 UTC",
|
|
"LOG: entering standby mode",
|
|
"LOG: restored log file \"00000008.history\" from archive",
|
|
"LOG: restored log file \"00000008000000000000001E\" from archive",
|
|
"LOG: redo starts at 0/1E000028",
|
|
"LOG: consistent recovery state reached at 0/1E0000F8",
|
|
"LOG: database system is ready to accept read only connections"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" begin; \\",
|
|
" create table replicated_table (message text); \\",
|
|
" insert into replicated_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select * from replicated_table\";"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message ",
|
|
"----------------",
|
|
" Important Data",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select * from replicated_table;\""
|
|
],
|
|
"err-expect" : "1",
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"does not exist"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ERROR: relation \"replicated_table\" does not exist",
|
|
"LINE 1: select * from replicated_table;",
|
|
" ^"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"select *, current_timestamp from pg_switch_wal()\";"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" pg_switch_wal | current_timestamp ",
|
|
"---------------+-------------------------------",
|
|
" 0/1F02B9F8 | 2021-02-05 17:06:04.510654+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select *, current_timestamp from replicated_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | current_timestamp ",
|
|
"----------------+-------------------------------",
|
|
" Important Data | 2021-02-05 17:06:07.384352+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"because this is a standby"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=1258-d1f451a2 --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-host=repository --stanza=demo",
|
|
"P00 INFO: check repo1 (standby)",
|
|
"P00 INFO: switch wal not performed because this is a standby",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" create user replicator password 'jw8s0F4' replication\";"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"CREATE ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'echo \\",
|
|
" \"host replication replicator 172.17.0.7/32 md5\" \\",
|
|
" >> /var/lib/pgsql/10/data/pg_hba.conf'"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl reload postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"recovery-option" : {
|
|
"value" : "primary_conninfo=host=172.17.0.5 port=5432 user=replicator"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'echo \\",
|
|
" \"172.17.0.5:*:replication:replicator:jw8s0F4\" \\",
|
|
" >> /var/lib/pgsql/.pgpass'"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres chmod 600 /var/lib/pgsql/.pgpass"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --delta --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/recovery.conf"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"# Recovery settings generated by pgBackRest restore on 2021-02-05 17:06:11",
|
|
"primary_conninfo = 'host=172.17.0.5 port=5432 user=replicator'",
|
|
"restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'",
|
|
"standby_mode = 'on'"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/10/data/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"hot_standby = on",
|
|
"log_filename = 'postgresql.log'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"wal_level = replica"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-10.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/lib/pgsql/10/data/log/postgresql.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"started streaming WAL from primary"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 6 lines of output]",
|
|
"LOG: database system is ready to accept read only connections",
|
|
"LOG: restored log file \"00000008000000000000001F\" from archive",
|
|
"LOG: started streaming WAL from primary at 0/20000000 on timeline 8"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" begin; \\",
|
|
" create table stream_table (message text); \\",
|
|
" insert into stream_table values ('Important Data'); \\",
|
|
" commit; \\",
|
|
" select *, current_timestamp from stream_table\";"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | current_timestamp ",
|
|
"----------------+------------------------------",
|
|
" Important Data | 2021-02-05 17:06:16.02786+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select *, current_timestamp from stream_table\""
|
|
],
|
|
"highlight" : {
|
|
"filter" : false,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Important Data"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" message | current_timestamp ",
|
|
"----------------+-------------------------------",
|
|
" Important Data | 2021-02-05 17:06:16.217927+00",
|
|
"(1 row)"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 750 /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo mkdir -p -m 750 /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo chown postgres:postgres /var/spool/pgbackrest"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"global" : {
|
|
"archive-async" : {
|
|
"value" : "y"
|
|
},
|
|
"spool-path" : {
|
|
"value" : "/var/spool/pgbackrest"
|
|
}
|
|
},
|
|
"global:archive-get" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
},
|
|
"global:archive-push" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"global" : {
|
|
"archive-async" : {
|
|
"value" : "y"
|
|
},
|
|
"spool-path" : {
|
|
"value" : "/var/spool/pgbackrest"
|
|
}
|
|
},
|
|
"global:archive-get" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
},
|
|
"global:archive-push" : {
|
|
"process-max" : {
|
|
"value" : "2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"alter user replicator password 'bogus'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ALTER ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl restart postgresql-10.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres rm -f /var/log/pgbackrest/demo-archive-push-async.log"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \" \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal(); \\",
|
|
" select pg_create_restore_point('test async push'); select pg_switch_wal();\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"WAL segment"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: check command begin 2.32: --exec-id=5914-6abe9131 --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --repo1-host=repository --stanza=demo",
|
|
"P00 INFO: check repo1 configuration (primary)",
|
|
"P00 INFO: check repo1 archive for WAL (primary)",
|
|
"P00 INFO: WAL segment 000000080000000000000025 successfully archived to '/var/lib/pgbackrest/archive/demo/10-1/0000000800000000/000000080000000000000025-c788c16b50d921f1cf54c5026367f023ecd5a899.gz' on repo1",
|
|
"P00 INFO: check command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/pgbackrest/demo-archive-push-async.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
" WAL file\\(s\\) to archive|pushed WAL file \\'0000000"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/pgsql/10/data/pg_wal] --archive-async --exec-id=5872-8f3adca6 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000020",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000020' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully",
|
|
"",
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/pgsql/10/data/pg_wal] --archive-async --exec-id=5916-43991865 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 4 WAL file(s) to archive: 000000080000000000000021...000000080000000000000024",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000021' to the archive",
|
|
"P02 DETAIL: pushed WAL file '000000080000000000000022' to the archive",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000023' to the archive",
|
|
"P02 DETAIL: pushed WAL file '000000080000000000000024' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully",
|
|
"",
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-push:async command begin 2.32: [/var/lib/pgsql/10/data/pg_wal] --archive-async --exec-id=5928-ad4fcb29 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000025",
|
|
"P01 DETAIL: pushed WAL file '000000080000000000000025' to the archive",
|
|
"P00 INFO: archive-push:async command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 5"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres cat /var/log/pgbackrest/demo-archive-get-async.log"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"found [0-F]{24} in the .* archive"
|
|
]
|
|
},
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"-------------------PROCESS START-------------------",
|
|
"P00 INFO: archive-get:async command begin 2.32: [00000008000000000000001E, 00000008000000000000001F, 000000080000000000000020, 000000080000000000000021, 000000080000000000000022, 000000080000000000000023, 000000080000000000000024, 000000080000000000000025] --archive-async --exec-id=1883-686d54dd --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: get 8 WAL file(s) from archive: 00000008000000000000001E...000000080000000000000025",
|
|
"P01 DETAIL: found 00000008000000000000001E in the repo1:10-1 archive",
|
|
"P02 DETAIL: found 00000008000000000000001F in the repo1:10-1 archive",
|
|
"P00 DETAIL: unable to find 000000080000000000000020 in the archive",
|
|
"P00 INFO: archive-get:async command end: completed successfully",
|
|
" [filtered 8 lines of output]",
|
|
"P00 INFO: archive-get:async command begin 2.32: [000000080000000000000020, 000000080000000000000021, 000000080000000000000022, 000000080000000000000023, 000000080000000000000024, 000000080000000000000025, 000000080000000000000026, 000000080000000000000027] --archive-async --exec-id=1937-c6a78bc1 --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/10/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo",
|
|
"P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000020...000000080000000000000027",
|
|
"P01 DETAIL: found 000000080000000000000020 in the repo1:10-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000021 in the repo1:10-1 archive",
|
|
"P01 DETAIL: found 000000080000000000000022 in the repo1:10-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000023 in the repo1:10-1 archive",
|
|
"P01 DETAIL: found 000000080000000000000024 in the repo1:10-1 archive",
|
|
"P02 DETAIL: found 000000080000000000000025 in the repo1:10-1 archive",
|
|
"P00 DETAIL: unable to find 000000080000000000000026 in the archive",
|
|
"P00 INFO: archive-get:async command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres psql -c \"alter user replicator password 'jw8s0F4'\""
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"ALTER ROLE"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg2-host" : {
|
|
"value" : "pg-standby"
|
|
},
|
|
"pg2-path" : {
|
|
"value" : "/var/lib/pgsql/10/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/10/data",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/pgsql/10/data",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=y",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --log-level-console=detail backup"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"backup file pg-primary|replay on the standby"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 2 lines of output]",
|
|
"P00 INFO: execute non-exclusive pg_start_backup(): backup begins after the requested immediate checkpoint completes",
|
|
"P00 INFO: backup start archive = 000000080000000000000027, lsn = 0/27000028",
|
|
"P00 INFO: wait for replay on the standby to reach 0/27000028",
|
|
"P00 INFO: replay on the standby reached 0/27000028",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/10/data/global/pg_control (8KB, 0%) checksum 81c0ff405e2d5baac4df9603bfc4a9cbfc7e309e",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/10/data/log/postgresql.log (6.9KB, 0%) checksum b2c1c1ffe1096c52ba9ef71801d1a842e74434cf",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/10/data/pg_hba.conf (4.2KB, 0%) checksum 12abee43e7eabfb3ff6239f3fc9bc3598293557d",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/10/data/current_logfiles (26B, 0%) checksum 78a9f5c10960f0d91fcd313937469824861795a2",
|
|
"P01 INFO: backup file pg-primary:/var/lib/pgsql/10/data/pg_logical/replorigin_checkpoint (8B, 0%) checksum 347fc8f2df71bd4436e38bd1516ccd7ea0d46532",
|
|
"P02 INFO: backup file pg-standby:/var/lib/pgsql/10/data/base/13017/2608 (440KB, 19%) checksum e1e9bb6f3887b8d93fe7ba21f3989b2f830a910b",
|
|
"P03 INFO: backup file pg-standby:/var/lib/pgsql/10/data/base/13017/1249 (392KB, 36%) checksum 00bca71c5a5cd89d03422c357c3bab5c16b4e9a9",
|
|
" [filtered 1254 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl stop postgresql-10.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres /usr/pgsql-11/bin/initdb \\",
|
|
" -D /var/lib/pgsql/11/data -k -A peer"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sh -c 'cd /var/lib/pgsql && \\",
|
|
" /usr/pgsql-11/bin/pg_upgrade \\",
|
|
" --old-bindir=/usr/pgsql-10/bin \\",
|
|
" --new-bindir=/usr/pgsql-11/bin \\",
|
|
" --old-datadir=/var/lib/pgsql/10/data \\",
|
|
" --new-datadir=/var/lib/pgsql/11/data \\",
|
|
" --old-options=\" -c config_file=/var/lib/pgsql/10/data/postgresql.conf\" \\",
|
|
" --new-options=\" -c config_file=/var/lib/pgsql/11/data/postgresql.conf\"'"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"Upgrade Complete"
|
|
]
|
|
},
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
" [filtered 69 lines of output]",
|
|
"Creating script to delete old cluster ok",
|
|
"",
|
|
"Upgrade Complete",
|
|
"----------------",
|
|
"Optimizer statistics are not transferred by pg_upgrade so,",
|
|
" [filtered 4 lines of output]"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/11/data/postgresql.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"archive_command" : {
|
|
"value" : "'pgbackrest --stanza=demo archive-push %p'"
|
|
},
|
|
"archive_mode" : {
|
|
"value" : "on"
|
|
},
|
|
"listen_addresses" : {
|
|
"value" : "'*'"
|
|
},
|
|
"log_line_prefix" : {
|
|
"value" : "''"
|
|
},
|
|
"max_wal_senders" : {
|
|
"value" : "3"
|
|
},
|
|
"port" : {
|
|
"value" : "5432"
|
|
},
|
|
"wal_level" : {
|
|
"value" : "replica"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"archive_command = 'pgbackrest --stanza=demo archive-push %p'",
|
|
"archive_mode = on",
|
|
"listen_addresses = '*'",
|
|
"log_line_prefix = ''",
|
|
"max_wal_senders = 3",
|
|
"port = 5432",
|
|
"wal_level = replica"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-primary",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/11/data"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/11/data",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/11/data"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-path=/var/lib/pgsql/11/data",
|
|
"recovery-option=primary_conninfo=host=172.17.0.5 port=5432 user=replicator",
|
|
"",
|
|
"[global]",
|
|
"archive-async=y",
|
|
"log-level-file=detail",
|
|
"repo1-host=repository",
|
|
"spool-path=/var/spool/pgbackrest",
|
|
"",
|
|
"[global:archive-get]",
|
|
"process-max=2",
|
|
"",
|
|
"[global:archive-push]",
|
|
"process-max=2"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"demo" : {
|
|
"pg1-path" : {
|
|
"value" : "/var/lib/pgsql/11/data"
|
|
},
|
|
"pg2-path" : {
|
|
"value" : "/var/lib/pgsql/11/data"
|
|
}
|
|
},
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "n"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/11/data",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/pgsql/11/data",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=n",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo cp /var/lib/pgsql/10/data/pg_hba.conf \\",
|
|
" /var/lib/pgsql/11/data/pg_hba.conf"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --no-online \\",
|
|
" --log-level-console=info stanza-upgrade"
|
|
],
|
|
"highlight" : {
|
|
"filter" : true,
|
|
"filter-context" : 2,
|
|
"list" : [
|
|
"completed successfully"
|
|
]
|
|
},
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 INFO: stanza-upgrade command begin 2.32: --no-backup-standby --exec-id=2711-ec347ccb --log-level-console=info --log-level-stderr=off --no-log-timestamp --no-online --pg1-host=pg-primary --pg2-host=pg-standby --pg1-path=/var/lib/pgsql/11/data --pg2-path=/var/lib/pgsql/11/data --repo1-path=/var/lib/pgbackrest --stanza=demo",
|
|
"P00 INFO: stanza-upgrade for stanza 'demo' on repo1",
|
|
"P00 INFO: stanza-upgrade command end: completed successfully"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-11.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres systemctl status postgresql-11.service"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"● postgresql-11.service - PostgreSQL 11 database server",
|
|
" Loaded: loaded (/usr/lib/systemd/system/postgresql-11.service; disabled; vendor preset: disabled)",
|
|
" Active: active (running) since Fri 2021-02-05 17:06:43 UTC; 173ms ago",
|
|
" Docs: https://www.postgresql.org/docs/11/static/",
|
|
" Process: 6485 ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)",
|
|
" Main PID: 6490 (postmaster)",
|
|
" Tasks: 9 (limit: 25078)",
|
|
" Memory: 18.3M",
|
|
" CGroup: /system.slice/containerd.service/system.slice/postgresql-11.service",
|
|
" ├─6490 /usr/pgsql-11/bin/postmaster -D /var/lib/pgsql/11/data/",
|
|
" ├─6491 postgres: logger ",
|
|
" ├─6493 postgres: checkpointer ",
|
|
" ├─6494 postgres: background writer ",
|
|
" ├─6495 postgres: walwriter ",
|
|
" ├─6496 postgres: autovacuum launcher ",
|
|
" ├─6497 postgres: archiver ",
|
|
" ├─6498 postgres: stats collector ",
|
|
" └─6499 postgres: logical replication launcher "
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm -rf /var/lib/pgsql/10/data"
|
|
],
|
|
"host" : "pg-primary",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo rm -rf /var/lib/pgsql/10/data"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres mkdir -p -m 700 /usr/pgsql-11/bin"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe",
|
|
"value" : {
|
|
"output" : [
|
|
"P00 WARN: unable to check pg-2: [DbConnectError] raised from remote-0 protocol on 'pg-standby': unable to connect to 'dbname='postgres' port=5432': could not connect to server: No such file or directory",
|
|
" \tIs the server running locally and accepting",
|
|
" \tconnections on Unix domain socket \"/var/run/postgresql/.s.PGSQL.5432\"?"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup"
|
|
],
|
|
"host" : "repository",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo --type=standby restore"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/var/lib/pgsql/11/data/postgresql.conf",
|
|
"host" : "pg-standby",
|
|
"option" : {
|
|
"hot_standby" : {
|
|
"value" : "on"
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-postgresql",
|
|
"value" : {
|
|
"config" : [
|
|
"hot_standby = on"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo systemctl start postgresql-11.service"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres sleep 2"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : false,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"bash-wrap" : true,
|
|
"cmd" : [
|
|
"sudo -u postgres pgbackrest --stanza=demo check"
|
|
],
|
|
"host" : "pg-standby",
|
|
"load-env" : true,
|
|
"output" : true,
|
|
"run-as-user" : null
|
|
},
|
|
"type" : "exe"
|
|
},
|
|
{
|
|
"key" : {
|
|
"file" : "/etc/pgbackrest/pgbackrest.conf",
|
|
"host" : "repository",
|
|
"option" : {
|
|
"global" : {
|
|
"backup-standby" : {
|
|
"value" : "y"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"type" : "cfg-pgbackrest",
|
|
"value" : {
|
|
"config" : [
|
|
"[demo]",
|
|
"pg1-host=pg-primary",
|
|
"pg1-path=/var/lib/pgsql/11/data",
|
|
"pg2-host=pg-standby",
|
|
"pg2-path=/var/lib/pgsql/11/data",
|
|
"",
|
|
"[global]",
|
|
"backup-standby=y",
|
|
"process-max=3",
|
|
"repo1-path=/var/lib/pgbackrest",
|
|
"repo1-retention-full=2",
|
|
"start-fast=y"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|