Postgres-XC Wiki
Register
Advertisement

Why GTM-Proxy?[]

You should configure GTM proxy in you Postgres-XC cluster to reconnect to the new GTM.

What you should do if GTM proxy crashes[]

GTM proxy does not maintain any persistent data other than the configuration file and you should just restart GTM proxy when crashed. Please visit Real Server configuration page.

GTM proxy configuration for reconnect=[]

With default configuration, GTM proxy will stop when it detects error in the communication with GTM. To reconnect to the new GTM, GTM proxy need to be configured to wait for reconnect command. You can do this as follows:

[main]$ ssh node01
[node01]$ cat >> /home/postgresxc/pgxc/gtm_proxy/gtm_proxy.conf << EOF
err_wait_interval = 1
err_wait_count = 1000
EOF
[node01]$ exit
[main]$ ssh node02
[node02]$ cat >> /home/postgresxc/pgxc/gtm_proxy/gtm_proxy.conf << EOF
err_wait_interval = 1
err_wait_count = 1000
EOF
[node02]$ exit
[main]

err_wait_interval is the interval in second to detect reconnect command from gtm_ctl. err_wait_count is the number of maximum intervals to wait.

This is for V1.0. In following releases, this configuration will be much simpler and err_wait_count will be omitted. In this case, GTM proxy will wait for reconnect until it receives reconnect or stop by gtm_ctl.

Reconnect to new GTM[]

As found in GTM Standby Configuration, you can reconnect GTM proxies to new GTM as follows:

[main]$ ssh node01
[node01]$ gtm_ctl reconnect -Z gtm_proxy -D /home/postgresxc/pgxc/gtm_proxy -o "-s node04 -t 20001"
[node01]$ exit
[main]$ ssh node02
[node02]$ gtm_ctl reconnect -Z gtm_proxy -D /home/postgresxc/pgxc/gtm_proxy -o "-s node04 -t 20001"
[node02]$ exit
[main]

Restarting GTM proxy with new GTM[]

Similar to GTM-Standby, reconnecting GTM proxy does not change its configuration file. Before restarting GTM proxy, you may want to maintain GTM proxy configuration file as follows:

[main]$ ssh node01
[node01]$ cat >> /home/postgresxc/pgxc/gtm_proxy/gtm_proxy.conf << EOF
gtm_host = 'node04'
EOF
[node01]$ exit
[main]$ ssh node02
[node02]$ cat >> /home/postgresxc/pgxc/gtm_proxy/gtm_proxy.conf << EOF
gtm_host = 'node04'
EOF
[node02]$ exit
[main]

Then you can start GTM proxies as shown in Real Server configuration page.

[main]$ ssh node01
[node01]$ gtm_ctl start -Z gtm_proxy -D /home/postgresxc/pgxc/gtm_proxy
[node01]$ exit
[main]$ ssh node02
[node02]$ gtm_ctl start -Z gtm_proxy -D /home/postgresxc/pgxc/gtm_proxy
[node02]$ exit
[main]$
Advertisement