CentOS 7 - yum은 mongodb를 설치하지 않습니다.

CentOS 7 - yum은 mongodb를 설치하지 않습니다.

mongodb v3.4를 설치하려고 합니다.몽고DB.
먼저 "/etc/yum.repo.d/mongodb.repo"를 생성한 다음 이 저장소 정보를 파일에 붙여넣습니다.

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

mongodb-org를 설치하려고 했지만 yum에서 다음 오류가 발생했습니다.

Loaded plugins: fastestmirror
base

| 3.6 kB  00:00:00     
extras
| 3.4 kB  00:00:00     
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/solutions/69319

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/



 One of the configured repositories failed (MongoDB Repository),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=mongodb-org-3.4 ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable mongodb-org-3.4
    or
        subscription-manager repos --disable=mongodb-org-3.4

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=mongodb-org-3.4.skip_if_unavailable=true

failure: repodata/repomd.xml from mongodb-org-3.4: [Errno 256] No more mirrors to try.
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden

이 오류는 SELinux 제한으로 인한 것입니까? yum이 mongodb를 설치하도록 어떻게 허용해야 합니까?

답변1

너무 늦었을 수도 있지만 동일한 문제에 직면한 후 다음 조합을 따랐습니다.AWS Linux에서 yum을 통해 MongoDB를 설치하지 못함: HTTPS 오류 404 - 찾을 수 없음응답 중 하나(스택 오버플로)CentOS에 MongoDB를 설치할 때 Yum 오류가 발생합니까?(선택되지 않음) 따라서 내 단계는 다음과 같습니다.

sudo rm -rf /etc/yum.repos.d/mongod*
sudo yum clean all

repo 파일을 다시 생성하세요.

sudo vi /etc/yum.repos.d/mongodb-org-3.4.repo

다음을 붙여넣습니다(내 시스템에서는 '$releasever'를 7로 바꿨습니다).

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

그런 다음 이것을 실행했고 작동했습니다.

sudo yum install -y mongodb-org

답변2

다음과 같은 향후 업데이트를 방지하기 exclude위해 디렉토리를 추가하려고 하는 것 같습니다 ./etc/yum.conf

exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools

하지만 install mongodb-org를 실행한 후에 위 줄을 추가해야 합니다.

sudo yum install -y mongodb-org

답변3

이전 버전의 mongoDB를 설치하는 방법을 찾았지만 v3.4는 설치하지 않았습니다.

이 정보를 "/etc/yum.repo.d/mongodb.repo"에 작성해 보세요.

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

그런 다음 yum은 다음 명령을 사용하여 mongodb-org-2.6.12 설치를 시작합니다.

sudo yum install mongodb-org

다시 말하지만, 내 애플리케이션이 작동하게 되지만 최신 버전의 mongoDB가 필요할 수도 있습니다.
v3.4 설치가 도움이 되었나요?

답변4

mongodb-repo는 CentOS 7에서 작동하지 않습니다. baseurl이 존재하지 않는 것 같습니다. 나는 사용했다

dnf install mongodb-server
dnf install mongodb

내 컴퓨터에 버전 3.4가 설치되었습니다. 를 통해 구성되었으므로 dnf자동으로 향후 업데이트를 받아야 합니다.

관련 정보