bind postgres-xl coordinator to listen only on specific interface

两盒软妹~` 提交于 2019-12-20 06:43:18

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!