(Click to open topic with navigation)
By default, the connection between MWS and MongoDB is not authenticated. To enable authentication, follow the instructions below. For further reading, see the MongoDB tutorial "Control Access to MongoDB Instances with Authentication."
To enable an authenticated connection between MWS and MongoDB
Here is an example of how to create all the required users. The users in the moab database are required only for MWS API version 2.
[root]# service mongod start [root]# mongo > use admin; > db.addUser("admin_user", "secret1"); > use moab; > db.addUser("moab_user", "secret2"); > db.addUser("mws_user", "secret3", true); > use mws; > db.addUser("mws_user", "secret3"); > exit;
The passwords used here ("secret1," "secret2," and "secret3") are examples. Choose your own passwords for these users.
grails.mongo.username = "mws_user" grails.mongo.password = "secret3"
If authentication is enabled in MongoDB, but the MWS user was not properly created or configured, MWS will not start. In this case, see the log file(s) for additional information.
Related Topics