Show
Ignore:
Timestamp:
12/04/09 17:24:04 (4 years ago)
Author:
depesz
Message:

rethinking what we can do and how, add support for compression, remove support for various methods for remote transfer - rsync handles everything.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/omnipitr/doc/omnipitr-archive.pod

    r57 r58  
    1616 
    1717Where to copy the wal segment on current server (path) (you can provide many of 
    18 these) 
     18these). 
     19 
     20You can also specify compression per-destination. Check L<COMPRESSION> 
     21section of the doc. 
    1922 
    2023=item --dst-remote (-dr) 
     
    2427information (you can provide many of these) 
    2528 
    26 =item --rsync-binary (-r) 
    27  
    28 Where to find rsync binary (defaults to searching through I<$PATH> environment 
    29 variable) 
     29You can also specify compression per-destination. Check L<COMPRESSION> 
     30section of the doc. 
    3031 
    3132=item --tempdir (-t) 
     
    108109=head3 Remote destination specification 
    109110 
    110 I<omnipitr-archive> can deliver WAL segments to remote locations using 2 ways of 
    111 transporting the file: 
    112  
    113 =over 
    114  
    115 =item 1. rsync 
    116  
    117 Standard rsync via rsync daemon (not via ssh!). You can specify remote url like 
    118 this: C<rsync://remote_server/module/directory/> or any other syntax I<rsync> 
    119 program supports as long as it starts with B<rsync://> 
    120  
    121 =item 2. rsync over ssh 
    122  
    123 Rsync working via ssh. This required passwordless ssh authentication from source 
    124 account to destination (usually with passwordless ssh keys). Url for remote in 
    125 this situation should look like this: C<rsync+ssh://server/path/> - this is 
    126 equivalent to using C<rsync -e ssh SOURCE_FILE server/path/> 
     111I<omnipitr-archive> delivers WAL segments to destination using rsync program. 
     112Both direct-rsync and rsync-over-ssh are supported (it's better to use direct 
     113rsync - it uses less resources due to lack of encryption. 
     114 
     115Destination url/location should be in a format that is usable by I<rsync> 
     116program. 
     117 
     118For example you can use: 
     119 
     120=over 
     121 
     122=item * rsync://user@remote_host/module/path/ 
     123 
     124=item * host:/path/ 
     125 
     126=back 
     127 
     128To allow remote delivery you need to have rsync program. In case you're using 
     129rsync over ssh, program has also to be available. 
     130 
     131In case your rsync/ssh programs are in custom directories simply set I<$PATH> 
     132environemnt variable before starting PostgreSQL. 
     133 
     134=head2 COMPRESSION 
     135 
     136Every destination can have specified compression. To use it you should prefix 
     137destination path/url with compression type followed by '%' sign. 
     138 
     139Allowed compression types: 
     140 
     141=over 
     142 
     143=item * gzip 
     144 
     145Compresses with gzip program, used file extension is .gz 
     146 
     147=item * bzip2 
     148 
     149Compresses with bzip2 program, used file extension is .bz2 
     150 
     151=item * lzma 
     152 
     153Compresses with lzma program, used file extension is .lzma 
     154 
     155=back 
     156 
     157All compressions are done I<on B<NICE>> to make the operation as unobtrusive as 
     158possible. 
     159 
     160If you want to pass any extra arguments to compression program, you can either: 
     161 
     162=over 
     163 
     164=item * make a wrapper 
     165 
     166Write a program/script that will be named in the same way your actual 
     167compression program is named, but adding some parameters to call 
     168 
     169=item * use environment variables 
     170 
     171All of supported compression programs use environment variables: 
     172 
     173=over 
     174 
     175=item * gzip - GZIP 
     176 
     177=item * bzip2 - BZIP2 
     178 
     179=item * lzma - XZ_OPT 
     180 
     181=back 
     182 
     183For details - please consult manual to your choosen compression tool. 
    127184 
    128185=back 
     
    138195    archive_command='/.../omnipitr-archive -D /mnt/data/ -l /var/log/omnipitr/archive.log -dr rsync://slave/postgres/wal_archive/ "%p"' 
    139196 
    140 =head3 2 remote destinations, 1 local, with non-standard rsync binary, and auto 
    141 rotated logfile: 
    142  
    143     archive_command='/.../omnipitr-archive -r /opt/something/bin/rsync -D /mnt/data/ -l /var/log/omnipitr/archive-%Y-%m-%d.log -dr rsync://slave/postgres/wal_archive/ -dr rsync+ssh://backups@backupserver:/mnt/backups/wal_archive/ -s /var/lib/postgres/.omnipitr/ "%p"' 
     197=head3 2 remote, compressed destinations, 1 local, with auto rotated logfile: 
     198 
     199    archive_command='/.../omnipitr-archive -D /mnt/data/ -l /var/log/omnipitr/archive-%Y-%m-%d.log -dr gzip%rsync://slave/postgres/wal_archive/ -dr bzip2%backups@backupserver:/mnt/backups/wal_archive/ -dl /mnt/wal_archive/ -s /var/lib/postgres/.omnipitr/ "%p"' 
    144200 
    145201=head2 COPYRIGHT