一:问题描述
我在浏览器里输入mongodb所在机器IP及端口号:http://192.168.59.140:27017/
页面出现:
It looks like you are trying to access MongoDB over HTTP on the native driver port.
如图:
二:出错原因
没有以–httpinterface参数启动mongodb,且应该以你的mongodb端口号+1000进行访问。
三:解决办法
以–httpinterface参数启动mongodb。
如:
[plain] view plain copy
1. ./bin/mongod -f /home/mongodb/etc/mongo.conf –httpinterface
在浏览器里输入:http://192.168.59.140:28017/
本文介绍了当尝试通过HTTP访问MongoDB时遇到的问题及其解决方法。主要原因是未使用–httpinterface参数启动MongoDB服务,正确的做法是使用该参数启动服务,并通过端口+1000的方式访问。
1646

被折叠的 条评论
为什么被折叠?



