-
Notifications
You must be signed in to change notification settings - Fork 4
LapDevelopment_MongoDB
The database is stored on a dedicated partition (on the SSD RAID); to prepare and mount the filesystem:
mkfs.ext4 /dev/datavg/mongo
mount /var/lib/mongodb
Install the server, client, and libraries:
yum -y install mongodb mongodb-server libmongodb libmongodb-devel
In /etc/mongodb.conf, enable incoming connections from the ABEL-internal network and require authentication:
bind_ip = 127.0.0.1,10.110.0.132
auth = true
Allow for larger namespace files (to avoid a limit of some 24,000 collections):
nssize = 512
And declare NUMA policy (interleaving memory over all cpus) for the database daemon:
daemon [...] "numactl --interleave=all $exec [...]"
Finally, create a database user laportal with administrator rights:
mongo --authenticationDatabase admin
use admin
db.addUser( { user: "laportal", pwd: "????????", roles: [ "userAdminAnyDatabase" ] } )
sudo /etc/init.d/mongod start|stop|restart
For the time being, at least, we assume that all annotations (by all LAP users) share one database and one database user; to initially create the database and user:
mongo --verbose -u laportal -p '????????' admin
use lapstore
db.addUser({ user: "lapstore", pwd: "????????", roles: [ "readWrite" ] })
To connect to the LAP Store using the MongoDB Shell:
mongo --verbose -u lapstore -p '????????' lapstore
To inspect the contents of a specific collection (use show collections or db.getCollectionNames() for the selection):
db[db.getCollectionNames()[0]].find().pretty()
To drop all collections, i.e. free up storage space; this will render all Galaxy files in all user histories (i.e. receipts, referring to collections) useless, thus must only be used on development instances:
db.getCollectionNames().forEach(function(foo) { if (foo.indexOf("system.") == -1) db[foo].drop(); })
Home | Forum | Discussions | Events