Discourse と Docker イメージを最新版に手動で更新

:bookmark: このガイドでは、セルフホスト環境でDiscourse、Dockerコンテナ、およびUbuntuオペレーティングシステムを手動で更新するための段階的な手順を説明します。

:person_raising_hand: 必要なユーザーレベル: システム管理者

:warning: サーバーへのSSHアクセス。

Discourseをセルフホストしている場合、最新のセキュリティリリースや新しいライブラリを入手するために、コマンドラインから手動で更新を実行する必要がある場合があります。

これらの更新は admin/upgrade では取り込まれないため、これらの追加手順を実行する必要がある場合があります。

Discourseの更新

  1. Discourse自体は、管理ダッシュボード (admin/upgrade) で「最新バージョンに更新」ボタンをクリックすることで、月に約2回更新する必要があります。

  2. 2か月に一度、WebサーバーにSSH接続し(puttyまたはお気に入りのSSHクライアントを使用)、特にアップグレードページが表示されない場合や、アップグレードを試みる際に問題が発生した場合は、次のコマンドを実行することを推奨します。

cd /var/discourse
./launcher rebuild app

DockerイメージとUbuntu OSの更新

Ubuntuの更新については、必ずUbuntuの自動セキュリティ更新を有効にしてください! コマンドは次のとおりです。

dpkg-reconfigure -plow unattended-upgrades

ただし、これはクリティカルなセキュリティ更新のみを対象としています。時折、次のようにすべてのOS更新を取得する必要があります。

apt-get update
apt-get dist-upgrade

これにより、標準の docker-ce パッケージ経由でDockerも最新の状態に保たれます。

要約すると次のようになります。

  • 月に2回、Webアップデーター経由でDiscourseを更新
  • 2か月に一度、コンテナを更新
  • 6か月に一度、OSを更新

これらの数値を2倍にしても、かなり安全でいられます。たとえば、Discourseは月に1回、コンテナは4か月に1回、OSは12か月に1回更新するなどです。

しかし、上記のようにUbuntuで自動セキュリティ更新を有効にすることは、本当に、本当に重要です。

FAQ

更新するのに適切な時期はいつですか?

利用可能な時間と、最先端にどれだけ近づきたいかによります。非公式プラグインを使用している場合は、テスト/ステージングサイトを利用することが強く推奨されます。非公式プラグインがない場合は、すぐにアップグレードできる可能性が高いですが、それでもチームが修正するまで数日間は一部のプラグインが壊れる可能性があります(プラグインは多数あります)。

多数のプラグインがインストールされている場合の一般的な慣行は何ですか?

多数のプラグインがある場合は、ローカルまたはテストサーバーでのテストを強くお勧めします。特に非公式プラグインがある場合は、何かが壊れている可能性があるためです。何かが壊れていることが判明した場合、それはあなたにそれを修正する時間があるかどうか、元のプラグイン作成者にそれを修正する時間があるかどうかの問題になります。どちらも数週間かかる可能性があります。したがって、少なくともこのようにすれば、本番サイトが壊れるのではなく、壊れたテストサイトがあるだけです。

ディスク容量が不足しています

ディスク容量が不足している場合(dfで確認)、次を使用して古いイメージをクリアしてみてください。

./launcher cleanup
apt-get autoclean
apt-get autoremove

Discourseは常にDocker内で動作するため、Ubuntuの実際のサーバーバージョンを更新することは重要ですか?

重要性ははるかに低くなります。ただし、少なくとも現在サポートされているLTSバージョンのUbuntuサーバーを使用している必要があります。64ビットのLinux OSと最新のカーネルバージョンが必要です。

「いいね!」 178
"Upgrade all" button is awesome!
Ubuntu 16.04 LTS - upgrade or migrate?
Cannot upgrade due to old version of docker
Daily performance reports keep asking to rebuild container
No longer getting notifications for out of date containers
Discourse stopping working - CPU/RAM load?
Manual upgrade fails
Upgrade container - keeping config and data
Installed OK. Working fine for one day. Suddenly stopped working
Issues upgrading from 1.6.0.Beta10+9 to 2.3.0.beta6
Upgrade link no longer works
Update error, website unavailable, possibly plugin related?
How to optimize storage?
Why do I need a block storage?
Digital Ocean hosting: Do I need a system admin?
Will not load, no access to installation, aufs not installed - my fix
Upgrade V2.1 Beta 2 to Beta 4 Require ./launcher rebuild app Twice
Some trouble updating (many bugs)
What makes a successful volunteer Discourse sysadmin?
Searching locks up the server for a while
Link-image not shown
Oops - Error 500 After Update From Admin Dashboard
Crash After Recent Update
Edit CSS/HTML editor cursor offset makes it unusable due to CSS font override
Oops The software powering this discussion forum encountered an unexpected problem
Upgrades via UI disabled - and not being re-enabled after SSH upgrade
Error upgrading, failed to bootstrap
Help after updating from ssh site goes down
My Discourse is Down. Certificate Issue?
Unable to update Discourse...help?
Reset password link error
Empty update page?
My website is always down
Upgrade container - keeping config and data
Failed to update Discourse new version
Unable to upgrade docker_manager
Undefined method `timeout=' for Regexp:Class
How often should I update Discourse?
Migration failed: relation "user_required_fields_versions" already exists
Kernel version upgrade required when manually updating discourse
Cannot rebuild following site failure: "postgres already running"
Visiting /admin/upgrade may lead to a server error
Updating I get a "Configuring openssh-server" message about the "sshd_config" file
Update Not Completing
Problem with api version when updating docker manager
Problem with Upgrade [error 137]
Problem updating my installation
Update in browser vs Terminal
Docker update to latest version
How often should I update Discourse?
Self hosted Reply by Email stopped working after latest update
Error 500 how to fix?
Site down after UI update
Docker update to latest version
Selectable avatars upload broken (Missing required UppyUpload config: id)
Discourse broken after failed upgrade
How to tell whether to upgrade via web or console?
Oops The software powering this discussion forum encountered an unexpected problem
Determining whether my VPS needs any upgrades (generally)
Kernel version upgrade required when manually updating discourse
Upgrade button is 500-ing for me
1.4.3 Upgrade Oddity?
Add path to cookie
Your Docker installation is not working correctly - no space left on device - safe to use ./launcher cleanup?
PNG's a no show
Upgrade from v2.0.0.beta10 +37 to 2.1.0.beta1 does fail
Kernel Panic after droplet reboot... What now?
Failed to bootstrap 1.6.0.beta 8 with out of date docker
Problem with category style = box under firefox
Site fails to load with js errors
ERROR: You are running an old version of the Discourse image
Service not available | Update Error due to broken plugin
What do you want to do about modified configuration file grub?
Failed Upgrade Discourse and Plugins
Insert Date Timezone is always UTC ; my Timezone is ignored
Admin upgrade page does not exist
Upgrading from 2.9.0.beta8 broke the site, unrecoverable
Error when upgrading and would like to solve or reset
Update failed - Not starting
Failed to rebuild: no such file /usr/local/etc/ImageMagick-6/policy.xml
Upgrade ends with FAILED TO BOOTSTRAP
"400 Bad Request" error after upgrading
Hello, after clicking login, it takes 20 seconds to load before you can enter my page. why?