在 AWS linux 上通过 yum 安装 MongoDB 失败:HTTPS 错误 404 - 未找到
Posted
技术标签:
【中文标题】在 AWS linux 上通过 yum 安装 MongoDB 失败:HTTPS 错误 404 - 未找到【英文标题】:Installing MongoDB via yum on AWS linux fails: HTTPS Error 404 - Not Found 【发布时间】:2017-11-14 23:31:16 【问题描述】:我试图按照MongoDB Doc 上的步骤在我的服务器上通过 yum 安装 mongodb@3.4。首先,我在 /etc/yum.repos.d/ 目录中创建了一个名为 mongodb-org-3.4.repo 的文件,并将其复制如下。
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
然后我尝试了sudo yum install mongodb-org
,但出现错误。
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
https://repo.mongodb.org/yum/redhat/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
One of the configured repositories failed (MongoDB),
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. Disable the repository, 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
4. 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/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
之后,我尝试yum repolist
,发现MongoDB的状态为0。
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
https://repo.mongodb.org/yum/redhat/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
https://repo.mongodb.org/yum/redhat/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
nodesource/x86_64 | 2.5 kB 00:00
repo id repo name status
amzn-main/latest amzn-main-Base 5,668
amzn-updates/latest amzn-updates-Base 435
mongodb-org-3.4/latest MongoDB 0
nodesource/x86_64 Node.js Packages for Enterprise 61
repolist: 6,164
我想知道那个 repo 是否仍然有效?谢谢~
这是我的服务器操作系统版本:
NAME="Amazon Linux AMI"
VERSION="2017.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2017.03"
PRETTY_NAME="Amazon Linux AMI 2017.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2017.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2017.03
【问题讨论】:
Stack Overflow 是一个编程和开发问题的网站。这个问题似乎离题了,因为它与编程或开发无关。请参阅帮助中心的What topics can I ask about here。也许Web Applications Stack Exchange、Webmaster Stack Exchange 或Unix & Linux Stack Exchange 会是一个更好的提问地点。 糟糕,抱歉。因为我习惯于在 Stack Overflow 中搜索与编码相关的任何解决方案。谢谢你的建议,下次我会尝试其他平台询问;) 我面临着类似的问题。我正在尝试从 v3.0.11 升级到 v3.2.20,我已经尝试了下面的解决方案,但它对我不起作用 【参考方案1】:请试试这个,
sudo rm -rf /etc/yum.repos.d/mongod*
sudo yum 全部清理
再次创建 repo 文件
sudo vi /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/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
【讨论】:
哇~工作就像一个魅力~谢谢很多XD 是的。文件名很重要。我将它从 mongodb-org 更改为 mongodb-org-3.4。现在可以了。【参考方案2】:更新至 2018 年 3 月
sudo nano /etc/yum.repos.d/mongodb-org-3.6.repo
添加(或替换)mongo repo 配置:
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
现在,你可以做一个
yum repolist
和
sudo yum install -y mongodb-org
【讨论】:
【参考方案3】:我认为您尝试从/etc/yum.conf
添加exclude
目录以防止将来更新
例如:
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
但上面的行需要在执行 install mongodb-org 后添加:
sudo yum install -y mongodb-org
所以,从/etc/yum.conf
中删除exclude
行,以使mongodb-org
包可用
【讨论】:
以上是关于在 AWS linux 上通过 yum 安装 MongoDB 失败:HTTPS 错误 404 - 未找到的主要内容,如果未能解决你的问题,请参考以下文章
使用s3fs-fuse在AWS Linux实例上挂载S3存储桶