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.
Nota
To onboard quickly with a deployment for experimentation, see the following tutorials for Self-Managed deployments:
Antes de comenzar
To install mongot in a self-managed deployment, you must have the following prerequisites:
MongoDB Community Edition v8.2 or later.
See Install MongoDB Community Edition for installation tutorials.
Nota
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.Un set de réplicas iniciado con control de acceso mediante archivo de claves.
Procedimiento
Download the mongot tarball.
Hacer clic en el siguiente enlace para descargar el tarball de Buscar en la Community.
Para las arquitecturas ARM, use el tarball compatible con ARM.
Para las arquitecturas AMD x86_64, utiliza el tarball compatible con AMD x86-64.
(Optional). Verify the integrity of the tarball package.
See Verify Integrity of mongot Packages for more information.
Extract the mongot tarball.
Ejecuta el siguiente comando para extraer el archivo tar:
tar -zxvf mongot_community_0.53.0_linux_aarch64.tgz
tar -zxvf mongot_community_0.53.0_linux_x86_64.tgz
Nota
Si su navegador web descomprime automáticamente el archivo como parte de la descarga, la extensión del archivo es .tar.
The tarball contains a sample configuration file, the mongot launcher script, and MongoDB Search and Vector Search license information.
Configure mongod to communicate with mongot.
Si se desea utilizar un set de réplicas existente, se deben configurar los siguientes parámetros mongod para enrutar las queries de búsqueda y MongoDB Vector Search y gestionar los índices.
Parameter | Descripción |
|---|---|
| La dirección del host de |
| La dirección del host de Debes especificar la misma dirección en |
| Especifica si la autenticación está activada para el servidor de gestión del índice de búsqueda |
| Especifica si GRPC está activado para MongoDB Search |
Por ejemplo, puede añadir las siguientes líneas a su archivo de configuración mongod y luego reiniciar 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.
Create a user for the mongot process on your MongoDB deployment.
mongot must be able to connect to your MongoDB deployment through a user with the searchCoordinator role.
Conéctese a
mongoshcomo el usuario administrador.mongosh --port 27017 -u <your_admin_username> -p <your_admin_password> Conéctese a la base de datos
admin.Ejecute el siguiente comando para conectarse a la base de datos
admin:use admin Cree su usuario
mongot.Para crear un usuario con el rol
searchCoordinator:Se debe sustituir
<your-mongot-username>por un nombre de usuario para el usuariomongotReemplace
<your-mongot-password>con la contraseña que especificó en supasswordFileEjecute el comando
db.createUser( { user: <mongot_username>, pwd: <mongot_password>, roles: [ "searchCoordinator"] } )
Cree su archivo de contraseñas.
Crea un archivo de contraseña para mongot para conectarte a mongod.
Por ejemplo, se debe seleccionar el sistema operativo y reemplazar <mongot_password> con la contraseña. A continuación, se debe ejecutar el siguiente comando para crear un archivo llamado passwordFile:
echo -n "mongotPassword" > passwordFile chmod 400 passwordFile
Nota
La opción -n evita una nueva línea al final.
echo|set /p="mongotPassword" > passwordFile
[System.IO.File]::WriteAllText("passwordFile", "mongotPassword")
Specify your mongot configuration options.
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:
Advertencia
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.
Para mejorar la seguridad, considera restringir server.grpc.address a interfaces específicas que estén controladas y protegidas en la capa de red, como localhost u otras direcciones internas confiables.
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
Nota
The dataPath directory in your configuration file must be writable by the user that runs mongot.
Inicie el proceso de mongot.
Ejecuta el script del lanzador mongot que descargó con el tarball. El script se encuentra en la carpeta mongot-community.
Cambie a la carpeta mongot-community:
cd <path-to-mongot>
Para comenzar mongot con el archivo de configuración de muestra, emite el siguiente comando:
./mongot --config config.default.yml
Verify the health of the mongot process.
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
El endpoint devuelve uno de los siguientes en la respuesta:
SERVING, if themongotprocess is runningmongotmight not serve queries as it doesn't check the status of the indexes, which must be inReadystate to serve queries.NOT_SERVING, if themongotprocess isn't running
Desinstala MongoDB Search y MongoDB Vector Search
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.
Drop the mongotUser user
Para descartar al usuario mongotUser, ejecute los siguientes comandos:
use admin db.dropUser("mongotUser")
For details, see db.dropUser().