命令行解析错误:无法识别的选项'--httpinterface'(MongoDB)

时间:2019-04-17 14:49:26

标签: mongodb

基于本指南:

https://docs.opsmanager.mongodb.com/current/tutorial/install-simple-test-deployment/

我正在安装MongoDB。效果很好,但是当我尝试使用以下命令运行它:--httpinterface时:

sudo -u mongod mongod --port 27017 --dbpath /data/appdb \
  --logpath /data/appdb/mongodb.log \
  --wiredTigerCacheSizeGB 1 --fork \
  --httpinterface

我得到:

Error parsing command line: unrecognised option '--httpinterface'
try 'mongod --help' for more information

启用httpinterface的说明如下: https://ademirgabardo.wordpress.com/2016/02/07/how-to-access-http-interface-mongodb/

,我还尝试将其添加到/etc/mongod.conf

httpinterface=true
rest=true

然后使用上述选项重新启动mongod,但结果相同。我还尝试将其添加到/etc/mongod.conf中,例如:

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
  http:
    enabled: true
    RESTInterfaceEnabled: true  

关于如何启用http界面的任何建议?

1 个答案:

答案 0 :(得分:1)

https://docs.mongodb.com/manual/release-notes/3.6-compatibility/#http-interface-and-rest-api

  

MongoDB 3.6删除了MongoDB弃用的HTTP接口和REST API

降级到3.4(直到2020年1月仍受支持)或使用用户的第三方工具,例如在https://docs.mongodb.com/ecosystem/tools/http-interfaces/

中列出