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

Install or Uninstall mongot on Linux

You can install the MongoDB Search and MongoDB Vector Search process, mongot, in MongoDB Community Edition. The mongot process is available for deployment for all Linux distributions such as Red Hat, Ubuntu, Debian, SUSE, and Amazon Linux as a tarball with the .tgz extension.

注意

To onboard quickly with a deployment for experimentation, see the following tutorials for Self-Managed deployments:

To install mongot in a self-managed deployment, you must have the following prerequisites:

  • MongoDB Community Edition v8.2 or later.

    インストール チュートリアルについては、 MongoDB Community Edition のインストール を参照してください。

    注意

    You must have a minimum of MongoDB 8.2.0 to run MongoDB Search and MongoDB Vector Search process with a self-managed deployment. For more information, see Compatibility and Requirements for mongot.

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

1

Community tarball で検索するには、次のリンクをクリックします。

ARM アーキテクチャの場合は、ARM 互換の tarball を使用します。

AMD x86_64 アーキテクチャの場合は、AMD x86-64 互換の tarball を使用します。

2

See Verify Integrity of mongot Packages for more information.

3

次のコマンドを実行して、tarball を抽出します。

tar -zxvf mongot_community_0.53.0_linux_aarch64.tgz
tar -zxvf mongot_community_0.53.0_linux_x86_64.tgz

注意

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

The tarball contains a sample configuration file, the mongot launcher script, and MongoDB Search and Vector Search license information.

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.

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 ロールを持つユーザーを作成するには:

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

    • <your-mongot-password>passwordFile で指定したパスワードに置き換えます

    • コマンドを実行する

    db.createUser(
    {
    user: <mongot_username>,
    pwd: <mongot_password>,
    roles: [ "searchCoordinator"]
    }
    )
6

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

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

echo -n "mongotPassword" > 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.

The tarball contains the following sample configuration file, config.default.yml, with the default mongot settings. You can modify the settings for your deployment:

警告

Depending on your system topology, it may be necessary to bind the mongot query server to an interface reachable from your MongoDB Cluster. While binding to the 0.0.0.0 IP address is permitted, it exposes the server to all public networks and carries the risk of unauthorized access.

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

syncSource:
replicaSet:
hostAndPort: "localhost:27017" # Replace with the mongod host and port.
username: mongotUser # Replace with mongod username enabled with "searchCoordinator" role.
passwordFile: "/etc/mongot/secrets/passwordFile" # Replace with path to password file for the above user.
tls: 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

注意

The dataPath directory in your configuration file must be writable by the user that runs 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, if the mongot process is running

    mongot might not serve queries as it doesn't check the status of the indexes, which must be in Ready state to serve queries.

  • NOT_SERVING, if the mongot process isn't running

To remove MongoDB Search and MongoDB Vector Search from a system, you must remove mongot, the configuration files, and any directories containing data and logs. The following section guides you through the necessary steps.

1

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

use admin
db.dropUser("mongotUser")

For details, see db.dropUser().

2

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

3

To remove the mongot and mongod configuration files, run the following commands as root or with sudo by using the full path to your configuration files:

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

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

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

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

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

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

rm /path/to/mongot/data