Guest User

Untitled

a guest
Dec 13th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. sudo -u postgres initdb -D /data/postgres/main
  2.  
  3. listen_addresses = '*'
  4. wal_level = hot_standby
  5. max_wal_senders = 2
  6. logging_collector = on
  7. max_wal_senders = 5
  8.  
  9. host replication replica 10.0.0.2/32 md5
  10.  
  11. service postgresql start
  12.  
  13. CREATE USER replica WITH REPLICATION ENCRYPTED PASSWORD '123456';
  14.  
  15. SELECT pg_create_physical_replication_slot('standby_slot');
  16.  
  17. pg_basebackup -h 10.0.0.1 -U replica -D /db/postgres/main -X s -P
  18.  
  19. hot_standby = on
  20.  
  21. standby_mode = 'on'
  22. primary_conninfo = 'host=10.0.0.1 port=5432 user=replica password=123456'
  23. primary_slot_name = 'standby_slot'
  24. trigger_file = 'trigger'
  25.  
  26. service postgresql start
  27.  
  28. service postgresql stop
  29.  
  30. SELECT pg_backup_start('backup', true);
  31.  
  32. SELECT pg_backup_stop();
  33.  
  34. NOTICE: WAL archiving is not enabled; you must ensure that all required WAL segments are copied through other means to complete the backup
  35.  
  36. FATAL: could not locate required checkpoint record
Add Comment
Please, Sign In to add comment