pgxc_ddl

Name

pgxc_ddl --  Coordinator catalog table synchronization and DDL treatment module

Synopsis

pgxc_ddl [option...]

Description

Note: The following description applies only to Postgres-XC

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.

Since Postgres-XC 0.9.3, DDL are synchronized automatically on all the nodes of the cluster, pgxc_ddl is let on purpose of future feature development.

Since Postgres-XC 0.9.4, pgxc_ddl and pgxc.conf are not anymore installed by default. Scripts are saved in the folder src/pgxc/bin/pgxc_ddl.

Options

Options are specified with preceding '-', each option may be associated with a value.

Options are as follows:

D

Specify pgxc.conf folder, for characteristics of all the coordinators.

l

Specify application folder, in case PATH is not defined.

f

Specify DDL file location.

d

Database name.

n

Coordinator number. Coordinator chosen corresponds to the one defined in pgxc.conf at the nth place.

t

Specify temporary folder where to copy the configuration files postgresql.conf and pg_hba.conf for each coordinator.

gtm_ctl issues the following keywords to select operations on gtm and gtm_proxy.

start

Start a GTM/GTM proxy instance.

restart

Restart a GTM/GTM proxy instance.

stop

Stop a GTM/GTM proxy instance.

status

Look at the status of GTM instance. If active, 1 is printed. If standby, 0 is printed.

promote

Promote a GTM instance as active.

reconnect

Reconnect a GTM Proxy to another GTM instance.

Typically, you can issue the following command to start gtm/

gtm_ctl start -S gtm -D datafolder

Or gtm_proxy:

gtm_ctl start -S gtm_proxy -D datafolder_proxy

Promote a GTM as active:

gtm_ctl promote -S gtm -D datafolder

Reconnect a GTM proxy to another GTM instance:

gtm_ctl reconnect -S gtm_proxy -D datafolder_proxy -o '-s hostname -t port_number'

Look at the status of a GTM server:

gtm_ctl status -S gtm -D datafolder

Configuration

Note: The following description applies only to Postgres-XC

Because pgxc_ddl requires access to coordinator configuration file and data folders, the following parameters have to be set in pgxc.conf:

Table 1. pgxc.conf entries

NameTypeDescription
coordinator_portsstring 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.
coordinator_foldersstring 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.
coordinator_hostsstring Specify the host name or IP address of coordinator. Separate each value with comma.

Note: 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.

Note: 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 pgxc.conf.