warp-tech / warpgate

Smart SSH, HTTPS and MySQL bastion that requires no additional client-side software
Apache License 2.0
3.81k stars 118 forks source link

How to Set Up High Availability (HA) and Upgrade Warpgate with PostgreSQL as the Database #1087

Open vjmax opened 17 hours ago

vjmax commented 17 hours ago

Hi,

I’m currently using Warpgate with PostgreSQL as my backend database, and I’m looking for guidance on two things:

High Availability (HA): What’s the best approach to set up HA for Warpgate? I am using PostgreSQL for the database and want to ensure that Warpgate is highly available with multiple instances, preferably behind a load balancer. Are there any best practices or tools (e.g., HAProxy, Nginx) to achieve this? Additionally, how should the Warpgate configuration and session data be managed across multiple instances?

Upgrading Warpgate: Could you provide steps or best practices for upgrading from one version of Warpgate to another while using PostgreSQL? Specifically, I want to know how to handle database migrations, any potential schema changes, and the general process to ensure a smooth upgrade with minimal downtime.

Thanks in advance for your help! Any advice or documentation would be greatly appreciated.

Eugeny commented 13 hours ago

Multiple Warpgate instances can work with the same database at the same time without any need for synchronization, however if you put a load balancer in front of them, the load balancer has to provide session stickiness (TCP connection based for SSH/MySQL/Postgres and cookie based for HTTP) as session storage is local to each service.

As for database migrations, currently there is no provision for running mixed versions against the same database. When Warpgate service starts, it automatically applies any new database migrations that haven't been applied yet - so upgrading a cluster requires downtime.