MongoDB for Centos 7 出现请求超时

一、linux环境 和 mongodb版本


# more /etc/redhat-releaseCentOS Linux release 7.4.1708 (Core)
# vi /etc/yum.repos.d/mongodb-org-3.6.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                                                          

[root@localhost ~]# yum install -y mongodb-org
Loaded plugins: fastestmirror, langpacks
base                                                                                                                          | 3.6 kB  00:00:00     
epel/x86_64/metalink                                                                                                          | 5.1 kB  00:00:00     
epel                                                                                                                          | 4.7 kB  00:00:00     
extras                                                                                                                        | 3.4 kB  00:00:00     
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30000 milliseconds with 0 out of 0 bytes received')
Trying other mirror.
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30000 milliseconds with 0 out of 0 bytes received')
Trying other mirror.
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')
Trying other mirror.
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30000 milliseconds with 0 out of 0 bytes received')
Trying other mirror.
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')

Trying other mirror.


更换Yum源 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用中提到的信息,导致mongodb请求超时的原因可能是磁盘I/O堵塞。当mongodb的写操作非常频繁时,可能会导致磁盘无法及时处理所有的写入请求,从而造成读取操作的延迟。此外,如果java程序没有对mongodb的读写操作进行适当的分离,也可能导致请求超时的问题。因此,为了解决mongodb请求超时的问题,可以考虑以下几个方法: 1. 优化写入操作:减少频繁的写入操作,可以通过批量写入或者设置写入的间隔时间来减轻磁盘负载,以提高写入效率。 2. 优化磁盘I/O性能:可以考虑使用更快速的磁盘或者使用固态硬盘(SSD)来提升磁盘的读写速度,从而减少磁盘I/O堵塞。 3. 实施读写分离:将读操作和写操作分别分配给不同的mongodb实例,以减轻单个实例的负载压力,从而提高整体的读写性能。 4. 调整mongodb的配置参数:可以根据实际情况调整mongodb的配置参数,如增加缓存大小、提高线程池大小等,以优化其性能和响应能力。 综上所述,为了解决mongodb请求超时的问题,可以采取以上的方法来优化写入操作、提升磁盘I/O性能、实施读写分离和调整配置参数等。这样可以提高mongodb的性能和响应能力,从而减少请求超时的情况。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [一段mongodb服务器读取数据超时的故事](https://blog.csdn.net/weixin_30632089/article/details/96990621)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值