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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/initdb.sgml,v 1.47 2010/04/03 07:23:01 petere Exp $
PostgreSQL documentation
-->
<refentry id="APP-PGXC-DDL">
<refmeta>
<refentrytitle>pgxc_ddl</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Application</refmiscinfo>
</refmeta>
<refnamediv>
<refname>pgxc_ddl</refname>
<refpurpose>
Coordinator catalog table synchronization and DDL treatment module
</refpurpose>
</refnamediv>
<indexterm zone="app-pgxc-ddl">
<primary>pgxc_ddl</primary>
</indexterm>
<refsynopsisdiv>
<cmdsynopsis>
<command>pgxc_ddl</command>
<arg rep="repeat"><replaceable>option</></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="R1-APP-PGXC-DDL-1">
<title>
Description
</title>
&xconly
<para>
pgxc_ddl is used to synchronize all Coordinator catalog tables from
one chosen by a user. It is also possible to launch a DDL on one
Coordinator, and then to synchronize all the Coordinator catalog
tables from the catalog table of the Coordinator having received the
DDL. Copy method is cold-based. All the Coordinators are stopped,
catalog files are copied, then all the Coordinators are restarted.
</para>
<para>
Since <productname>Postgres-XC</productname> 0.9.3, DDL are
synchronized automatically on all the nodes of the
cluster, <command>pgxc_ddl</command> is let on purpose of future
feature development.
</para>
<para>
Since <productname>Postgres-XC</productname> 0.9.4, pgxc_ddl and
pgxc.conf are not anymore installed by default. Scripts are saved
in the folder <filename>src/pgxc/bin/pgxc_ddl</filename>.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<para>
Options are specified with preceding '<literal>-</literal>', each
option may be associated with a value.
</para>
<para>
Options are as follows:
</para>
<para>
<variablelist>
<varlistentry>
<term><option>D</option></term>
<listitem>
<para>
Specify <filename>pgxc.conf</filename> folder, for
characteristics of all the Coordinators.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>l</option></term>
<listitem>
<para>
Specify application folder, in case <varname>PATH</varname> is not defined.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>f</option></term>
<listitem>
<para>
Specify DDL file location.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>d</option></term>
<listitem>
<para>
Database name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>n</option></term>
<listitem>
<para>
Coordinator number. Coordinator chosen corresponds to the one
defined in <filename>pgxc.conf</filename> at the nth place.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>t</option></term>
<listitem>
<para>
Specify temporary folder where to copy the configuration files
postgresql.conf and pg_hba.conf for each Coordinator.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<command>gtm_ctl</command> issues the following keywords to select
operations on <command>gtm</command>
and <command>gtm_proxy</command>.
</para>
<para>
<variablelist>
<varlistentry>
<term><option>start</option></term>
<listitem>
<para>
Start a GTM/GTM proxy instance.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>restart</option></term>
<listitem>
<para>
Restart a GTM/GTM proxy instance.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>stop</option></term>
<listitem>
<para>
Stop a GTM/GTM proxy instance.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>status</option></term>
<listitem>
<para>
Look at the status of GTM instance. If active, 1 is printed. If
standby, 0 is printed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>promote</option></term>
<listitem>
<para>
Promote a GTM instance as active.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>reconnect</option></term>
<listitem>
<para>
Reconnect a GTM Proxy to another GTM instance.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
Typically, you can issue the following command to start <command>gtm</command>/
<programlisting>
gtm_ctl start -S gtm -D datafolder
</programlisting>
</para>
<para>
Or <command>gtm_proxy</command>:
<programlisting>
gtm_ctl start -S gtm_proxy -D datafolder_proxy
</programlisting>
</para>
<para>
Promote a GTM as active:
<programlisting>
gtm_ctl promote -S gtm -D datafolder
</programlisting>
</para>
<para>
Reconnect a GTM proxy to another GTM instance:
<programlisting>
gtm_ctl reconnect -S gtm_proxy -D datafolder_proxy -o '-s hostname -t port_number'
</programlisting>
</para>
<para>
Look at the status of a GTM server:
<programlisting>
gtm_ctl status -S gtm -D datafolder
</programlisting>
</para>
</refsect1>
<refsect1 id="R1-APP-PGXC-DDL-2">
<title>
Configuration
</title>
&xconly
<para>
Because <command>pgxc_ddl</command> requires access to Coordinator
configuration file and data folders, the following parameters have
to be set in <filename>pgxc.conf</filename>:
</para>
<table>
<title><filename>pgxc.conf</filename> entries</title>
<tgroup cols="3">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><varname>Coordinator_ports</varname></entry>
<entry>string</entry>
<entry>
Specify the port number of all the Coordinators. Maintain the
order of the value same as those in Coordinator_hosts. It is
necessary to specify a number of ports equal to the number of
hosts. A comma separator is also necessary.
</entry>
</row>
<row>
<entry><varname>Coordinator_folders</varname></entry>
<entry>string</entry>
<entry>
Specify the data folders of all the Coordinators. Maintain the
order of the value same as those in Coordinator_hosts. It is
necessary to specify a number of data folders equal to the
number of hosts. A comma separator is also necessary.
</entry>
</row>
<row>
<entry><varname>Coordinator_hosts</varname></entry>
<entry>string</entry>
<entry>
Specify the host name or IP address of Coordinator. Separate
each value with comma.
</entry>
</row>
</tbody>
</tgroup>
</table>
<note>
<para>
About the temporary folder, this one has the name chosen by the
user. As an extension name, the PID of the shell script is
added. This folder is by definition in /tmp. The user can choose
the name freely.
</para>
</note>
<note>
<para>
Configuration files of Coordinators that have their catalog files
changed are defined with an extension name postgresql.conf.number,
"number" being the number of t Coordinator in the order defined
in <filename>pgxc.conf</filename>.
</para>
</note>
</refsect1>
</refentry>
|