MongoDB Enterprise(シャーディングされたクラスター)へのアップグレード
MongoDB Enterpriseは 、次のようなMongoDB Community Editionでは利用できないさまざまな機能を提供しています。
The following steps outline the procedure to upgrade a sharded cluster from the MongoDB Community Edition to the MongoDB Enterprise Edition. For example, the steps can be used to upgrade MongoDB 7.0 Community to MongoDB 7.0 Enterprise.
始める前に
MongoDB 8.0以降では、 directShardOperations
ロールを使用して、シャードに対してコマンドを直接実行する必要があるメンテナンス操作を実行できます。
警告
directShardOperations
ロールを使用して コマンドを実行すると、クラスターが正しく動作しなくなり、データが破損する可能性があります。 directShardOperations
ロールは、メンテナンス目的で、または MongoDB サポートのガイダンスに必ず従う必要があります。 メンテナンス操作を実行したら、 directShardOperations
ロールの使用を停止します。
このタスクについて
メジャー リリースのアップグレード
警告
別のリリース バージョンにアップグレードする場合は、以下の手順は使用しないでください。リリースバージョンをアップグレードするには、「MongoDB 8.0 へのアップグレード」など、適切なリリースのアップグレード手順を参照してください。
Ops Manager
MongoDB Ops Managerを使用すると、 MongoDB Community Server からMongoDB Enterprise Serverへの自動アップグレードが可能です。
詳細については、 「 MongoDB のバージョンの変更 」を参照してください。
Rolling Upgrades
When updating the sharded clusters manually, you can perform a rolling upgrade on the shard replica sets and config servers to update each MongoDB Community Server to Enterprise edition with minimal downtime.
In a rolling upgrade, each secondary is taken down and upgraded. The Enterprise server rejoins the replica set as a secondary. When all secondaries are upgraded, you can 降格 the primary, forcing the replica set to elect one of the Enterprise servers as the new primary.
手順
To minimize downtime, manually upgrade each from MongoDB Community Server to Enterprise Edition:
バランサーを停止する
During an upgrade, the balancer should not attempt to redistribute data between the shards. To prevent the balancer from attempting to redistribute data, stop the balancer for the duration of the upgrade.
To stop the balancer, connect to mongos
and run
the sh.stopBalancer()
method:
sh.stopBalancer()
If a balancing round is in progress, the operation waits for balancing to complete.
To confirm that the balancer is stopped, use the
sh.getBalancerState()
method:
sh.getBalancerState()
false
The command returns false
when the balancer is stopped.
Upgrade the config servers
Perform a rolling upgrade of the config servers.
For the procedure, see Upgrade a Replica Set to MongoDB Enterprise.
Upgrade the shards
Perform a rolling upgrade on each shard.
For the procedure, see Upgrade a Replica Set to MongoDB Enterprise.
Upgrade routers (mongos)
Perform a rolling upgrade of the mongos
instances from the Community installation to Enterprise.
Connect to
mongos
and stop the router process:db.getSiblingDB("admin").shutdownServer() If you installed
mongos
with a package manager on Linux, you must remove the existing packages before you install the Enterprisemongos
To remove the Community
mongos
:To remove the Community
mongos
from RHEL, CentOS, Alma Linux, Oracle, Rocky, and Amazon Linux, run the following command:sudo dnf remove mongodb-mongos To remove the Community
mongos
from Ubuntu and Debian, run the following command:sudo apt remove mongodb-mongos To remove the Community
mongos
from SUSE Enterprise Linux, run the following command:sudo zypper remove mongodb-mongos オペレーティング システムに応じて、パッケージ マネージャーを使用するか、バイナリを手動でダウンロードして、MongoDB Enterprise バイナリをインストールできます。
パッケージ マネージャーを使用して MongoDB Community をインストールした場合は、ご使用のオペレーティング システムのパッケージ マネージャーの手順に従います。
パッケージ マネージャーを使用して MongoDB をインストールしていない場合は、 MongoDB ダウンロード センターから MongoDB バイナリを手動でダウンロードできます。 MongoDB Enterprise の特定の前提条件を含む、お使いのオペレーティング システムのマニュアル手順に従います。
重要
現在の MongoDB Community Edition とは異なるロケーションにインストールします。
アップグレード手順では、既存のデータディレクトリと、既存の構成ファイル(該当する場合)を使用します。
重要
同じリリース シリーズのMongoDB Community Editionが同じマシンにインストールされている場合、
.msi
を使用して Enterprise エディションをインストールすることはできません。 つまり、バージョン 4.4.0 の場合 MongoDB Community Editionがインストールされている場合、.msi
を使用して 4.4.0 または 4.4.1 のエンタープライズ エディションをインストールすることはできません。インストールするには、 現在のMongoDB Community Editionとは異なるロケーションに ファイルを抽出/解凍します。
アップグレード手順では、既存のデータディレクトリと、既存の構成ファイル(該当する場合)を使用します。
バイナリをインストールします。
現在のMongoDB Community Editionとは異なるロケーションに ファイルを抽出します。 ファイルの抽出方法の詳細については、「 macOS 」を参照してください。
アップグレード手順では、既存のデータディレクトリと、既存の構成ファイル(該当する場合)を使用します。
To start the router, run Enterprise
mongos
with the same configuration as you used for the Communitymongos
.以下に例を挙げます。
sudo mongos --config /etc/mongos.conf
バランサーを再起動する
To restart the balancer, connect to mongos
and
use the sh.startBalancer()
method:
sh.startBalancer()
バランサーが実行中であることを確認するには、 sh.getBalancerState()
メソッドを使用します。
sh.getBalancerState()
true
バランサーが実行中、このコマンドはtrue
を返します。
重要
Before using any Enterprise features, ensure that all members have been upgraded to Enterprise edition.