Mongodb远程连接错误:尝试在主机上运行命令“ isMaster”

时间:2019-11-26 13:36:24

标签: mongodb centos7

我在centos7上运行mongodb并编辑/etc/mongod.conf中的mongod.conf文件,以便像这样绑定到vps ip:

# network interfaces
net:
  port: 27017
  bindIp: 71.82.224.144  # Listen to local interface only, comment to listen on all interfaces.

71.82.224.144是vps ip,重新启动后,尝试从本地系统(笔记本电脑)使用此命令进行连接:

mongo 71.82.224.144/admin

给我这个错误消息

2019-11-26T16:51:20.382+0330 E QUERY    [js] Error: network error while attempting to run command 'isMaster' on host '71.82.224.144:27017'  :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed

,因此尝试使用Robo 3T -1.3,但给我相同的错误(试图运行命令'isMaster'...)

  • 但是当使用ssl连接到服务器并使用以下命令连接到mongo时,一切正常:

    mongo 71.82.224.144/admin

我检查了Mongo日志并看到最后一行:

[initandlisten] connection accepted from 52.170.218.2:52693 #11 (1 connection now open)

(52.170.218.2是我的客户端ip),上面的行显示了客户端连接请求被接受,但是我不知道为什么客户端(Robo 3T,终端)给我这个错误?

0 个答案:

没有答案
相关问题