From IcedTea

Jump to: navigation, search

Here are the steps to get a user set up in mongodb which is allowed to run mongostat for the latest Thermostat.

$ ./distribution/target/image/bin/thermostat storage --start --permitLocalhostException 
$ mongo
mongo> use admin
mongo> db.auth("thermostat-admin", "mongodevpassword")
mongo> db.grantRolesToUser("thermostat-admin",[{role:"clusterMonitor",db:"admin"}])
mongo> quit()
$ ./distribution/target/image/bin/thermostat storage --stop
$ ./distribution/target/image/bin/thermostat web-storage-service
$ mongostat -u thermostat-admin -p mongodevpassword --authenticationDatabase admin --host

Here are two useful scripts to do the above quickly:

Place them both in the thermostat bin folder and run:

$ ./


./thermostat storage --start --permitLocalhostException
mongo mongostat-setup.js
./thermostat storage --stop


conn = new Mongo("")
db = conn.getDB("thermostat")
db = db.getSiblingDB("admin")
db.auth("thermostat-admin", "mongodevpassword")
Personal tools