AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

Install or Uninstall mongot on Linux

MongoDB Community EditionにMongoDB SearchとMongoDBベクトル検索プロセスmongotをインストールできます。.tgz拡張子を持つターボールとして、Red Hat、Ubuntu、Debian、SUSE、Amazon LinuxなどのすべてのLinuxディストリビューションでmongotプロセスを配置できます。

注意

実験用の配置でより迅速にオンボードするには、自己管理型配置の次のチュートリアルを参照してください。

自己管理型配置に mongot をインストールするには、次の前提条件が必要です。

  • MongoDB Community Edition v8.3 以降。

    See Install MongoDB Community Edition for installation tutorials.

    注意

    You must have MongoDB 8.3 or later to run MongoDB Search and MongoDB Vector Search process, whether you use a standalone self-managed deployment or deploy with the MongoDB Controllers for Kubernetes Operator. For more information, see Compatibility and Requirements for mongot.

  • キーファイル アクセス制御を使用して開始されたレプリカセット。

1

Download the latest Search in Community tarball for your system architecture from the MongoDB Search in Community Download Center.

To download a specific version from the command line, replace {VERSION_NUMBER} with the version of mongot that you want and run the command for your system architecture:

wget https://downloads.mongodb.org/mongodb-search-community/{VERSION_NUMBER}/mongot_community_{VERSION_NUMBER}_linux_aarch64.tgz
wget https://downloads.mongodb.org/mongodb-search-community/{VERSION_NUMBER}/mongot_community_{VERSION_NUMBER}_linux_x86_64.tgz
2

詳細については、「mongot パッケージの整合性の検証」を参照してください。

3

Replace {VERSION_NUMBER} with the version of mongot that you downloaded and run the command for your system architecture to extract the tarball:

tar -zxvf mongot_community_{VERSION_NUMBER}_linux_aarch64.tgz
tar -zxvf mongot_community_{VERSION_NUMBER}_linux_x86_64.tgz

注意

ウェブ ブラウザがダウンロード後にファイルを自動的に解凍する場合、ファイル拡張子は .tar です。

tarball には、サンプル構成ファイル、mongot ランサー スクリプト、MongoDB Search およびベクトル検索のライセンス情報が含まれています。

4

使用する既存のレプリカセットがある場合は、次の mongod パラメータを設定して、検索クエリとMongoDB ベクトル検索クエリをルーティングしてインデックスを管理します。

Parameter
説明

searchIndexManagementHostAndPort

mongot のホストアドレス。

mongotHost

mongot のホストアドレス。

searchIndexManagementHostAndPortmongotHost では同じアドレスを指定する必要があります。

skipAuthenticationToSearchIndexManagementServer

検索インデックス管理サーバーの認証を有効にするかどうかを指定します

useGrpcForSearch

MongoDB Search で CRPC が有効かどうかを指定します

例、mongod 構成ファイルに次の行を追加して、mongod を再起動します。

setParameter:
searchIndexManagementHostAndPort: localhost:27028
mongotHost: localhost:27028
skipAuthenticationToSearchIndexManagementServer: false
useGrpcForSearch: true

See MongoDB Server Parameters for a Self-Managed Deployment for more information on setting mongod parameters. For detailed information about search-specific setParameter options, see MongoDB Search Options.

注意

The mongotHost, searchIndexManagementHostAndPort, and useGrpcForSearch parameters are set only at startup. You can't change them at runtime with setParameter. To point mongod at a different mongot instance, update these parameters in the mongod configuration file and restart mongod.

If you want to deploy a new replica set with keyfile authentication, follow the steps in Deploy Self-Managed Replica Set With Keyfile Authentication.

5

mongot must be able to connect to your MongoDB deployment through a user with the searchCoordinator role.

  1. 管理者ユーザーとして mongosh に接続します。

    mongosh --port 27017 -u <your_admin_username> -p <your_admin_password>
  2. adminデータベースに接続します。

    次のコマンドを実行して、adminデータベースに接続します。

    use admin
  3. mongot ユーザーを作成します。

    searchCoordinator ロールを持つユーザーを作成するには:

    • <mongot-username>mongot ユーザーのユーザー名に置き換え

    • <mongot-password> を、次のステップの passwordFile で指定したパスワードに置き換えます

    • 次のコマンドを実行します:

    db.createUser(
    {
    user: <mongot-username>,
    pwd: <mongot-password>,
    roles: [ "searchCoordinator"]
    }
    )
6

mongod に接続するための mongot 用のパスワードファイルを作成します。

例、オペレーティング システムを選択し、<mongot-password> をパスワードに置き換えます。次に、次のコマンドを実行して passwordFile というファイルを作成します。

echo -n "<mongot-password>" > passwordFile
chmod 400 passwordFile

注意

-n フラグは末尾の改行を防止します。

echo|set /p="mongotPassword" > passwordFile
[System.IO.File]::WriteAllText("passwordFile", "mongotPassword")
7

You can configure mongot with a YAML configuration file. Use the included sample configuration file named config.default.yml or a new configuration file to define the configuration. For more information on mongot configuration options, see mongot Options.

tarball には、デフォルトのmongot 設定を持つ次のサンプル構成ファイルconfig.default.yml が含まれています。配置の設定を変更できます。

警告

システムトポロジーによっては、mongot クエリサーバーを MongoDB クラスターからアクセス可能なインターフェースにバインドする必要がある場合があります。0.0.0.0 IP アドレスへのバインディングは許可されていますが、サーバーがすべてのパブリック ネットワークに公開され、不正アクセスのリスクがあります。

セキュリティを強化するには、localhost やその他の信頼できる内部アドレスなど、ネットワークレイヤーで制御および保護されている特定のインターフェースに server.grpc.address を制限することを検討してください。

syncSource:
replicaSet:
hostAndPort: "localhost:27017" # Replace with the mongod host and port.
scramAuth:
username: mongotUser # Replace with mongod username enabled with "searchCoordinator" role.
authSource: admin # Replace with the database to authenticate the user against.
passwordFile: "/etc/mongot/secrets/passwordFile" # Replace with path to password file for the above user.
tls:
enabled: false
storage:
dataPath: "/var/lib/mongot" # Replace with the path where you want mongot to store search data.
server:
grpc:
address: "localhost:27028" # Replace with the address and port for mongot listen server
tls:
mode: "disabled"
metrics:
enabled: true
address: "localhost:9946"
healthCheck:
address: "localhost:8080"
logging:
verbosity: INFO

注意

構成ファイル内の dataPath ディレクトリは、mongot を実行するユーザーが書き込み可能である必要があります。

The sample configuration uses SCRAM authentication with the scramAuth block. You must configure exactly one authentication mechanism for the sync source: either SCRAM or X.509. To authenticate with a TLS client certificate instead of a username and password, use the x509 block. For both mechanisms, including the sharded-cluster syncSource.router configuration, see Configure Authentication and Authorization for mongot.

This sample runs mongot and mongod on the same host, so it binds server.grpc.address to localhost and disables TLS. If you run mongot and mongod on separate hosts, complete the following steps instead:

  • Bind server.grpc.address to a network interface that mongod can reach, rather than localhost.

  • Set the mongod mongotHost and searchIndexManagementHostAndPort parameters to that address.

  • Enable TLS for the sync source and gRPC connections. Running without TLS is only appropriate when mongot and mongod run on the same host. To configure TLS, see Configure TLS Encryption for mongot.

logging.logPathを使用して、mongotが書き込むログファイルのパスを指定します。ログファイルのパスを指定しない場合、mongotは標準出力にログを出力します。

8

tarball とともにダウンロードした mongot ランサースクリプトを実行します。スクリプトは mongot-community フォルダーにあります。

mongot-community フォルダーに変更します。

cd <path-to-mongot>

サンプル構成ファイルを使用して mongot を起動するには、次のコマンドを実行します。

./mongot --config config.default.yml
9

To verify, send a request by using a HTTP client or curl to the /health endpoint. For example, send a curl request similar to the following sample request:

curl localhost:8080/health

エンドポイントは、応答として次のいずれかを返します。

  • SERVING, mongot プロセスが実行中の場合

    mongot インデックスのステータスをチェックしないため、クエリを処理できない可能性があります。クエリを処理するには、インデックスが Ready 状態である必要があります。

  • NOT_SERVING, mongot プロセスが実行されていない場合

詳細については、mongot 接続を確認するを参照してください。

MongoDB Search と MongoDB ベクトル検索をシステムから削除するには、mongot、構成ファイル、データとログを含むすべてのディレクトリを削除する必要があります。次のセクションで必要な手順をご案内します。

1

mongotUser ユーザーを削除するには、次のコマンドを実行します。

use admin
db.dropUser("mongotUser")

For details, see db.dropUser().

2

mongot バイナリを停止するには、実行中中のターミナルセッションで Ctrl + C を使用します。

3

mongot および mongod 構成ファイルを削除するには、root として、または sudo を使用して、構成ファイルへのフルパスを使用して次のコマンドを実行します。

sudo rm /path/to/config.default.yml
sudo rm /path/to/mongod.conf
4

キーファイルとパスワードファイル を削除するには、キーファイルとパスワードファイルへのフルパスを使用して次のコマンドを実行します。

rm /path/to/keyfile
rm /path/to/passwordFile
5

mongot のログとログディレクトリを削除するには、logging.logPath で指定したログディレクトリへのフルパスを使用して次のコマンドを実行します。

rm -rf /path/to/mongot-logs
6

mongot データを保存しているデータディレクトリを削除するには、mongotデータディレクトリへのフルパスを使用して次のコマンドを実行します。

rm /path/to/mongot/data
このページを評価