How to install a plugin without rebuilding (or set a maintainance message)

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!

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:

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.

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?

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.

Can you tell me what kind of issues you had?

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

네크로포스팅해서 죄송합니다. 다만 이 게시물이 구글에서 상위에 노출되어 있어 저 역시 같은 "문제"를 겪었습니다. 도커 컨테이너 안에서 직접 설정을 바꿔야 하므로, 무엇을 하고 있는지 확신이 없다면 프로덕션 환경에서는 이 작업을 권장하지 않습니다. 서버에 SSH로 접속한 후 수행할 단계는 다음과 같습니다:
지원되지 않는 작업을 수행하는 것이며, 어떠한 보증도 제공되지 않습니다!

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

컨테이너가 시작되는 동안 여전히 일부 다운타임이 발생하지만, 전체 재빌드(가장 작은 DigitalOcean 드롭렛 기준, 수 분)보다 훨씬 빠릅니다(수 초).

안녕하세요!
아마도 이것을 찾고 계실 겁니다:

또한

  sv restart unicorn 

컨테이너 내에서 실행할 수 있으며, 이는 컨테이너를 재시작하는 것보다 약간 더 빠릅니다.

또한, 일부 플러그인의 경우 데이터베이스 마이그레이션이 필요합니다.