本地连接mongo报错,错误代码为:

Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. 
Client view of cluster state is {type=UNKNOWN, servers= ...............................

系统:

  centos7, 64位

  mongo,mongodb-linux-x86_64-rhel70-4.0.10

解压,进入bin,启动

 ./mongod --dbpath=/data/db/ --config=./mongodb.conf &

报错了

为什么呢?

用linux本地连接mongo测试 --》 是ok的,证明服务没有问题

那是什么呢?--》防火墙

[root@localhost data]# systemctl stop firewalld.service #停止firewall
[root@localhost data]# systemctl disable firewalld.service #禁止firewall开机启动
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost data]#

搞定ok!!!!

mongo连接不上Timed out after 30000的更多相关文章

  1. MAC上mongodb连接不上

    1.在Mac客户端里输入 mongo,发现mongo连接不上了,原因是mongo的服务没有开启. 2.在命令行了输入 mongod,开启服务的命令 3.启动起来以后,用mongo连接服务器.

  2. Timed out after 30000 ms while waiting to connect

    今天使用mongo-java-drive写连接mongo的客户端,着实被上面那个错坑了一把.回顾一下解决过程: 报错: com.mongodb.MongoTimeoutException: Timed ...

  3. (node:7584) UnhandledPromiseRejectionWarning: MongooseTimeoutError: Server selection timed out after 30000 ms

    记录一次学习node.js犯的低级错误 这里遇到一个这样的问题 express连接mongoose时报错(node:7584) UnhandledPromiseRejectionWarning: Mo ...

  4. NodeJS 远程连接windows 上的MongoDB

    ---恢复内容开始--- 在购买了腾讯云主机,部署了nodejs项目之后,发现没有mongo数据库,于是在官网上下载了最新版的mongo数据库.然后就有了下边的一系列问题. 1.先说说基础配置吧. 1 ...

  5. DPA/Ignite由于DNS问题导致连接不上被监控的数据库服务器

    问题描述: 在DPA(Ignite)的管理监控界面发现有两台SQL Server数据库服务器连接不上,截图如下所示,检查其日志内容 具体错误日志如下所示, Notice:日志里面具体的服务器名称被我用 ...

  6. ubuntu wifi连接不上或经常断网,重启就好

    问题1.知道wifi密码,驱动也有,可以点击连接,总是提示"连接断开,您现在处于离线状态". 1.打开终端"ctrl+alt+T" 2.输入: sudo vim ...

  7. vs 2015 连接不上tfs 错误代码:TF31002

    在vs2015里面怎么也连接不上,把地址放到浏览器里可以打开,所以点击右边的 在visual studio 中打开,然后将源码映射到本地

  8. Ubuntu16.04 802.1x 有线连接 输入账号密码,为什么连接不上?

    ubuntu16.04,在网络配置下找到802.1x安全性,输入账号密码,为什么连接不上?   这是系统的一个bug解决办法:假设你有一定的ubuntu基础,首先你先建立好一个不能用的协议,就是按照之 ...

  9. opencart在空间中安装出错,连接不上mysql

    客户要求,要在国外某空间安装opencart.话说opencart根本没怎么搞过,也不太清楚,php也是半吊子,临时看了几天,硬着头皮上把. 出错,安装进行到数据库连接设置的时候,死活连接不上,开始以 ...

随机推荐

  1. Codeforces Round #549 (Div. 2) E 倍增处理按排列顺序的上一个位置

    https://codeforces.com/contest/1143/problem/E 题意 p为n的一个排列,给出有m个数字的数组a,q次询问,每次询问a数组区间[l,r]中是否存在子序列为p的 ...

  2. [LeetCode] 343. Integer Break 整数拆分

    Given a positive integer n, break it into the sum of at least two positive integers and maximize the ...

  3. [LeetCode] 213. House Robber II 打家劫舍之二

    You are a professional robber planning to rob houses along a street. Each house has a certain amount ...

  4. [LeetCode] 204. Count Primes 质数的个数

    Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 E ...

  5. [LeetCode] 72. Edit Distance 编辑距离

    Given two words word1 and word2, find the minimum number of operations required to convert word1 to  ...

  6. ElasticSearch使用RestHighLevelClient进行搜索查询

    Elasticsearch Java API有四类client连接方式:TransportClient.  RestClient .Jest. Spring_Data_Elasticsearch.其中 ...

  7. [原创]浅谈在创业公司对MVP的理解

    [原创]浅谈在创业公司对MVP的理解 目前自已所处的公司类似一个创业平台,我们内部会不断的去孵化不同方向的产品,产品经理经常谈到的一个词就是MVP,所以有必需要去了解下什么是MVP? 1 什么是MVP ...

  8. c# mongodb时间类型字段保存时相差八个小时解决办法

    /// <summary> /// 添加时间 /// </summary> [BsonDateTimeOptions(Kind = DateTimeKind.Local)] p ...

  9. windowserver -------- 修改服务器防火墙

    再服务器中安装好软件的时候,我们通过别的电脑来访问服务器中的软件的时候,会出现访问不了的情况,这是可能是因为服务器中的防火墙中的进站端口,没有开放,一般软件进行部署的时候会开放801到 810 之间的 ...

  10. 使用linux/macos 自带的shell实现证书方式的快速登陆

    一般登陆机器都是需要使用证书安全登陆到跳板机上然后在跳板机去登陆到各个机器. 我们建立一个统一的文件夹mykey,将登陆的pem证书放上去,然后创建一个空白的文件,vim jump.sh #!/usr ...