Atlas Kubernetes Operator Atlas cluster에서 Atlas Search 인덱스를 지원합니다. 자세한 학습 은 MongoDB 검색 인덱스 관리를 참조하세요.
전제 조건
Atlas Kubernetes Operator를 배포하여 Kubernetes 클러스터 실행.
모든 클러스터 계층에서 MongoDB 버전
4.2이상.참고
다음을 초과하여 만들 수 없습니다.
M0클러스터의 인덱스 3개.Flex 클러스터의 인덱스 10개.
M10+클러스터에 생성할 수 있는 색인 수에는 제한이 없습니다.Atlas Search 인덱스를 생성할 컬렉션입니다.
필요한 액세스 권한
Atlas Search 인덱스를 만들려면 다음 역할 중 하나가 있어야 합니다.
You must have at least the readWriteAnyDatabase role or readWrite access to the database where you want to create the indexes. To learn more, see Built-In Roles or Built-In Roles.
절차
AtlasSearchIndexConfig 사용자 정의 리소스를 구성합니다.
다음 예는 lucene.standard 분석기 메서드에 대해 구성된 AtlasSearchIndexConfig 사용자 지정 리소스 사양을 보여줍니다.
참고
여러 atlasDeployment 사용자 지정 리소스가 동일한 atlasSearchIndexConfiguration 사용자 지정 리소스를 참조할 수 있습니다.
예시:
다음 명령을 실행합니다:
cat <<EOF | kubectl apply -f - apiVersion: atlas.mongodb.com/v1 kind: AtlasSearchIndexConfig metadata: name: atlassearchindexconfig-sample namespace: mongodb-atlas-system spec: analyzer: lucene.standard searchAnalyzer: lucene.standard EOF
사용 가능한 매개변수에 대해 자세히 알아보려면 AtlasSearchIndexConfig 사용자정의 리소스를 참조하세요.
AtlasDeployment 사용자 정의 리소스를 구성합니다.
spec.deploymentSpec.searchIndexes 구성 객체.
이 객체에는 다음 매개변수가 적용됩니다.
Parameter | 설명 |
|---|---|
| 하나 이상의 Atlas Search 인덱스가 있는 컬렉션이 포함된 기존 데이터베이스를 식별하는 사람이 읽을 수 있는 레이블입니다. 중요: 지정하는 데이터베이스 가 이미 존재해야 합니다. 기존 데이터베이스 가 없는 경우 데이터베이스를 만듭니다. |
| 1개 이상의 Atlas Search 인덱스가 포함된 컬렉션을 식별하는 사람이 읽을 수 있는 라벨입니다. |
| 인덱스의 유형입니다. Atlas에서 허용하는 값은 다음과 같습니다.
|
|
|
|
|
사용 가능한 매개변수에 대해 자세히 알아보려면 AtlasDeployment 사용자정의 리소스를 참조하세요.
예시:
다음 명령을 실행합니다.
cat <<EOF | kubectl apply -f - apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster namespace: mongodb-atlas-system spec: projectRef: name: my-project deploymentSpec: backupEnabled: true clusterType: REPLICASET name: Test-cluster-M10 replicationSpecs: - regionConfigs: - backingProviderName: AWS electableSpecs: instanceSize: M10 nodeCount: 3 priority: 7 providerName: AWS regionName: US_EAST_1 zoneName: Zone 1 searchIndexes: - DBName: sample_airbnb collectionName: listingsAndReviews name: my-index search: mappings: dynamic: true searchConfigurationRef: name: atlassearchindexconfig-sample namespace: mongodb-atlas-system type: search terminationProtectionEnabled: false EOF