summaryrefslogtreecommitdiff
path: root/README.md
blob: 00d663dbe340c7b89851483694b11ae69bcc4c48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
pgpool-ha 3.x
=============

pgpool-ha is an OCF style Resource Agent for pgpool-II.

install
-------

 $ su 
 # install -m 0755 -o root -g root \
     ./pgpool.in  /usr/lib/ocf/resource.d/heartbeat/pgpool


usage
-----

OCF parameters are as below.

### pgpoolconf

Specifies the path of pgpool.conf. (default: /usr/local/etc/pgpool.conf)

### pcpconf

Specifies the path of pcp.conf. (default: empty)

### hbaconf

Specifies the path of pool_hba.conf. (default: empty)

### logfile

Specifies the log output. (default: empty)

You can set a file path for redirection or a program for pipeline processing.
The value start with "|" is recognized as a program.
Parameter "-n" is added to pgpool implicitly if some value is set into this.
The example are as follows:

     "/var/log/pgpool.log"
     "| logger -t pgpool -p local3.info"

### options

Specifies pgpool's starting options. (default: empty)

"-D" is recommended if pgpool_status file is not in shared space.
"-n", "-f", "-a" and "-F" shouldn't be included, since these are
used implicitly by other parameters.

### pgpooluser

Specifies the user to run the pgpool process. (default: postgres)

### checkmethod

Specifies monitoring method. (default: pid)

Possible values are as follows:

     "pid"    check by process existence.
     "pcp"    check by pcp_node_count command.
     "psql"   check by psql or pg_isready command.

### checkstring

Specifies the details for the monitoring method.
This parameter means differently by checkmethod setting.

When checkmetod is "pid", this means pid file path.
The default value is pid_file_name setting in pgpool.conf.

When checkmetod is "pcp", this means parameters for pcp_node_count command.
The default value is "10 localhost 9898 postgres pass".
"-w -h localhost -p 9898" is a good idea for 3.5.x and later version,
for the response 'authentication failed' is considered success.

When checkmetod is "psql", this means parameters for psql or other command
which is specified in psqlcmd parameter.
The default value is "-U postgres -h localhost -l -p 9999".
"-U postgres -h localhost -p 9999" is a good idea when you use pg_isready.

### psqlcmd

Specifies the path of psql or pg_isready command.

### pgpoolcmd

Specifies the path of pgpool command.

### pcpnccmd

Specifies the path of pcp_node_count command.


crm samples
-----------

simple process check:

    primitive pgpool ocf:heartbeat:pgpool \
      params pgpoolconf="/usr/local/pgpool/etc/pgpool.conf" \
           options="-D"  pgpooluser="postgres" \
           checkmethod="pid" \
           pgpoolcmd="/usr/local/pgpool/bin/pgpool" \
      op start   interval=0s  timeout=60s \
      op monitor interval=10s timeout=30s \
      op stop    interval=0s  timeout=60s


using pgpool-II 3.5.x's pcp_node_count:

    primitive pgpool ocf:heartbeat:pgpool \
      params pgpoolconf="/usr/pgpool2-3.5/etc/pgpool.conf" \
           pcpconf="/usr/pgpool2-3.5/etc/pcp.conf" \
           options="-D"  pgpooluser="postgres" \
           checkmethod="pcp" checkstring="-w -h localhost -p 9898" \
           pgpoolcmd="/usr/pgpool2-3.5/bin/pgpool" \
           pcpnccmd="/usr/pgpool2-3.5/bin/pcp_node_count" \
      op start   interval=0s  timeout=60s \
      op monitor interval=30s timeout=30s \
      op stop    interval=0s  timeout=60s


using pg_isready:

    primitive pgpool pgpool \
      params pgpoolconf="/etc/pgpool-II-95/pgpool.conf" \
          pcpconf="/etc/pgpool-II-95/pcp.conf" \
          options="-D" pgpooluser="postgres" \
          checkmethod="psql" checkstring="-U postgres -h localhost -p 9999" \
          pgpoolcmd="/usr/pgpool-9.5/bin/pgpool" \
          psqlcmd="/usr/pgsql-9.5/bin/pg_isready" \
      op start   interval=0s  timeout=60s \
      op monitor interval=30s timeout=30s \
      op stop    interval=0s  timeout=60s


support ML
----------

 pgpool-general@pgpool.net