mongoDB连接尝试失败:socketException:连接到server_ip的错误:27017
我买了一个VPS,我想将MongoDB服务器放在那里。我使用SSH隧道连接到VPS,安装MongoDB并开始。问题是,如何将VPS服务器添加到MongoDB指南针? 我试图将其与指南针连接,但它不断向我展示连接eHostunreach my_vps_ip:27017
我试图通过我的本地终端与此命令连接:
mongo --host my_vps_ip
但是它给我带来了这个错误:
MongoDB shell version v4.2.19
connecting to: mongodb://my_vps_ip:27017/?compressors=disabled&gssapiServiceName=mongodb
2022-07-04T15:13:34.970-0500 E QUERY [js] Error: couldn't connect to server my_vps_ip:27017, connection attempt failed: SocketException: Error connecting to my_vps_ip:27017 :: caused by :: No route to host :
connect@src/mongo/shell/mongo.js:353:17
@(connect):2:6
2022-07-04T15:13:34.977-0500 F - [main] exception: connect failed
2022-07-04T15:13:34.977-0500 E - [main] exiting with code 1
这是我的配置文件代码:
net:
port:27017
bindIp my_vps_ip,127.0.0.1
可以连接到我的VPS MongoDB通过指南针?
抱歉,如果是la脚的问题,只是第一次使用VP,对我来说很复杂。
I bought a VPS and I want to put MongoDB server there. I connect to VPS with ssh tunnel, install MongoDB and start it. The question is, that how can I add VPS server to MongoDB Compass?
i tried to connect it with compass but it keep showing me connect EHOSTUNREACH my_vps_ip:27017
I was trying to connect via my local terminal with this command :
mongo --host my_vps_ip
but it throws me this error :
MongoDB shell version v4.2.19
connecting to: mongodb://my_vps_ip:27017/?compressors=disabled&gssapiServiceName=mongodb
2022-07-04T15:13:34.970-0500 E QUERY [js] Error: couldn't connect to server my_vps_ip:27017, connection attempt failed: SocketException: Error connecting to my_vps_ip:27017 :: caused by :: No route to host :
connect@src/mongo/shell/mongo.js:353:17
@(connect):2:6
2022-07-04T15:13:34.977-0500 F - [main] exception: connect failed
2022-07-04T15:13:34.977-0500 E - [main] exiting with code 1
here is my config file code :
net:
port:27017
bindIp my_vps_ip,127.0.0.1
it is possible to connect to my vps mongodb via compass ?
Sorry if it's lame questions, just first time using VPS and it's pretty complex to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论