archive
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 9 Sep 2021 18:00:52 +0000 (20:00 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 9 Sep 2021 18:00:52 +0000 (20:00 +0200)
db.txt
edozvola-db-0x.txt

diff --git a/db.txt b/db.txt
index bcf6395..9e30e12 100644 (file)
--- a/db.txt
+++ b/db.txt
@@ -105,10 +105,14 @@ archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/arch
 
 
 [root@slave 10]# mkdir -p /var/lib/pgsql/10/archive/
+chown postgres:postgres /var/lib/pgsql/10/archive/
 
 vi /var/lib/pgsql/10/data/postgresql.conf
 i
-archive_mode = on               # enables archiving; off, on, or always
+
+# https://www.postgresql.org/docs/10/warm-standby.html#CONTINUOUS-ARCHIVING-IN-STANDBY
+
+archive_mode = always               # enables archiving; off, on, or always
 archive_command = 'test ! -f /var/lib/pgsql/10/archive/%f && cp %p /var/lib/pgsql/10/archive/%f'
 
 
@@ -118,6 +122,12 @@ dpavlin=# insert into test(t) select i from generate_series(100, 150) as i ;
 
 
 
+dpavlin=# SELECT pg_start_backup('label', false, false);
+
+SELECT * FROM pg_stop_backup(false, true);
+
+
+
 
 [root@slave 10]# mkdir /var/lib/pgsql/10/archive.base/
 
index abf71a6..0e18989 100644 (file)
@@ -52,5 +52,5 @@ host    all             all             10.200.1.60/32           trust
 \r
 systemctl enable postgresql-9.6\r
 systemctl start postgresql-9.6\r
-   \r
-reboot
\ No newline at end of file
+\r
+reboot\r