Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Postgresql Backup via Barman backup at Muthoot group
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Installation process== please install barman on backup server i.e 192.168.1.132 Download the Rpm pakages from Sourceforge wget http://downloads.sourceforge.net/project/pgbarman/1.1.1/barman-1.1.1-1.rhel6.noarch.rpm wget http://downloads.sourceforge.net/project/pgbarman/rhel6-deps/python-argh-0.15.0-1.rhel6.noarch.rpm Satisfy it dependecies yum install python-argh yum install python-argparse yum install python-psycopg2 Install the Rpms rpm -Uvh python-argh-0.15.0-1.rhel6.noarch.rpm barman-1.1.1-1.rhel6.noarch.rpm Build Password less setup SSH Password less bi-direction setup for postgres ( 192.168.1.133 ) and barman( 192.168.1.132 ) user You should be able to login on ssh from .133 with user postgres to .132 on barman user without password and Visa-Versa Set the following in /etc/barman.conf [barman] ; Main directory barman_home = /var/lib/barman ; System user barman_user = barman ; Log location log_file = /var/log/barman/barman.log ; Default compression level: possible values are None (default), bzip2, gzip or custom compression = gzip ; Pre/post backup hook scripts ;pre_backup_script = env | grep ^BARMAN ;post_backup_script = env | grep ^BARMAN ;; ; 'main' PostgreSQL Server configuration [main] ;; ; Human readable description description = "Main PostgreSQL Database" ;; ;; ; SSH options ssh_command = ssh postgres@192.168.1.133 ;; ;; ; PostgreSQL connection string conninfo = host=192.168.1.133 user=postgres Also Ensure that .132 is trusted on main postgresql server .133 by adding the line in pg_hba.conf host all all 192.168.1.132/32 trust and Reload the config via pg_ctl reload Make archieve on postgres server (.133) in postgresql.conf archive_mode = on archive_command = 'rsync -a %p barman@backup:INCOMING_WALS_DIRECTORY/%f' Make sure you change the INCOMING_WALS_DIRECTORY placeholder with the value returned by the ''barman show-server main'' command (.132 via barman user) above. In Our case it is /var/lib/barman/main/incoming/ Restart the Postgresql Server ( reloading will not help ) Now Check the status on barman server (.132) barman show-server main It should show something like below Server main: active: true description: Main PostgreSQL Database ssh_command: ssh postgres@192.168.1.133 conninfo: host=192.168.1.133 user=postgres backup_directory: /var/lib/barman/main basebackups_directory: /var/lib/barman/main/base wals_directory: /var/lib/barman/main/wals incoming_wals_directory: /var/lib/barman/main/incoming lock_file: /var/lib/barman/main/main.lock compression: gzip custom_compression_filter: None custom_decompression_filter: None retention_policy: None wal_retention_policy: None pre_backup_script: None post_backup_script: None current_xlog: 00000001000000010000000E last_shipped_wal: None archive_command: rsync -a %p barman@192.168.1.132:/var/lib/barman/main/incoming/%f server_txt_version: 8.4.13 data_directory: /var/lib/pgsql/data archive_mode: on config_file: /var/lib/pgsql/data/postgresql.conf hba_file: /var/lib/pgsql/data/pg_hba.conf ident_file: /var/lib/pgsql/data/pg_ident.conf Checking the barman server barman check main Server main: ssh: OK PostgreSQL: OK archive_mode: OK archive_command: OK directories: OK compression settings: OK In our case we have linked the main diecrtory of /var/lib/barman to /home/postreg_barman_backup/main as the home partion is very big to hold the backups ln -s /home/postreg_barman_backup/main /var/lib/barman/
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)