Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy local postgres so it can be exposed as a service for read only replicas #109

Merged
merged 1 commit into from
May 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ backend bk_db
http-check disable-on-404
server-template pg 10 $PRIMARY_REGION.$FLY_APP_NAME.internal:5433 check port 5500 resolvers flydns resolve-prefer ipv6 init-addr none on-marked-down shutdown-sessions
server pg [$PG_LISTEN_ADDRESS]:5433 check backup port 5500 on-marked-down shutdown-sessions

# stolon binds postgres only on fdaa:* ipv6 address which is not reachable by fly-proxy
# Wildcard binding won't interfere with $PG_LISTEN_ADDRESS binding
listen local_postgresql
mode tcp
bind *:5433
bind :::5433
server pg [$PG_LISTEN_ADDRESS]:5433