網站首頁 編程語言 正文
安裝mongoDB
- 配置yum
- yum安裝
- 碰到的問題
- sudoers
- curl
配置yum
創建/etc/yum.repos.d/mongodb-org-4.2.repo文件
cat > /etc/yum.repos.d/mongodb-org-4.2.repo << EOF
[mongodb-org-4.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
EOF
文件中的$releasever需要修改成自己系統的版本號
例如,我的版本是7,那么這行就是
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/
可以用瀏覽器打開https://repo.mongodb.org/yum/redhat/
查看可選的版本號
yum安裝
執行yum命令安裝
sudo yum install -y mongodb-org
碰到的問題
sudoers
[simple@redhat_1 ~]$ sudo yum install -y mongodb-org
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for simple:
simple is not in the sudoers file. This incident will be reported.
這是因為用戶simple沒有執行sudo的權限。/etc/sudoers
的權限默認為440。先用root用戶修改/etc/sudoers
的權限
chmod 644 /etc/sudoers
然后在該文件中添加一行
simple ALL=(ALL) ALL
然后恢復chmod 440 /etc/sudoers
文件的默認權限
chmod 440 /etc/sudoers
curl
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
https://repo.mongodb.org/yum/redhat/%24releasever/mongodb-org/4.2/x86_64/repodata/repomd.xml: [Errno 14] curl#35 - "Peer reports incompatible or unsupported protocol version."
Trying other mirror.
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-4.2 ...
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-4.2
or
subscription-manager repos --disable=mongodb-org-4.2
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-4.2.skip_if_unavailable=true
failure: repodata/repomd.xml from mongodb-org-4.2: [Errno 256] No more mirrors to try.
https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/repodata/repomd.xml: [Errno 14] curl#35 - "Peer reports incompatible or unsupported protocol version."
在執行sudo yum install -y mongodb-org
時,報錯[Errno 14] curl#35 - “Peer reports incompatible or unsupported protocol version.”
更新curl
sudo yum update -y nss curl libcurl
原文鏈接:https://blog.csdn.net/win_turn/article/details/106372335
相關推薦
- 2022-04-17 WPF框架Prism中導航Navigation用法介紹_基礎應用
- 2022-03-07 Go語言參數傳遞是傳值還是傳引用_Golang
- 2022-06-12 PostgreSQL聚合函數的分組排序使用示例_PostgreSQL
- 2022-06-29 Oracle中的常用函數詳解_oracle
- 2023-03-16 ProxyWidget和Element更新的正確方式詳解_Android
- 2023-01-17 Python使用鄰接矩陣實現圖及Dijkstra算法問題_python
- 2023-01-19 C++深度探索虛函數覆蓋示例_C 語言
- 2022-05-26 Python?if?else條件語句形式詳解_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支