Difference between revisions of "GitLab"

229 bytes removed ,  22:44, 6 March 2020
no edit summary
(→‎Backup: update for postgresql 11)
Line 47: Line 47:
Backup server is provided by Manu (KVM virtual machine with 100 GB storage and 1 GB ram). Running on debian gnu/linux 10 buster.  
Backup server is provided by Manu (KVM virtual machine with 100 GB storage and 1 GB ram). Running on debian gnu/linux 10 buster.  


Documentation: https://linuxhint.com/setup_postgresql_replication/
Documentation: https://linuxhint.com/setup_postgresql_replication/ and https://www.percona.com/blog/2018/09/07/setting-up-streaming-replication-postgresql/


===Slave configuration: Step 1===
===Slave configuration: Step 1===
Line 134: Line 134:


  # systemctl restart postgresql
  # systemctl restart postgresql
Start the backup process,
psql -c "select pg_start_backup('initial_backup');"
rsync -cva -e 'ssh -p 12022' --inplace --exclude=*pg_xlog* /var/lib/postgresql/11/main/ 62.210.83.200:/var/lib/postgresql/11/main/
psql -c "select pg_stop_backup();"


Open 5432 port in the firewall
Open 5432 port in the firewall
Line 146: Line 140:


===Slave Configuration: Step 2===
===Slave Configuration: Step 2===
Create a recovery file called  recovery.conf and add following lines.
 
  standby_mode = 'on'
Copy data from master and create recovery.conf
primary_conninfo = 'host=213.167.243.152 port=5432 user=rep password=yourpassword'
  $ pg_basebackup -h git.fosscommunity.in -D /var/lib/postgresql/11/main/ -P -U rep --wal-method=fetch -R
  trigger_file = '/tmp/postgresql.trigger.5432'


Start the slave server
Start the slave server