정의
getClusterParametergetClusterParameteris an administrative command for retrieving the values of cluster parameters. Cluster parameters are configurable parameters that affect all nodes in a sharded cluster.getClusterParameter을(를) 실행하려면db.adminCommand( { command } )메서드를 사용합니다.
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
참고
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
명령은 다음과 같은 구문을 가집니다:
db.adminCommand( { getClusterParameter: <parameter> | [<parameter>, <parameter>] | "'*'" } )
명령 필드
이 명령은 다음 필드를 사용합니다.
필드 | 유형 | 설명 |
|---|---|---|
| 문자열 또는 문자열 배열 | 다음 중 하나를 지정할 수 있습니다.
|
행동
admin데이터베이스에서는getClusterParameter만 실행할 수 있습니다. 다른 데이터베이스에서 명령을 실행하면 MongoDB에서 오류를 반환합니다.복제본 세트 또는 샤드 클러스터의 모든 노드에서
getClusterParameter를 실행할 수 있습니다.mongod에서getClusterParameter를 실행하면getClusterParameter는 캐시된 매개변수 값을 반환합니다.
액세스 제어
인증 이 활성화되면 getClusterParameter 은(는) getClusterParameter 작업에 액세스할 수 있는 역할이 있는 사용자로 인증된 경우에만 작동합니다.
MongoDB Atlas 사용자는 atlasAdmin 역할 있어야 합니다.
예시
참고
다음 예제의 출력은 실행 중인 MongoDB deployment의 특정 구성에 따라 달라질 수 있습니다.
단일 cluster 매개변수 조회
다음 작업은 hostName 값을 사용하여 admin 데이터베이스에서 getClusterParameter 을 실행하여 hostName 이라는 가상의 cluster 매개변수의 값을 조회합니다.
use admin db.adminCommand( { getClusterParameter : "hostName" } )
여러 cluster 매개변수 조회
다음 작업은 hostName 및 testParameter 값을 사용하여 admin 데이터베이스에서 getClusterParameter 을 실행하여 hostName 및 testParameter 라는 가상의 cluster 매개변수의 값을 조회합니다.
use admin db.adminCommand( { getClusterParameter: [ "hostName", "testParameter" ] } )
모든 cluster 매개변수 조회
다음 작업은 '*' 값으로 getClusterParameter 를 실행하여 모든 cluster 매개변수에서 값을 검색합니다.
use admin db.adminCommand( { getClusterParameter : '*' } )
팁
setClusterParameter 에서 이러한 매개변수에 대해 자세히 알아보세요.