定義
setClusterParametersetClusterParameteris an administrative command for modifying values of cluster parameters. Cluster parameters are configurable parameters which affect all nodes in a replica set or sharded cluster.また、
adminデータベースに対してsetClusterParameterコマンドを発行する必要があります。
互換性
このコマンドは、次の環境でホストされている配置で使用できます。
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
重要
This command is not supported in MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
構文
db.adminCommand( { setClusterParameter: { <parameter>: <value> } } )
例を含む使用可能なクラスター パラメーターについては、「自己管理型配置のクラスター パラメーター 」を参照してください。
動作
setClusterParameterはadminデータベースでのみ実行できます。 他のデータベースで コマンドを実行すると、MongoDB はエラーを返します。レプリカセット プライマリまたはシャーディングされたクラスターでのみ
setClusterParameterを実行できます。スタンドアロン配置では
setClusterParameterは実行できません。setClusterParameterは一度に 1 つのパラメーターのみを受け入れます。
アクセス制御
認証が有効になっている場合、 setClusterParameterはsetClusterParameterアクションへのアクセス権を持つロールを持つユーザーとして認証された場合にのみ機能します。
永続性
setClusterParameterを使用して行われたパラメーターの変更は、レプリカセットとシャーディングされたクラスターで永続化されます。 これにより、 setClusterParameterを使用して行われたパラメータの変更が再起動に耐えられるようになります。
Stable API
When using Stable API V1 with apiStrict set to true, you cannot use setClusterParameter to modify cluster parameters.