Docs Menu

getClusterParameter

getClusterParameter

getClusterParameter is an administrative command for retrieving the values of cluster parameters. Cluster parameters are configurable parameters that affect all nodes in a sharded cluster.

To run getClusterParameter, use the db.adminCommand( { command } ) method.

このコマンドは、次の環境でホストされている配置で使用できます。

  • MongoDB Atlas はクラウドでの MongoDB 配置のためのフルマネージド サービスです

注意

このコマンドは、すべての MongoDB Atlas クラスターでサポートされています。すべてのコマンドに対する Atlas のサポートについては、「サポートされていないコマンド」を参照してください。

  • MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン

  • MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン

このコマンドの構文は、次のとおりです。

db.adminCommand(
{
getClusterParameter: <parameter> | [<parameter>, <parameter>] | "'*'"
}
)

このコマンドは、次のフィールドを使用します。

フィールド
タイプ
説明

<parameter>

String or array of strings

You can specify one of the following:

  • The name of the parameter you want to retrieve.

  • An array with the names of multiple parameters.

  • '*', to return values for all parameters available to getClusterParameter.

  • You can only run getClusterParameter on the admin database. If you run the command on any other database, MongoDB returns an error.

  • You can run getClusterParameter on any node in a replica set or sharded cluster.

  • When you run getClusterParameter on mongod, getClusterParameter returns cached parameter values.

  • When you run getClusterParameter on mongos, getClusterParameter returns the 耐久性がある value of the cluster parameter from the config server.

When 認証 is enabled, getClusterParameter only works when authenticated as a user with a role that has access to the getClusterParameter action.

MongoDB Atlas users must have the atlasAdmin role.

注意

The output of the following examples may vary depending on the specific configuration of the running MongoDB deployment.

The following operation runs getClusterParameter on the admin database using a value of hostName to retrieve the value for a hypothetical cluster parameter named hostName:

use admin
db.adminCommand( { getClusterParameter : "hostName" } )

The following operation runs getClusterParameter on the admin database using the values hostName and testParameter to retrieve the values for hypothetical cluster parameters named hostName and testParameter:

use admin
db.adminCommand( { getClusterParameter: [ "hostName", "testParameter" ] } )

The following operation runs getClusterParameter with a value of '*' to retrieve the values from all cluster parameters:

use admin
db.adminCommand( { getClusterParameter : '*' } )

以下も参照してください。

これらのパラメータの詳細については、 setClusterParameterを参照してください。