For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
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.

Note

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:

1

Click the following link to download the Search in Community tarball.

For ARM architectures, use the ARM-compatible tarball.

For AMD x86_64 architectures, use the AMD x86-64-compatible tarball.

2

See Verify Integrity of mongot Packages for more information.

3

Run the following command to extract the tarball:

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

Note

If your web browser automatically unzips the file as part of the download, the file extension is .tar.

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

4

If you have an existing replica set that you want to use, configure the following mongod parameters to route Search and MongoDB Vector Search queries and manage indexes.

Parameter
Description

searchIndexManagementHostAndPort

The host address of mongot.

mongotHost

The host address of mongot.

You must specify the same address in searchIndexManagementHostAndPort and mongotHost.

skipAuthenticationToSearchIndexManagementServer

Specifies whether authentication is enabled for the Search Index Management Server

useGrpcForSearch

Specifies whether GRPC is enabled for MongoDB Search

For example, you can add the following lines to your mongod config file and then restart 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. Connect to mongosh as the admin user.

    mongosh --port 27017 -u <your_admin_username> -p <your_admin_password>
  2. Connect to the admin database.

    Run the following command to connect to the admin database:

    use admin
  3. Create your mongot user.

    To create a user with the searchCoordinator role:

    • Replace <mongot-username> with a username for your mongot user

    • Replace <mongot-password> with the password that you specify in your passwordFile in the next step

    • Run the following command:

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

Create a password file for mongot to connect to mongod.

For example, select your operating system and replace <mongot-password> with your password. Then, run the following command to create a file called passwordFile:

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

Note

The -n flag prevents a trailing newline.

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:

Warning

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.

To enhance security, consider restricting server.grpc.address to specific interfaces that are controlled and protected at the network layer such as localhost or other trusted internal addresses.

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

Note

The dataPath directory in your configuration file must be writable by the user that runs mongot.

Use logging.logPath to specify the path of the log file that mongot writes to. If you do not specify a log file path, mongot logs to standard output.

8

Run the mongot launcher script that you downloaded with the tarball. The script is in the mongot-community folder.

Change to the mongot-community folder:

cd <path-to-mongot>

To start mongot with the sample config file, issue the following command:

./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

The endpoint returns one of the following in the response:

  • 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

For additional details, see Verify Your mongot Connection.

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

To drop the mongotUser user, run the following commands:

use admin
db.dropUser("mongotUser")

For details, see db.dropUser().

2

To stop the mongot binary, use Ctrl + C in the terminal session it's running in.

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

To remove the keyfile and password file, run the following commands using the full path to the keyfile and the password file:

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

To remove the logs and log directory for mongot, run the following command using the full path to the log directory you specified in logging.logPath:

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

To remove the data directory that stores mongot data, run the following command using the full path to your mongot data directory:

rm /path/to/mongot/data