MongoDB Community Edition에서 MongoDB Search 및 MongoDB 벡터 검색 프로세스인 mongot을(를) 설치할 수 있습니다. mongot 프로세스는 Red Hat, Ubuntu, Debian, SUSE, Amazon Linux와 같은 모든 Linux 배포판에 대해 .tgz 확장자를 가진 tarball 형태로 배포서버를 사용할 수 있습니다.
참고
실험용 배포서버로 더 빠르게 온보딩하려면 자체 관리형 배포서버에 대한 다음 튜토리얼을 참조하세요.
시작하기 전에
자체 관리형 배포서버에 mongot 을(를) 설치하려면 다음과 같은 전제 조건이 있어야 합니다.
MongoDB Community Edition v8.3 이상.
See Install MongoDB Community Edition for installation tutorials.
참고
You must have MongoDB 8.3 or later to run MongoDB Search and MongoDB Vector Search process, whether you use a standalone self-managed deployment or deploy with the MongoDB Controllers for Kubernetes Operator. For more information, see Compatibility and Requirements for
mongot.키 파일 액세스 제어가 포함된 시작된 복제본 세트 .
절차
Download the mongot tarball.
Download the latest Search in Community tarball for your system architecture from the MongoDB Search in Community Download Center.
To download a specific version from the command line, replace {VERSION_NUMBER} with the version of mongot that you want and run the command for your system architecture:
wget https://downloads.mongodb.org/mongodb-search-community/{VERSION_NUMBER}/mongot_community_{VERSION_NUMBER}_linux_aarch64.tgz
wget https://downloads.mongodb.org/mongodb-search-community/{VERSION_NUMBER}/mongot_community_{VERSION_NUMBER}_linux_x86_64.tgz
(선택 사항). tarball 패키지의 무결성을 확인합니다.
자세한 내용은 mongot 패키지의 무결성 확인 을 참조하세요.
Extract the mongot tarball.
Replace {VERSION_NUMBER} with the version of mongot that you downloaded and run the command for your system architecture to extract the tarball:
tar -zxvf mongot_community_{VERSION_NUMBER}_linux_aarch64.tgz
tar -zxvf mongot_community_{VERSION_NUMBER}_linux_x86_64.tgz
참고
웹 브라우저가 다운로드 의 일부로 파일 의 압축을 자동으로 해제하는 경우 파일 확장자는 .tar입니다.
tarball에는 샘플 설정 파일, mongot 런처 스크립트 및 MongoDB Search 및 벡터 검색 라이선스 정보가 포함되어 있습니다.
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.
참고
The mongotHost, searchIndexManagementHostAndPort, and useGrpcForSearch parameters are set only at startup. You can't change them at runtime with setParameter. To point mongod at a different mongot instance, update these parameters in the mongod configuration file and restart mongod.
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역할 가진 사용자를 만들려면 다음을 수행합니다.<mongot-username>을mongot사용자의 사용자 이름 으로 바꿉니다.<mongot-password>를 다음 단계의passwordFile에 지정한 비밀번호로 바꾸십시오.다음 명령을 실행합니다:
db.createUser( { user: <mongot-username>, pwd: <mongot-password>, roles: [ "searchCoordinator"] } )
비밀번호 파일 만듭니다.
mongod에 연결할 mongot 의 비밀번호 파일 만듭니다.
예시 들어 운영 체제를 선택하고 <mongot-password> 을(를) 비밀번호로 바꿉니다. 그런 다음, 다음 명령을 실행 passwordFile이라는 파일 만듭니다.
echo -n "<mongot-password>" > passwordFile chmod 400 passwordFile
참고
-n 플래그는 후행 개행을 방지합니다.
echo|set /p="mongotPassword" > passwordFile
[System.IO.File]::WriteAllText("passwordFile", "mongotPassword")
mongot 구성 옵션을 지정합니다.
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.
tarball에는 기본값 mongot 설정을 가진 다음 샘플 구성 파일 config.default.yml이(가) 포함되어 있습니다. 배포서버 에 대한 설정을 수정할 수 있습니다.
경고
시스템 토폴로지에 따라 mongot 쿼리 서버를 MongoDB 클러스터에서 액세스할 수 있는 인터페이스에 바인딩해야 할 수 있습니다. 0.0.0.0 IP 주소에 바인딩하는 것이 허용되지만 서버가 모든 공용 네트워크에 노출되고 무단 액세스의 위험이 있습니다.
보안을 강화하려면 localhost 또는 기타 신뢰할 수 있는 내부 주소와 같이 네트워크 계층에서 제어되고 보호되는 특정 인터페이스로 server.grpc.address 를 제한하는 것이 좋습니다.
syncSource: replicaSet: hostAndPort: "localhost:27017" # Replace with the mongod host and port. scramAuth: username: mongotUser # Replace with mongod username enabled with "searchCoordinator" role. authSource: admin # Replace with the database to authenticate the user against. passwordFile: "/etc/mongot/secrets/passwordFile" # Replace with path to password file for the above user. tls: enabled: 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
참고
설정 파일의 dataPath 디렉토리는 mongot을 실행하는 사용자가 쓰기 가능해야 합니다.
The sample configuration uses SCRAM authentication with the scramAuth block. You must configure exactly one authentication mechanism for the sync source: either SCRAM or X.509. To authenticate with a TLS client certificate instead of a username and password, use the x509 block. For both mechanisms, including the sharded-cluster syncSource.router configuration, see Configure Authentication and Authorization for mongot.
This sample runs mongot and mongod on the same host, so it binds server.grpc.address to localhost and disables TLS. If you run mongot and mongod on separate hosts, complete the following steps instead:
Bind
server.grpc.addressto a network interface thatmongodcan reach, rather thanlocalhost.Set the
mongodmongotHostandsearchIndexManagementHostAndPortparameters to that address.Enable TLS for the sync source and gRPC connections. Running without TLS is only appropriate when
mongotandmongodrun on the same host. To configure TLS, see Configure TLS Encryption formongot.
logging.logPath 를 사용하여 mongot 이 쓰는 로그 파일의 경로를 지정합니다. 로그 파일 경로를 지정하지 않으면 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
엔드포인트는 응답에서 다음 중 하나를 반환합니다.
SERVINGmongot프로세스가 실행 중인 경우mongot인덱스의 상태를 확인하지 않으므로 쿼리를 제공하지 않을 수 있으며, 쿼리를 제공하려면 인덱스는Ready상태여야 합니다.NOT_SERVINGmongot프로세스가 실행 중이 아닌 경우
추가 세부 정보는 mongot 연결 확인을 참조하세요.
MongoDB Search 및 MongoDB Vector Search 제거
시스템에서 MongoDB Search 및 MongoDB 벡터 검색를 제거하려면 mongot, 설정 파일, 데이터 및 로그가 포함된 모든 디렉토리를 제거해야 합니다. 다음 섹션에서는 필요한 단계를 안내합니다.
Drop the mongotUser user
mongotUser 사용자를 삭제하려면 다음 명령을 실행 .
use admin db.dropUser("mongotUser")
For details, see db.dropUser().
모든 로그 및 로그 디렉토리를 제거합니다. mongot
mongot에 대한 로그 및 로그 디렉토리를 제거하려면 logging.logPath에 지정한 로그 디렉토리의 전체 경로를 사용하여 다음 명령을 실행합니다.
rm -rf /path/to/mongot-logs