I'm trying to bind coordinator to only listen on specific interface. It seems the listen_addressses option is being ignored when specified within postgresql.conf on coordinator.
There is another file within coordinator data directory called postmaster.opts which seems to be reset each time pgxc_ctl connects to coordinator in order to start/stop it.
If I could include -h option within that file then coordinator would be bound to IP of my choice.
Interestingly GTM will bind to IP if specified within listen_addresses. Coordinator nor data node won't.
I looked through postgres-xl documentation, pgxc_ctl documentation, mailing list and google in general but could not find how to do this. My last resort is to read through the code base (which I'm trying to do now).
--- edit 1:
It seems listen_addressses
is honoured as long as postgres is not started with -i
switch. For some reason pgxc_ctl adds -i
to list of call parameters within postmaster.opts when on coordinator.
--- edit 2:
It seems -i
option is added in the source code when starting coordinator (and data node). So the only way to move forward is to patch and rebuild from sources.
--- edit 3:
I have been testing pgxc_ctl when built with changes made to datanode_cmd.c as well as coord_cmd.c (removed -o -i
switches from all calls to pg_ctl). By doing this both coordinator and data node are now binding to interface as stated within listen_addresses
in postgresql.conf
. It would be interesting to understand why -o -i
was hardcoded. Problem solved.
来源:https://stackoverflow.com/questions/43620071/bind-postgres-xl-coordinator-to-listen-only-on-specific-interface