MongoDB 3.4版本小技巧之如何开启http service

Mongodb3.0开始在配置文件里废弃了参数httpinterface=true,如果用该参数启动会报如下错误:


Unrecognized option: httpinterface=true
try './mongod --help' for more information


新的版本可以用如下方式启动http服务
# ./mongod -f /data/mongodb/mongod.conf --httpinterface 
about to fork child process, waiting until server is ready for connections.
forked process: 13741
child process started successfully, parent exiting



mongodb的http service端口为28017
# ss -lnt |grep 28017
LISTEN     0      128                       *:28017                    *:*   


查看web页面


请使用浏览器的分享功能分享到微信等