MongoDB Search enables full-text search capabilities in your Kubernetes environment by deploying the mongot process alongside your MongoDB database deployment (mongod). The mongot process manages search indexes, sources data from the database, and processes $search and $searchMeta queries. This eliminates the need to maintain separate search systems while providing advanced search features.
MongoDB Searchを配置するには、Kubernetes Operatorが取り込んでmongotポッドを配置し、specで指定された永続ストレージをリクエストするMongoDBSearch Custom Resource (CR)を適用します。
配置手順については、MongoDB Search とベクトル検索を配置する。を参照してください。
The mongot Process
各 mongot プロセスには、データベースや他の検索ノードと共有されていない独自の永続ボリュームがあります。ストレージ は、データベースから継続的に提供されるデータから構築されたインデックスを維持するために使用されます。インデックス定義(メタデータ)はデータベース自体に保存されます。
mongot は、次のアクションを実行します。
インデックスを管理します。
mongotは、データベース内のインデックス定義を更新します。データベースからデータを取得します。
mongotノードは、データベースへの永続的な接続を確立し、データベースからインデックスをリアルタイムで更新します。検索クエリを処理します。
When
mongodreceives a$searchor$searchMetaquery, it directs the query to one of themongotnodes. Themongotthat receives the query processes the query, aggregates the data, and returns the results tomongod, which forwards the results to the user.
The mongot components are tightly coupled with a single MongoDB replica set and cannot be shared across multiple databases or replica sets. Each replica set deployment has its own dedicated search nodes. To learn more about Search node architecture, see Node Architecture in the MongoDB Search documentation.
ネットワーキング
mongot と mongod の間のネットワーク接続は両方向で行われます。
mongotは、インデックスの構築とクエリの実行に使用されるデータを取得するためにレプリカセットへの接続を確立します。mongodはmongotに接続して、インデックス マネジメントやデータのクエリなどの検索関連の操作を転送します。
mongod は、すべての検索クエリのプロキシとして機能します。mongot と直接交流することはありません。
演算子マネージド配置
mongot プロセスと mongod プロセスの両方がKubernetesクラスター内に配置されている場合、Kubernetes Operator は両方のプロセスの構成を自動的に実行します。具体的には、Kubernetes Operator は次のことを行います。
Finds the MongoDB CR referenced by MongoDBSearch using
spec.source.mongodbResourceRef, or by a naming convention by looking for the MongoDB CR with the same name as MongoDBSearch.Generates
mongotconfiguration in a YAML file and saves it to a config map named<MongoDBSearch.metadata.name>-search-config.Deploys the MongoDB Search stateful set named
<MongoDBSearch.metadata.name>-searchwith storage and resource requirements configured according tospec.persistenceandspec.resourceRequirementsin the CR.mongotホストのホスト名とポート番号を含む必要なsetParameterオプションを追加して、すべてのmongodプロセスの構成を更新します。
外部 MongoDB 配置
MongoDB レプリカセットが Kubernetes の外にある場合は、Kubernetes 演算子を使用して mongot を配置し、手動でいくつかの手順を実行します。Kubernetes 演算子は検索ポッドの構成を取り扱いますが、MongoDB ノードとネットワークを再構成する必要があります。
セキュリティ
If the MongoDB server is inside the Kubernetes cluster, the Kubernetes Operator automatically sets up keyfile authentication for MongoDB Search. If the MongoDB server is external, you must create a Kubernetes Secret containing the replica set's keyfile credential and reference it in the MongoDBSearch CR.
制限
次のアーキテクチャではMongoDB Searchを配置できません。
IBM Power (ppc64le)
IBM Z (s390x)
Tip
MongoDB Search とベクトル検索を配置する — MongoDB Search とベクトル検索を配置する
MongoDB Search およびベクトル検索設定 — MongoDB Search CR 設定