Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
Enterprise Kubernetes 演算子
/ /

スタンドアロンの MongoDB インスタンスの配置

注意

このページのMongoDB Ops Managerが表示されている場所では、 Cloud Managerを置き換えることができます。

重要

  • Kubernetes演算子を使用して、MongoDB Cloud ManagerMongoDB Ops Managerおよび バージョン6.0 .x 以降で リソースを配置できます。

  • Atlas 演算子を使用して、MongoDB リソースを Atlas に配置できます。

用に スタンドアロン のMongoDB MongoDB Ops Managerインスタンスを配置して管理できます。テストと開発にはスタンドアロン インスタンスを使用します。 これらの配置は、レプリケーションが機能せず、可用性が低いため、実稼働システムでは使用しないでください。 すべての配置ではレプリカセットを使用します。 レプリカセットの詳細については、「 レプリカセットを配置する 」を参照してください。

To deploy a standalone using an object, you must:

注意

To avoid storing secrets in single-cluster Kubernetes deployments, you can migrate all secrets to a secret storage tool. Deployments on multiple Kubernetes clusters don't support storing secrets in secret storage tools, such as HashiCorp Vault.

1

まだ作成していない場合は、次のコマンドを実行して、作成した名前空間ですべてのkubectlコマンドを実行します

注意

MongoDB Ops Manager リソースを複数の Kubernetes クラスター MongoDB 配置に配置している場合、次の手順に従います。

  • contextを中央クラスターの名前に設定します(例: kubectl config set context "$MDB_CENTRAL_CLUSTER_FULL_NAME"

  • MongoDB のマルチ配置に使用したのと同じスコープ(例: kubectl config --namespace "mongodb"--namespaceを設定します。

kubectl config set-context $(kubectl config current-context) --namespace=<metadata.namespace>
2

これは、必要な構成に合わせて変更できる YAMLファイルです。 強調表示された設定を、必要なスタンドアロン構成に合わせて変更します。

---
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: <my-standalone>
spec:
version: "4.2.2-ent"
opsManager:
configMapRef:
name: <configMap.metadata.name>
# Must match metadata.name in ConfigMap file
credentials: <mycredentials>
type: Standalone
persistent: true
...
3
4
キー
タイプ
説明

string

Label for this Kubernetes standalone object.

リソース名は 44 文字以下にする必要があります。

To learn more, see metadata.name and Kubernetes documentation on names.

my-project

string

このスタンドアロンにインストールされている MongoDB のバージョン。

形式は、 MongoDB Community Editionでは X.Y.Z、Enterprise エディションでは X.Y.Z-ent です。

重要:互換性のあるMongoDB Serverバージョンを選択していることを確認してください。 互換性のあるバージョンは、 MongoDBデータベースリソースが使用する基本イメージによって異なります。

MongoDB のバージョン管理の詳細については、MongoDB マニュアルの「 MongoDBのバージョン管理 」を参照してください。

string

Name of the ConfigMap with the Ops Manager connection configuration. The spec.cloudManager.configMapRef.name setting is an alias for this setting and can be used in its place.

この値は、作成するリソースと同じ名前空間に存在する必要があります。

<myproject>

string

Operator が と通信するための MongoDB Ops ManagerAPI認証情報として 作成KubernetesMongoDB Ops Manager したシークレットの名前。

認証情報を保持するMongoDB Ops Manager Kubernetes Secretオブジェクトは、作成するリソースと同じ名前空間に存在する必要があります。

重要: Kubernetes Operator は、シークレットへの変更を追跡し、MongoDB リソースの状態を調整します。

<mycredentials>

string

作成するMongoDBリソースのタイプ。

Standalone

string

任意。

この値がtrueの場合、 spec.podSpec.persistence.singleはデフォルト値の16Giに設定されます。

To change your Persistent Volume Claims configuration, configure the following collections to meet your deployment requirements:

WARNING: Grant your containers permission to write to your Persistent Volume. The Kubernetes Operator sets fsGroup = 2000, runAsUser = 2000, and runAsNonRoot = true in securityContext. Kubernetes Operator sets fsgroup equal to runAsUser to make the volume writable for a user that runs the main process in the container. To learn more, see Configure a Security Context for a Pod or Container and the related discussion in the Kubernetes documentation. If redeploying the resource doesn't fix issues with your Persistent Volume, contact MongoDB Support.

If you do not use Persistent Volumes, the Disk Usage and Disk IOPS charts cannot be displayed in either the Processes tab on the Deployment page or in the Metrics page when reviewing the data for this deployment.

true

6
7

次の Kubernetes コマンドを呼び出して、スタンドアロンを作成します。

kubectl apply -f <standalone-conf>.yaml
8

MongoDBリソースのステータスを確認するには、次のコマンドを使用します。

kubectl get mdb <resource-name> -o yaml -w

-w (監視)フラグが設定されている場合、構成が変更されると、ステータスフェーズがRunning状態に達するまで出力が直ちに更新されます。 リソース配置ステータスの詳細については、 「 Kubernetes 演算子のトラブルシューティング 」を参照してください。

シャーディングされたクラスターのトラブルシューティングを行うには、以下を参照してください。

戻る

配置

項目一覧