Tag Info

Hot answers tagged

3

There are a number of system command equivalents available: ls() mkdir() hostname() pwd() sleep() (not a system command, but similar functionality) It should be noted that these are all executed on the client (local) machine, not the server. There is no general construct for executing arbitrary system commands that I know of in the shell. To be honest, ...


3

MongoDB doesn't have an automatic backup feature built-in -- you have to choose an appropriate backup strategy using command-line or third party tools. The backup procedure will vary depending on your deployment type (standalone, replica set, sharded cluster), disk/dbpath configuration, and backup requirements. Unless you are using a third party tool, ...


2

On a pretty large dataset I tested a query that times out after 10 seconds: db.collection.find({"foo": "bar"}).maxTimeMS(10000) (In my case the collection has > 100 GB of data and no index on the field foo). I searched for the query using: db.system.profile.find({"query.query" : { "foo" : "bar" }}).limit(5).sort({ts: -1}).pretty() and found that the ...


2

Reasons for unexpected data growth of data files. "Data fragmentation" and data file preallocation When a document is deleted, it's space is used right away if the new document fits into that space. Let's say you delete a document which takes 1kb of disk space and a new document requiring 0.9 Kb of disk space is synced to disk, then the first free space ...


2

The pattern you describe is known as "friend of a friend." Here are a couple of answers on SO which may guide you. In the relational database world the friends would be found by following foreign keys. Document DBs, however, eschew explicit foreign keys enforced in the DBMS and join-like functionality in favour of other benefits. It is down to your ...


2

On your indices Ok, first things first. Assuming some structure like this { _id: new ObjectId(), date: new ISODate(), message: "Hello, Multikey Indices!", tags: ["MongoDB","Indices","Multikey"] } indexing tags would result in a multikey index. For the document above, the index would have three entries: "MongoDB", "Indices" and "Multikey", all ...


1

found the solution by myself. use db.printCollectionStats() in the output you will find the mentioned algorithm in the "wiredTiger.creationString" section. "wiredTiger" : { "metadata" : { "formatVersion" : 1 }, "creationString" : ...


1

Create an admin to create users: > use admin > ( rs.initiate() ) > db.createUser({user:"siteUserAdmin",pwd:"password",roles:[{role:"userAdminAnyDatabase",db:"admin"}]}) Login as userAdmin: $ mongo -u siteUserAdmin -p password --authenticationDatabase admin Create an admin for the cluster: > use admin > ...


1

Wiki answer generated from question comments by SDillon No; at least in versions prior to 2.6. After 2.6 I am not 100% sure. I've had this happen in development, thankfully a while ago. I dropped the collection and recovered the data to it. Here is a MongoDB email group post regarding this topic and your exact challenge. Another mistake I made, once, was ...


1

Reproducing the situation : mc1 collection already created on shard0000 before sharding mc2 collection already created on shard0001 before sharding Create a test-shard: $ mongo --nodb mongo> config={d0:{smallfiles:"",noprealloc:"",nopreallocj : ""}, d1 : {smallfiles : "", noprealloc : "", nopreallocj : "" }}; mongo> cluster = new ...


1

You'll need to increase the chunk size (default:64MB), otherwise you'll be limited there. http://blog.mongodb.org/post/100676030403/sharding-pitfalls-part-iii-chunk-balancing-and General limit information from MongoDB : Database Size The MMAPv1 storage engine limits each database to no more than 16000 data files. This means that a single MMAPv1 ...


1

>use mmsdbagentlog switched to db mmsdbagentlog > show collections app.agentLogs > db.app.agentLogs.stats() { "ns" : "mmsdbagentlog.app.agentLogs", "count" : 1711298, "size" : 524287948, "avgObjSize" : 306, "storageSize" : 71323648, "capped" : true, "max" : -1, "maxSize" : 524288000, ... } Looking in OpsManager ...


1

I think Ops Manager (can be deployed as local MMS) fits your requirement: … Ops Manager assists with: Deployment. Any topology, at any scale Management. Deploy new clusters. Manage, monitor, and back up existing ones Upgrades. In minutes, with no downtime Scaling. Add capacity, without taking the application offline Point-in-time, ...


1

Community wiki answer generated from comments on the question by Markus W Mahlberg: You might want to use bulk operations during insert. In case not all your RAM is used, it is safe to assume that either the disks or the inserting program is the limiting factor. With bulk ops, you speed up things for both limiting factors. There is something seriously ...


1

The error/exception is because you point to a local database with --configdb. That should be a serverip:port: ##shards/replicas: mongod --shardsvr --replSet ReplName --dbpath /data/mongodb (--port 27018) --logpath /data/log/log.log ... ##configservers: mongod --configsvr --dbpath /data/cfg (--port 27019) --logpath /data/log/log.cfg ##mongos routers: mongos ...


1

MongoDB targets operations for termination if the associated cursor exceeds its allotted time limit(maxTimeMS). I believe the few millis more come from two things. 1) There should be an internal process that checks periodically so you will get the check interval overhead (for example every 1ms) 2) MongoDB terminates operations that exceed their allotted ...



Only top voted, non community-wiki answers of a minimum length are eligible