Tag Info

New answers tagged

1

For querying secondary run the following command first. After running this, you can do all regular stuff on secondary. rs.slaveOk() To see the replication status, run the following command on primary. This will show you if the secondaries are up to date or lagging. db.printSlaveReplicationInfo() Hope this helps.


1

MongoDB does not currently support a multi-master setup such as you describe. If you were looking to provide localized regional writes via MongoDB, your best bet is to setup a sharded collection, using shard tag ranges. You would have 1 (or more) shard per region, with the primary residing within the region it manages and remote secondaries. Region would ...


1

Nothing bad happened even if you took the config server offline during a chunk migration. In order for a chunk to be marked as migrated, all three config servers need to be up (Contrary to popular belief they do not form a replica set.). (The following is a tiny bit simplified for the sake of shortness.) When a chunk is moved, a global (read cluster wide) ...


0

tl:dr The answer to your question is that you need to remodel your data for MongoDB to suit your use cases and write some ETL routine for migrating the data into a proper model which makes use of MongoDBs advantages. On automatic conversion tools Generally, using these tools is a bad idea. Since a tool has no idea what your use cases (and subsequently ...


1

3 different things. Hadoop is a framework. Something you use to develop an entire application. MongoDb is a db. A nosql one. It is where you store data. BigData is a concept. It is related to huge quantity of data. Where huge is not a fixed parameter. 4 mb was huge in 1960. Now huge means several terabyte.


1

There is a tool on CodePlex you can use for this, called MSSQL to MongoDB Tool. This tool will migrate all data from MSSQL to MongoDB. It will do this without exporting to a file first. If you want to export to file first, you are best off using the Export Data wizard which you can find in your SSMS, by right clicking your DB and choose 'Export Data' under ...


0

An important consideration with any benchmarking is that you make sure that you are testing the right thing (i.e. the bottlenecks really are where you think that they are). In this instance the code that is performing your inserts may be single-threaded and synchronous meaning that is is going to wait for each item to hit the data store before starting next. ...


0

MongoDB uses flexible schema and you do not have to predeclare your field types in the database. MongoDB (as at 3.0) does not provide any server-side schema validation, so it's perfectly allowable to have a field with different types within the same collection or to have fields vary by document within the same collection. Schema declaration & validation ...


0

There is actually nothing really wrong here, at least not based on what you have included in the question. Go back to this point: ubuntu-user@ubuntu-vm:~$ mongo MongoDB shell version: 3.0.1 connecting to: test Server has startup warnings: 2015-03-27T12:37:30.430+0100 I CONTROL [initandlisten] 2015-03-27T12:37:30.430+0100 I CONTROL [initandlisten] ** ...


0

Each connection eats up about 1MB of RAM on the server side. That includes the connections to the config servers and the replica set members. Please keep in mind that those communicate with each other. So, let's say you want to use 1/3 of the RAM of your shards for connections, that'd be 5GB or 5000MB. Then, each server connects to two members of it's ...


1

The maximum BSON document size is 16 megabytes but to store documents larger than the maximum size MongoDB uses GridFS as stated in other answer about size of the first file 64MB and size of new datafile that keep on getting double till the size of newly created file reaches to 2GB. Have a look at Mongo db data file


1

Data files are allocated in advance. The following is slightly simplified, for the sake of shortness. When a MongoDB database is created, an empty datafile with a size of 64 MB is created. As soon as data is written to this pristine data file, a background process creates a new datafile in order to have one ready of the first datafile is full. This will be ...


0

In the future, ask to have the question migrated here instead of double posting. From the MongoDB Documentation, To calculate how much RAM you need, you must calculate your working set size, or the portion of your data that clients use most often. This depends on your access patterns, what indexes you have, and the size of your documents. Because ...


0

According to what you found out yourself, I think I can provide a detailed explanation. How chunk migration works (simplified) Here is how chunk migration works (simplified for the sake of shortness): When chunk exceeds the configured chunkSize (64MB by default), the mongos which caused the size increase will split the chunk. That chunk is split on the ...


1

The source code may helps a lot. It's java but I guess it can help, too. The findOne(), DBObject findOne(DBObject o, DBObject fields, DBObject orderBy, ReadPreference readPref, long maxTime, TimeUnit maxTimeUnit) { QueryOpBuilder queryOpBuilder = new QueryOpBuilder().addQuery(o).addOrderBy(orderBy) ...


1

I can't test this at the moment, but that's the basic format. You should change your date data type to ISO so it works easily with the below code: var lastWeek = new Date(); lastWeek.setDate(lastWeek.getDate() -7); db.messages.find({ "rep_header.share_date_2.$date": { $gte: lastWeek} } } );



Top 50 recent answers are included