---
title: HAProxy or PgBouncer failure
description: "Recover a stopped HAProxy or PgBouncer on a node of an HA service, and check that the VIP and the pooled and direct ports serve again."
related:
  - /database-services/high-availability
---

Each node of an HA service runs HAProxy (port 5000 pooled through
PgBouncer, port 6000 direct to the primary) and PgBouncer.

## Symptoms

- **PgBouncer stopped on the primary:** connections on port 5000 fail with
  `connection refused`. Port 6000 continues to work.
- **HAProxy stopped on the VIP holder:** another node takes the VIP in about
  12 s. Open connections close.
- On the service **Overview**, **Database service health** shows
  *PgBouncer needs attention* or *HAProxy needs attention*. The service
  status stays `running`.

![Service topology with HAProxy shown as unhealthy on one node](/docs/screenshots/v2026.11.11-beta/proxy-failure/topology-haproxy-unhealthy.light.webp)

## Recovery

1. **Find the unhealthy unit**

    In the topology, find the node and the unit (`pgbouncer` or `haproxy`)
    that is unhealthy. If the console is not available, run
    `systemctl status pgbouncer haproxy` on each PostgreSQL node.

2. **Read the log**

    Read the log of the unit. For PgBouncer, use **Logs & Diagnostics**
    (source **PgBouncer**). For HAProxy, run this on the node:

    ```bash
    sudo journalctl -u haproxy -n 100
    ```

3. **Start the unit**

    Start the unit:

    ```bash
    sudo systemctl start <unit>
    ```

4. **Check the unit**

    Confirm that the topology shows the unit as healthy, and that a client
    connection works again. If the unit does not start, or stops again,
    contact support.

5. **Check the VIP**

    On a service with a VIP, run this on each PostgreSQL node:

    ```bash
    ip -4 addr show | grep <vip>
    ```

    - Good: the VIP is on one node.
    - Bad: the VIP is on no node or on more than one. Contact support.

    The VIP does not move back when HAProxy starts again.

## Prevention

- Keep the shipped unit settings: they restart a unit that fails. A unit
  that you stop with `systemctl stop` stays stopped.
- Connect clients through the VIP, and configure them to reconnect after an
  error.
