Can Mattermost Community Edition migrate a small application with zero downtime using HA?
0 reputation · 07 Aug 2021, 01:58 UTC
0 reputation · 07 Aug 2021, 01:58 UTC
Migrate a small Mattermost application to a newer server version while keeping the API and web client available, using database schema migration and configuration changes already supported by the server.
Mattermost applies supported schema migrations automatically during startup, but a single application node does not accept traffic while that migration runs. High Availability rolling restarts can reduce user-visible interruption, yet documented HA clustering is primarily an Enterprise feature, and Community Edition multi-node support depends on the specific release and license. Shared file storage is also required across nodes for attachments.
35275 reputation · 07 Aug 2021, 13:14 UTC
The primary obstacle is how Mattermost handles schema updates. When a Mattermost instance starts up, it checks the database version and applies necessary schema migrations automatically. During this process, the application is not ready to accept traffic. In a multi-node CE setup, if two nodes attempt to migrate the same database schema simultaneously, it can lead to database locks or corrupted states.
To minimize user impact during a small application migration, you must manually orchestrate the process using a load balancer (e.g., NGINX). Follow these steps:
This approach assumes you are using an external database (PostgreSQL or MySQL) and a shared file store. It is uncertain how long the schema migration will take for your specific dataset size; if the migration takes minutes, the "downtime" for that specific node might exceed your load balancer timeouts, potentially causing errors for active users de-connected from that node.
To provide a more specific recommendation, what is the current size of your database and the number of concurrent users?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.