The MongoDB Agent downloads MongoDB Server, mongosh, and MongoDB Database Tools binaries into version-specific directories under the download directory. The default download directory is /var/lib/mongodb-mms-automation. Version-specific paths change each time the agent downloads a new version.
이러한 바이너리 파일에 대한 안정적인 경로를 제공하기 위해 에이전트는 다운로드 디렉터리에 다음과 같은 심볼릭 링크를 유지합니다.
심볼릭 링크 이름 | 대상 디렉터리 | 심볼릭 링크 경로 |
|---|---|---|
| The |
|
| The |
|
| The |
|
The examples use the default download directory on Linux and macOS: /var/lib/mongodb-mms-automation. On Windows, the default download directory is C:\MMSAutomation\versions. For example, call mongosh through C:\MMSAutomation\versions\mongosh. If you use a different download directory, change the path prefix to match.
심볼릭 링크는 다운로드 디렉터리 아래의 버전별 디렉터리로 해석됩니다. 이러한 디렉터리는 다음과 같은 명명 패턴을 따릅니다.
MongoDB Server:
mongodb-<platform>-<arch>-<version>, for examplemongodb-linux-x86_64-7.0.14-entMongoDB Shell:
mongosh-<platform>-<arch>-<version>, for examplemongosh-linux-x86_64-2.2.4MongoDB Database Tools:
mongodb-database-tools-<platform>-<arch>-<version>, for examplemongodb-database-tools-linux-x86_64-100.10.0
심볼릭 링크 동작
에이전트가 심볼릭 링크를 자동으로 관리합니다. 사용자는 심볼릭 링크를 직접 생성하거나 업데이트할 필요가 없습니다.
에이전트가 구성 요소의 새 버전을 다운로드하면 해당 구성 요소의 심볼릭 링크가 새 버전을 가리키도록 업데이트합니다. 이 업데이트는 업그레이드 및 다운그레이드 모두에 적용됩니다.
The
mongodbsymlink points to the highest MongoDB Server version installed on the host. When the agent removes the highest version, the symlink points to the highest version that remains.에이전트는 심볼릭 링크를 정기적으로 확인합니다. 심볼릭 링크가 누락되었거나 잘못된 디렉터리를 가리키는 경우, 에이전트는 해당 링크를 다시 생성합니다. 구성된 모든 심볼릭 링크가 유효할 때만 심볼릭 링크 세트가 올바릅니다.
심볼릭 링크의 경로에 파일이나 빈 디렉터리가 이미 존재하는 경우, 에이전트는 이를 심볼릭 링크로 대체합니다.
기능 호환성 버전 변경은 심볼릭 링크에 영향을 미치지 않습니다.
기존 심볼릭 링크의 동작 변경
Earlier agent versions maintained a single symlink named bin in the download directory. It pointed to the bin directory of the MongoDB Shell version that Ops Manager manages. Starting with MongoDB Agent 108.0.29.9148-1 and 109.0.3.9449-1, which ship with Ops Manager 8.0.29 and 9.0.3, the agent maintains the stable symlinks instead.
중요
The agent no longer creates or updates the bin symlink. An existing bin symlink remains in place, but after a MongoDB Shell upgrade it can point to an older version or to a version that the agent removed. Update your scripts to use the new stable symlinks.
스크립트를 업데이트하세요
If your scripts call MongoDB binaries through version-specific paths or through the legacy bin symlink, update them one time to use the stable symlinks. After this change, the scripts continue to work through upgrades and downgrades.
해당 경로들을 안정적인 심볼릭 링크로 바꾸세요.
다음 예시는 변경 전후의 스크립트를 보여줍니다.
MMS=/var/lib/mongodb-mms-automation
# Uses the bin symlink, which the agent# no longer updates$MMS/bin/mongosh "$MONGODB_URI" \ --eval 'db.adminCommand({ ping: 1 })'
# Uses version-specific paths, which break# when Ops Manager upgrades the version$MMS/mongodb-database-tools-linux-x86_64-100.20.1/bin/mongodump \ --uri "$MONGODB_URI" \ --out "/backups/$(date +%F)"$MMS/mongodb-linux-x86_64-9.0.7-ent/bin/mongod \ --version변경 후에는 동일한 스크립트가 안정적인 심볼릭 링크를 사용합니다.
MMS=/var/lib/mongodb-mms-automation
$MMS/mongosh/mongosh "$MONGODB_URI" \ --eval 'db.adminCommand({ ping: 1 })'$MMS/mongodb-tools/mongodump \ --uri "$MONGODB_URI" --out "/backups/$(date +%F)"$MMS/mongodb/mongod --versionThe mongodb symlink points to the highest MongoDB Server version installed on the host, which might not be the version your script requires. To call a specific version, use that version's directory under the download directory.
문제 해결
업그레이드 후 스크립트 또는 배포가 실패하는 경우 다운로드 디렉터리의 심볼릭 링크 상태를 확인하십시오.
증상 | 가능한 원인 | 해상도 |
|---|---|---|
Ops Manager가 배포에 대한 변경 사항 적용을 완료하지 못하고 에이전트 로그에 심볼릭 링크 생성 오류가 표시됩니다. | 다운로드 디렉터리에 심볼릭 링크와 동일한 이름을 가진 비어 있지 않은 디렉터리가 존재합니다. | 해당 디렉터리를 이동하거나 삭제하십시오. 그러면 에이전트가 심볼릭 링크를 생성합니다. |
The | Ops Manager는 호스트에서 해당 구성 요소를 관리하지 않습니다. | 해당 사항 없음. 대신 로컬 설치 경로를 사용하십시오. |
다운로드 디렉토리를 변경하려면 인터넷 액세스를 제한하도록 배포 구성을 참조하세요.