root/trunk/omnipitr/doc/install.pod

Revision 65, 3.9 kB (checked in by depesz, 4 years ago)

a word on logfiles, umask and state directories

Line 
1 =head1 OmniPITR - Installation
2
3 =head2 INSTALLATION
4
5 You can get the OmniPITR project from L<https://labs.omniti.com/pgsoltools/trunk/omnipitr>. Within this directory you will find set of directories:
6
7 =over
8
9 =item * bin/
10
11 This is where the scripts reside - usually this is the only place you need to
12 look into.
13
14 =item * doc/
15
16 Documentation. In Plain Old Documentation format, so you can view it practically
17 everywhere Perl is with I<perldoc> command.
18
19 =item * lib/
20
21 Here be dragons. Don't look. Don't touch. Be afraid.
22
23 =back
24
25 After fetching the omnipitr project/directory, put it in any place in your
26 filesystem you'd want. Usually you will keep all of these together, but you can
27 always remove the docs, put the scripts in some system bin/ directory, and put
28 libs anyplace you want - just make sure that path to them is in I<PERL5LIB>
29 environment variable.
30
31 In case you will not decide to split the distribution - i.e. you will have
32 someplace in your system I<omnipitr> directory, which will contain I<bin/> and
33 I<lib/> directories (just like it is distributed) - you don't have to set
34 I<PERL5LIB> - scripts will automatically find their libs.
35
36 =head2 SANITY CHECK
37
38 After installation it's good to run I<sanity-check.sh> script (from I<bin/>)
39 directory - it will check if all prerequisites are available.
40
41 Output might look like this:
42
43     postgres@server:~$ omnipitr/bin/sanity-check.sh
44     Checking:
45     - /var/lib/postgres/omnipitr/bin
46     - /var/lib/postgres/omnipitr/lib
47     5 programs, 7 libraries.
48     All checked, and looks ok.
49
50 or like this:
51
52     postgres@server:~$ omnipitr/bin/sanity-check.sh
53     Checking:
54     - /var/lib/postgres/omnipitr/bin
55     - /var/lib/postgres/omnipitr/lib
56     5 programs, 7 libraries.
57     Warnings:
58     - you don't have ssh program available
59     - you don't have rsync program available
60     - your Perl is old (we support only 5.8 or newer. OmniPITR might work, but was not tested on your version of Perl)
61     Errors:
62     - you don't have any of programs used to transmit WAL files (ssh, rsync)
63     - you don't have POSIX Perl library (should be installed together with Perl)
64     All checked. 3 warnings, 2 errors.
65
66 Depending on your particular usecase even the errors don't have to be fatal -
67 for example, if your I<rsync>/I<ssh> binary is in directory that is not in
68 I<$PATH> - it will not be found by sanity-check.sh, but you can always provide
69 paths to them via I<--rsync-binary> or I<--ssh-binary> options to I<omnipitr-*>
70 scripts.
71
72 After I<sanity-check.sh> returned C<All checked, and looks ok.> you should be
73 good with starting using the scripts.
74
75 =head2 INITIAL SETUP
76
77 To start Wal replication you will need to:
78
79 =over
80
81 =item 1. Start archiving wal segments: I<omnipitr-archive>
82
83 =item 2. Make initial hot backup on master: I<omnipitr-master-backup>
84
85 =item 3. Transfer the backup to slave server(s)
86
87 =item 4. Start PostgreSQL recovery from hot-backup: I<omnipitr-restore>
88
89 =back
90
91 Afterwards you can/should monitor replication parameters with
92 I<omnipitr-monitor>, and that would be all. Of course you can do hot-backups on
93 slave (with I<omnipitr-slave-backup>) at any moment - just remember that doing
94 them on slave requires more disc space - details in
95 I<omnipitr-slave-backup.pod>.
96
97 =head2 HINTS
98
99 It is technically possible, and suggested to use the same logfiles for all
100 programs running on given server.
101
102 That is - you can setup archival to log to "archive.log" and backup to log to
103 "backup.log", but you can make them both log to "omnipitr.log" - it will not
104 break anything, and makes it simpler to manage log files.
105
106 Same thing applies to state directories - these can be the same between various
107 programs from I<OmniPITR> package.
108
109 When creating any files I<OmniPITR> obeys ulimit, but doesn't enforce any
110 additional restrictions. So, if you'd like it to create files that are readable
111 only to owner, simply run it like this:
112
113     umask 0077; omnipitr-something ....
114
115 =head2 COPYRIGHT
116
117 The OmniPITR project is Copyright (c) 2009 OmniTI. All rights reserved.
118
Note: See TracBrowser for help on using the browser.