Guest User

Postgres config

a guest
Sep 4th, 2018
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Stop postgres service on master and slave
  2. Right click postgres service -> properties->LogOn-> browse and set the domain as root or vrtxengg(for us) and set password to postgres
  3.  
  4. Master:
  5.  
  6. 1 .In postgres.conf
  7. set wal_level to hot_standby
  8. max_wal_ssenders to 1
  9. wal_keep_argument to 10
  10. archieve_mode to on
  11. archieve_command to ' copy “%p” “\\\\(salve IpAddress)\\(Slave restore folder – split by \\ )\\%f” '
  12. 2. Hba.conf
  13. add the ip for everyone to see
  14.  
  15. Slave:
  16.  
  17. 1. postgres.conf
  18. hot_standby to on
  19.  
  20. 2. Create new file in postgres\data folder and rename to recovery.conf
  21. Enter
  22. restore_command = ' copy “\\\\(slave IPAddress)\\(Slave restore folder – split by \\ )\\%f” “%p” '
  23. standby_mode = on
  24. primary_conninfo = ' host =(masterIP) port = 5432 user=postgres password=postgres '
  25.  
  26. Start master
  27.  
  28. Go to postgres bin dir and start command prompt
  29. type psql -U postgres
  30. give password as postgres
  31. Type select pg_start_backup('base');
  32.  
  33.  
  34. From master copy all the files and folders in data directory except .conf and .pid files
  35.  
  36. Paste to slave data folder
  37.  
  38. In master, in the opened command prompt type
  39. select pg_stop_backup();
  40.  
  41. Now start the client postgres
Add Comment
Please, Sign In to add comment