ubuntu mongodb 出现 exception: connect failed
巴扎黑
巴扎黑 2017-05-02 09:25:28
0
3
24871

被这个问题搞崩溃,百度google都试了 依然不行,重装了也不行!!
找了各种方法都不行,高手可用指点一下吗?

错误如下:

2017-03-21T19:16:41.552+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused 2017-03-21T19:16:41.552+0800 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:237:13 @(connect):1:6 exception: connect failed

真心希望懂的人来帮忙一下

楼下大哥补充一下~

我启动mongodb会出现这样

Failed to start mongod.service: Unit mongod.service not found.

监听端口是这样的

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 953/mysqld tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 973/apache2 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 888/sshd udp 0 0 139.196.187.137:123 0.0.0.0:* 961/ntpd udp 0 0 10.25.105.32:123 0.0.0.0:* 961/ntpd udp 0 0 127.0.0.1:123 0.0.0.0:* 961/ntpd udp 0 0 0.0.0.0:123 0.0.0.0:* 961/ntpd udp6 0 0 :::123 :::* 961/ntpd

确定是没有开启!,但是问题是启动不了~~~~

根据楼下大哥提示:

systemctl start mongod.service

会出现:

Failed to start mongod.service: Unit mongod.service not found.

但是我mongodb确实是安装好了~

巴扎黑
巴扎黑

모든 응답 (3)
世界只因有你

mongo开启了么,执行一下netstat -tunlp 命令,看看端口有没有在监听

    黄舟
    1. mongod数据库服务没启动。

    2. 可以提供一下详细的启动报错日志,这才好定位问题。

      小葫芦

      直接运行mongod启动

        최신 다운로드
        더>
        웹 효과
        웹사이트 소스 코드
        웹사이트 자료
        프론트엔드 템플릿
        회사 소개 부인 성명 Sitemap
        PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!