Re: Client IP in Patroni

Поиск
Список
Период
Сортировка
От Jim Chanco Jr.
Тема Re: Client IP in Patroni
Дата
Msg-id CADxTxx5y-XRbyvkoQfZdaFbtP5ggn967rUewq4H2LxjiDX=oww@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Client IP in Patroni  (Ron <ronljohnsonjr@gmail.com>)
Ответы Re: Client IP in Patroni  ("Jim Chanco Jr." <jim.chanco@crunchydata.com>)
Список pgsql-admin
AFAIK- HAProxy can only append an x-forwarded-for in layer 7 mode (http). Unfortunately, using HAProxy for PostgreSQL connections is layer 4 (tcp). The best you could do would be to route the connection through something like pgbouncer and have it append the source IP in the app name.

Kind regards,

Jim

On Mon, Nov 21, 2022 at 10:25 AM Ron <ronljohnsonjr@gmail.com> wrote:
On 11/21/22 09:14, Anjul Tyagi wrote:
Team,

We have setup in Postgres HA Cluster using Patroni. Also we have used the HAProxy for load balancing...

On Postgres side, we are getting HaProxy IP instead of Client IP, while checking in pg_stat_activity tables. Can you please suggest the changes needs to be done on HAProxy or Postgres side?

Postgresql does not know that HAProxy is a proxy.  It just knows that an IP address (which just happens to come from an HAProxy server) has connected and "doing stuff".

--
Angular momentum makes the world go 'round.

В списке pgsql-admin по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Re: Client IP in Patroni
Следующее
От: "Jim Chanco Jr."
Дата:
Сообщение: Re: Client IP in Patroni