Comment installer un plugin sans recompiler (ou définir un message de maintenance)

Hi.

I’m searching for a solution that don’t make me rebuild my Discourse when I install a new plugin, which cause a long downtime.
On some forum scripts (like PHPBB, FluxBB, etc…), we can install a plugin without causing a downtime.

I’m also looking for a solution to set a message when the users visits my rebuilding Discourse who says that the forum is currently in maintainance (instead of the web browser error).

Thanks!

1 « J'aime »

It’s really not possible to install a plugin without rebuilding afaik.

This can be done by setting up an offline page while rebuilding here is a guide:

2 « J'aime »

The solution is to use a two-container install. This will let you build a new image while the old one keeps running. The amount of downtime is just what it takes to shutdown the old container and start the new one.

7 « J'aime »

Thanks, I will follow your solution.

A more advanced version can include a load balancer in front of the application container(s) to reduce downtime to a bare minimum right?

1 « J'aime »

Yes, I’ve experimented with having HAproxy in front of two containers, so it should be possible to leave the old server running, crank up the new one, shut down the old one with no downtime. I’ve not yet gotten it working correctly, however.

1 « J'aime »

Can you tell me what kind of issues you had?

1 « J'aime »

I’ll need to crank it up again and document it. It’ll take a while to figure it out again. :frowning:

1 « J'aime »

Désolé pour la nécro, mais ce post apparaît en haut des résultats Google et j’ai eu le même « problème ». Cela nécessite de bidouiller dans le conteneur Docker, donc je ne recommande pas de le faire en production si vous ne savez pas ce que vous faites. Étapes après avoir établi une connexion SSH avec votre serveur :
VOUS FAITES DES CHOSES NON SUPPORTÉES, SANS AUCUNE GARANTIE !

# cd /var/discourse
# ./launcher enter app
# su discourse
$ cd /var/www/discourse/plugins
$ git clone <plugin_git_url>
$ exit
# exit
# docker restart app

Il y a toujours une certaine interruption de service pendant le démarrage du conteneur, mais c’est beaucoup plus rapide qu’une reconstruction complète (quelques secondes contre plusieurs minutes sur le plus petit droplet DigitalOcean).

3 « J'aime »

Bonjour !
Vous cherchez probablement ceci :

1 « J'aime »

Vous pouvez également

  sv restart unicorn 

À l’intérieur du conteneur, ce qui est un peu plus rapide que de redémarrer le conteneur.

De plus, pour certains plugins, vous devrez migrer la base de données.

3 « J'aime »