Skip to content

Instantly share code, notes, and snippets.

@niedbalski
Created February 10, 2015 20:20
Show Gist options
  • Save niedbalski/1306c7810e7c3aee9476 to your computer and use it in GitHub Desktop.
Save niedbalski/1306c7810e7c3aee9476 to your computer and use it in GitHub Desktop.
Connect to Juju Mongodb
$ juju ssh 0
machine-0# sudo apt-get install mongodb-clients
machine-0# mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin
MongoDB shell version: 2.4.9
connecting to: localhost:37017/admin
juju:PRIMARY> db = db.getSiblingDB("juju")
juju
juju:PRIMARY> db.machines.update({'_id': "32"}, {$set:{'addresses.0.value':'172.24.0.58'}})
juju:PRIMARY> db.machines.update({'_id': "32"}, {$set:{'addresses.1.value':'192.168.128.58'}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment