User:Lindenb/Notebook/UMR915/20100913

From OpenWetWare

Jump to: navigation, search

20100910        Top        20100914       


Meeting Bru

cf. notebook

Pedigree Drawer

fixed java webstart. problem comes from badly defined jnlp file. Also check that all the URL have the same host (e.g. not hostbyname vs IP )

Mongo

start mongo

 bin/mongod --dbpath ~/tmp/MONGODB/data

connect to mongo

 ./mongo
 MongoDB shell version: 1.6.2
 connecting to: test
 > use admin
 switched to db admin

add a user and exit

 > db.addUser("admin","adminadmin")
       {
       "user" : "admin",
       "readOnly" : false,
       "pwd" : "65a731b9ea8d905d9f1c9813bd6eb6c0"
        }
 exit

Restart mongo with security:

 bin/mongod --dbpath ~/tmp/MONGODB/data --auth

check you must be authenticated

  use admin
  > show dbs
  Mon Sep 13 21:13:24 uncaught exception: assert failed : listDatabases failed:{
       "assertion" : "unauthorized db:admin lock type:-1 client:127.0.0.1",
       "assertionCode" : 10057,
       "errmsg" : "db assertion failure",
       "ok" : 0
  }

now login with password:

  > db.auth("admin","wrongpassword")
  0
  > db.auth("admin","adminadmin")
  1

list users

 > db.system.users.find()
 { "_id" : ObjectId("4c8e75539d56757df3e1ac8f"), "user" : "admin", "readOnly" : false,
  "pwd" :   "65a731b9ea8d905d9f1c9813bd6eb6c0" }
Personal tools