u123
u123

Reputation: 16329

Error parsing command line: unrecognised option '--httpinterface' (MongoDB)

Based in this guide:

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

I am installing MongoDB. This works fine but when I try to run it with: --httpinterface like:

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

I get:

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

Enabling httpinterface is described here: https://ademirgabardo.wordpress.com/2016/02/07/how-to-access-http-interface-mongodb/

and I also tried to add it to /etc/mongod.conf:

httpinterface=true
rest=true

And then restart mongod with the above options but same result. I also tried to add it in /etc/mongod.conf like:

# 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  

Any suggestions on how to enable http interface?

Upvotes: 2

Views: 8802

Answers (1)

Alex Blex
Alex Blex

Reputation: 37048

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

MongoDB 3.6 removes the deprecated HTTP interface and REST API to MongoDB

Either downgrade to 3.4 (it's still supported till January 2020) or user 3rd party tools, e.g. listed in https://docs.mongodb.com/ecosystem/tools/http-interfaces/

Upvotes: 5

Related Questions