|
| 1 | +--- |
| 2 | +myst: |
| 3 | + html_meta: |
| 4 | + description: 'With the hypernode-haproxyctl tool you can inspect and manage the |
| 5 | + HAProxy service. Learn how to use the hypernode-haproxy CLI Tool. ' |
| 6 | + title: How to use the hypernode-haproxyctl CLI Tool? |
| 7 | +--- |
| 8 | + |
| 9 | +# How to Use the hypernode-haproxyctl CLI Tool |
| 10 | + |
| 11 | +Hypernode clusters use [HAProxy](https://www.haproxy.org/) to distribute HTTP requests from the loadbalancer to the application servers. With the `hypernode-haproxyctl` CLI tool you can inspect and manage the HAProxy service. |
| 12 | + |
| 13 | +## Viewing the current status |
| 14 | + |
| 15 | +With the `status` subcommand, you can see the current status of HAProxy and its backends. |
| 16 | + |
| 17 | +```console |
| 18 | +app@abcdef-examplelb-magweb-tbbm ~ $ hypernode-haproxyctl status |
| 19 | +HAProxy v2.6.12-1+deb12u3 (released: 2025/10/03, uptime: 98d 22h33m56s) |
| 20 | +FRONTEND (OPEN): request rate(160), session rate(7), conn rate(7) |
| 21 | +exampleapp1 (UP): request rate(0), session rate(25), conn rate(0) |
| 22 | +exampleapp2 (UP): request rate(0), session rate(32), conn rate(0) |
| 23 | +exampleapp3 (UP): request rate(0), session rate(28), conn rate(0) |
| 24 | +exampleapp4 (UP): request rate(0), session rate(38), conn rate(0) |
| 25 | +exampleapp5 (UP): request rate(0), session rate(35), conn rate(0) |
| 26 | +BACKEND (UP): request rate(0), session rate(160), conn rate(0) |
| 27 | +``` |
| 28 | + |
| 29 | +The output has three sections: |
| 30 | + |
| 31 | +- **FRONTEND**: The internet-facing entry point. Shows how many requests and connections are coming in per second. |
| 32 | +- **exampleapp1-N**: Your individual app servers. Common states are `UP`, `DOWN` and `DRAIN`. |
| 33 | +- **BACKEND**: The combined pool of all app servers. `UP` means at least one server is healthy. |
| 34 | + |
| 35 | +If a server shows `DOWN` unexpectedly, it likely needs attention. `DRAIN` and `MAINTENANCE` are usually intentional states used during maintenance. |
| 36 | + |
| 37 | +## Managing backends |
| 38 | + |
| 39 | +When troubleshooting or performing maintenance on an app server, you can use the `drain` subcommand to gracefully remove it from rotation: |
| 40 | + |
| 41 | +```console |
| 42 | +app@abcdef-examplelb-magweb-tbbm ~ $ hypernode-haproxyctl drain exampleapp1 |
| 43 | +``` |
| 44 | + |
| 45 | +The `drain` command allows existing connections to finish while preventing new traffic from being sent to the server. This is ideal for performing maintenance without disrupting active users. |
| 46 | + |
| 47 | +Once maintenance is complete, you can use the `enable` subcommand to bring the server back into rotation: |
| 48 | + |
| 49 | +```console |
| 50 | +app@abcdef-examplelb-magweb-tbbm ~ $ hypernode-haproxyctl enable exampleapp1 |
| 51 | +``` |
0 commit comments