網站首頁 編程語言 正文
安裝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-08-28 關于CLion配置visual?studio(msvc)和JOM多核編譯的問題_C 語言
- 2022-05-17 物聯網設備數據流轉之搭建后端服務框架:SpringBoot統一響應封裝,全局異常攔截
- 2022-07-28 Jquery回調對象與延遲對象用法詳解_jquery
- 2022-05-20 docker內的容器如何與宿主機共享IP的方法_docker
- 2023-06-17 詳解Flask數據庫的連接與使用_python
- 2022-07-28 Redis內存碎片處理實例詳解_Redis
- 2022-04-28 oracle重置序列從0開始遞增1_oracle
- 2022-02-13 error C4996:‘scanf‘:This function or variable may
- 最近更新
-
- 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同步修改后的遠程分支