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.키 파일 액세스 제어가 포함된 시작된 복제본 세트 .
절차
Download the mongot tarball.
다음 링크를 클릭하여 커뮤니티 tarball에서 검색을 다운로드 .
ARM 아키텍처의 경우 ARM 호환 tarball을 사용합니다.
AMD x86_64 아키텍처의 경우 AMD x86-64-호환 tarball을 사용합니다.
(Optional). Verify the integrity of the tarball package.
See Verify Integrity of mongot Packages for more information.
Extract the mongot tarball.
다음 명령을 실행하여 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.
Configure mongod to communicate with mongot.
사용하려는 기존 복제본 세트 있는 경우 다음 mongod 매개변수를 구성하여 검색 및 MongoDB Vector Search 쿼리를 라우팅하고 인덱스를 관리 .
Parameter | 설명 |
|---|---|
|
|
|
|
| 검색 인덱스 관리 서버에 대해 인증 사용할지 여부를 지정합니다. |
| MongoDB Search에 GRPC를 사용할지 여부를 지정합니다. |
예시 를 들어 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.
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.
관리자로
mongosh에 연결합니다.mongosh --port 27017 -u <your_admin_username> -p <your_admin_password> admin데이터베이스에 연결합니다.다음 명령을 실행하여
admin데이터베이스 에 연결합니다.use admin mongot사용자를 만듭니다.searchCoordinator역할 가진 사용자를 만들려면 다음을 수행합니다.<your-mongot-username>을mongot사용자의 사용자 이름 으로 바꿉니다.<your-mongot-password>을(를)passwordFile에 지정한 비밀번호로 바꿉니다.명령 실행
db.createUser( { user: <mongot_username>, pwd: <mongot_password>, roles: [ "searchCoordinator"] } )
비밀번호 파일 만듭니다.
mongod에 연결할 mongot 의 비밀번호 파일 만듭니다.
예시 들어 운영 체제를 선택하고 <mongot_password> 을(를) 비밀번호로 바꿉니다. 그런 다음, 다음 명령을 실행 passwordFile이라는 파일 만듭니다.
echo -n "mongotPassword" > passwordFile chmod 400 passwordFile
참고
-n 플래그는 후행 개행을 방지합니다.
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:
경고
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.
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
엔드포인트는 응답에서 다음 중 하나를 반환합니다.
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
MongoDB Search 및 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
mongotUser 사용자를 삭제하려면 다음 명령을 실행 .
use admin db.dropUser("mongotUser")
For details, see db.dropUser().