Para agentes de IA: um índice de documentação está disponível em https://www.mongodb.com/pt-br/docs/llms.txt — as versões de markdown de todas as páginas estão disponíveis anexando .md a qualquer caminho de URL.
Menu Docs

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.

Observação

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.

    Consulte Instalar a MongoDB Community Edition para obter tutoriais de instalação.

    Observação

    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.

  • Um conjunto de réplicas iniciadas com controle de acesso ao arquivo-chave.

1

Clique no link a seguir para baixar o tarball Pesquisar na comunidade.

Para arquiteturas ARM, use o tarball compatível com ARM.

Para arquiteturas AMD x86_64, use o tarball compatível com AMD x86-64.

2

See Verify Integrity of mongot Packages for more information.

3

Execute o seguinte comando para extrair o tarball:

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

Observação

Se o seu navegador descompactar automaticamente o arquivo como parte das transferências, a extensão do arquivo será .tar.

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

4

Se você tiver um conjunto de réplica existente que deseja usar, configure os parâmetros mongod a seguir para rotear as queries do Search e do MongoDB Vector Search e gerenciar índices.

Parâmetro
Descrição

searchIndexManagementHostAndPort

O endereço do host de mongot.

mongotHost

O endereço do host de mongot.

Você deve especificar o mesmo endereço em searchIndexManagementHostAndPort e mongotHost.

skipAuthenticationToSearchIndexManagementServer

Especifica se a autenticação está habilitada para o servidor de gerenciamento de índice de pesquisa

useGrpcForSearch

Especifica se o RGPC está ativado para o MongoDB Search

Por exemplo, você pode adicionar as seguintes linhas ao seu arquivo de configuração do mongod e então reiniciar o 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. Conecte-se a mongosh como usuário administrador.

    mongosh --port 27017 -u <your_admin_username> -p <your_admin_password>
  2. Conecta-se ao banco de dados admin.

    Execute o seguinte comando para conectar ao banco de dados do admin :

    use admin
  3. Crie seu usuário mongot .

    Para criar um usuário com a função searchCoordinator:

    • Substitua <your-mongot-username> por um nome de usuário para o seu usuário mongot

    • Substitua <your-mongot-password> pela senha que você especificou em seu passwordFile

    • Executar o comando

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

Crie um arquivo de senha para mongot se conectar a mongod.

Por exemplo, selecione seu sistema operacional e substitua <mongot_password> por sua senha. Em seguida, execute o seguinte comando para criar um arquivo chamado passwordFile:

echo -n "mongotPassword" > passwordFile
chmod 400 passwordFile

Observação

O sinalizador -n impede uma nova linha à direita.

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:

Aviso

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 aumentar a segurança, considere restringir server.grpc.address a interfaces específicas que sejam controladas e protegidas na camada de rede, como localhost ou outros endereços internos confiáveis.

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

Observação

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

8

Execute o script do iniciador mongot que você baixou com o tarball. O roteiro está na pasta mongot-community.

Alterar para a pasta mongot-community:

cd <path-to-mongot>

Para iniciar o mongot com o arquivo de configuração de amostra, emita o seguinte comando:

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

O endpoint retorna uma das seguintes opções na resposta:

  • 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

Para soltar o usuário do mongotUser, execute os seguintes comandos:

use admin
db.dropUser("mongotUser")

For details, see db.dropUser().

2

Para interromper o binário mongot, use Ctrl + C na sessão do terminal em que ele está sendo executado.

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

Para remover o arquivo de chave e o arquivo de senha, execute os seguintes comandos usando o caminho completo para o arquivo de chave e o arquivo de senha:

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

Para remover os registros e o diretório de registro do mongot, execute o seguinte comando usando o caminho completo do diretório de registro:

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

Para remover o diretório de dados que armazena dados mongot, execute o seguinte comando usando o caminho completo para o diretório de dados mongot :

rm /path/to/mongot/data