docs(getting-started): document the MongoDB replica set required from v8.0 - #617
Merged
Merged
Conversation
… v8.0 The MONGO_URI examples in the install guides and cookbooks pointed at a standalone MongoDB, which GROWI v8.0 cannot use because change streams are only available on a replica set. - Add a replica set setup step to the Ubuntu Server (JA/EN) and AlmaLinux (JA) guides, right after MongoDB is started - Show ?replicaSet=rs0 in the MONGO_URI examples of those guides, of the systemd unit cookbook, and of the multi-app cookbook Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GROWI v8.0 supports only Node.js v24 and Elasticsearch v8/v9, and requires MongoDB v6.0 or later, but the guides still asked for Node.js 18/20 and MongoDB 4.4. Following them produced an environment that cannot run v8.0. - Ubuntu Server (JA/EN) and AlmaLinux (JA): state Node.js 24.x, npm 11.x, MongoDB 6.0+ with a replica set and Elasticsearch 8.x/9.x, install Node.js from setup_24.x, and show the versions those produce - Drop the global turbo install: turbo is in devDependencies, so pnpm install brings it in. Pin the pnpm version to what packageManager declares - Set ELASTICSEARCH_VERSION=8 when starting against the Elasticsearch 8.x these guides install, since GROWI defaults to 9. Note the same in the systemd cookbook (JA/EN) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
https://redmine.weseek.co.jp/issues/188315
概要
インストールガイドと Cookbook の
MONGO_URIの記載例が standalone 構成の MongoDB を指していたため、レプリカセット構成の URI に改めました。あわせて、レプリカセット構成を有効化する手順をインストールガイドへ追加しています。GROWI v8.0 以降は MongoDB の change stream を利用するため、レプリカセット構成が必須です(v8.0.x へのアップグレード 参照)。ガイドに従うと standalone 構成で構築され、
MONGO_URIにもレプリカセットの指定がないため、そのままでは v8.0 以降を動かせない状態でした。#604 のレビューで「
MONGO_URIがレプリカセット運用の URL になっていない。元の記載も変える必要があるかも」とご指摘いただいた、その「元」に当たる修正です。変更内容
レプリカセット構成の有効化手順を追加(MongoDB を起動した直後の節として挿入)
admin-guide/getting-started/ubuntu-server.md(日英)admin-guide/getting-started/almalinux.md(日。英語版は存在しません)/etc/mongod.confへのreplSetNameの追記 →mongodの再起動 →rs.initiate()による初期化 →PRIMARYになったことの確認、という流れです。レプリカセット名は growi-docker-compose と同じrs0を例にしています。MONGO_URIの記載例を?replicaSet=rs0付きに変更admin-guide/admin-cookbook/launch-with-systemd.md(日英): systemd ユニットのEnvironment=admin-guide/admin-cookbook/multi-app.md(日英): 3 アプリ分のMONGO_URI(mongoサービス自体は growi-docker-compose の定義をそのまま使うため、そちらは既にレプリカセット構成です)前提条件と Node.js / Elasticsearch の記載を v8.0 に追従(レビューでのご指摘を受けて追加)
インストールガイドは Node.js 18/20・MongoDB 4.4 以上を要求する記載のままで、そのまま従うと v8.0 を動かせない環境ができていました。GROWI v8.0 がサポートするのは Node.js v24 系のみ・Elasticsearch v8/v9 系のみで、MongoDB は v6.0 以上が必要です。
getting-started/ubuntu-server.md(日英)・almalinux.md(日)の前提条件を Node.js 24.x / npm 11.x / MongoDB 6.0 以上(レプリカセット必須)/ Elasticsearch 8.x or 9.x に更新setup_24.xに変更し、見出しとバージョン確認例(v24.14.0/11.9.0/11.1.1)も揃えましたturboのグローバルインストール手順を削除。turboは devDependencies に含まれるためpnpm installで導入されます。あわせて pnpm のバージョンはpackage.jsonのpackageManagerの宣言(v8.0.0 はpnpm@11.1.1)に合わせるよう明記ELASTICSEARCH_VERSION=8を指定するよう追記。本ガイドは Elasticsearch 8.x をインストールしますが、GROWI 側の既定値は9なので、指定しないと全文検索の初期化に失敗します。admin-cookbook/launch-with-systemd.md(日英)のEnvironmentの説明にも同じ注意を書きました変更しなかったもの
admin-guide/getting-started/centos.md(日英): MongoDB 3.6 / node.js 8.x をインストールするページで、そもそも v8.0 を動かせる構成ではありません。standalone 構成の記述として内部で一貫しているため、そのまま残しています。admin-guide/admin-cookbook/env-vars.mdのMONGO_URIの既定値(mongodb://localhost/growi): GROWI 本体の既定値そのものなので変更しません。admin-guide/downgrading/50x-to-45x.md、migration-guide/from-crowi-onpremise.md、upgrading/36x.md: v8.0 より前を対象とした記述です。追従しなかった範囲(意図的)
ミドルウェアのインストール対象バージョンは据え置きにしています。Elasticsearch は 8.x、MongoDB は 6.0 のままで、どちらも GROWI v8.0 のサポート範囲内です。
elasticsearch.ymlに対する literal な unified diff です。9.x 用の同等の diff を実機確認なしに書き換えると、検証していない手順を載せることになります。代わりにELASTICSEARCH_VERSION=8の指定を明記して、8.x のままでも正しく動く形にしました。dnf/dpkgの出力例まで差し替える範囲になるため、別途としました。いずれも「古いがサポート内」の状態なので、追従は別 PR で扱えます。今回直したのは「そのまま従うと v8.0 が動かない」部分(Node.js のバージョンと
ELASTICSEARCH_VERSIONの欠落)です。確認事項
pnpm lint(textlint)クリーン。🤖 Generated with Claude Code