Tag Info

New answers tagged

0

Echoing the earlier comments here, I would agree that indexes in MongoDB are similar in general terms to MySQL. Proper indexing is probably the single easiest factor you can adjust to improve your query performance. Similar to most MySQL storage engines, MongoDB also uses B-tree based indexes. There are some other differences in terms of index types or ...


0

If you want to run multiple MongoDB services on the same host, you just need to create separate service definitions and configuration files for each service. As a starting point I would look at the standard mongod.upstart script in Github and adapt a version to start your config server. I would also note that for a production system you should always ...


0

If your client applications are connecting directly to MongoDB, they will typically use a connection string which varies depending on the type of deployment: Standalone - mongod hostname (and optionally, port) Replica set - includes one or more mongod hosts in the replica set as a "seed list" to discover the current configuration Sharded cluster - ...


0

You should be able to easily install on most (if not all) flavours of x86-based Linux distributions. There are officially packaged versions for: Ubuntu Debian RPM (Redhat, CentOS, Fedora, Amazon Linux) You can also install from tarball, or check if there are packages available in the "ports" equivalent for your distribution.


0

From your question, I take it that you wish to write only to the local primary, but read from either replica set. The solution would be a sharded cluster formed from your two replica sets with their current setup. You can then setup a new collection which includes shard tagging. You should set this up so that the data which was in DCA will stay in DCA, and ...


2

If you have locked yourself out then you need to do the following: Stop your MongoDB instance Remove the --auth and/or --keyfile options from your MongoDB config to disable authentication Start the instance without authentication Edit the users as needed Restart the instance with authentication enabled


0

The replica set was setup with the internal AWS addresses. So when python connected with MongoReplicaSetClient and the server sent back the addresses it couldn't find the other members of the replica set. You can update the replica set using rs.conf() to get the config and then rs.reconfig() to set your new configuration. Or, as I did, add the internal AWS ...


0

Inserts need to be done via the mongos for splits to happen automatically. In fact, all work should be done via the mongos, not directly to the primary on one of the sets. That is why you have not seen any splits happen and your chunks are all still in one place. In terms of details, I've written up some of the details about how splits happen in a ...


0

If it's not possible to do it automatically, can it be done manually? So only entries which are not present in the primary database A will be inserted out of one secondary of database B ? Little Example: In A we got: 1,2,3 In B we got: 5,6,7 What I want is to add 5,6,7 from database B into database A and vice versa, so it looks like this at the end: A: ...


0

You have to stop Mongo, remove the admin files, then start Mongo sudo service mongod stop mv /data/admin.* . sudo service mongod start


0

Check the answers to this question, they might help MongoDB "root" user Basically if you still have access to the server, you may be able to access the Admin database. There's more in this page http://docs.mongodb.org/v2.4/reference/user-privileges/ Note that 2.6 version changes how this works completely. For 2.6 you'll need to spend more time ...


1

I think your first idea is better. The second way, as you state, is how you would model the data in an RDBMS. If you're going to use MongoDB for fun, you might as well explore the fact that it has a different data model, and structure your collections accordingly. While I'm sure performance is not going to be an issue for the scale of this project, ...


0

The mongos processes control when automatic splitting happens (you can also pre-split, and split manually). The heuristic they use is a bit more complicated than I am about to describe, but you can use it as a rough guide: Each mongos keeps track of data written to a particular chunk At ~20% of the max chunk size (default is 64MB), it will try an ...


0

As the page you linked implies, any point in time snapshot technique that includes the data files and the journal will suffice, LVM is just one option. EBS snapshots in Amazon EC2 will also work, as will similar snapshot solutions on SAN, NAS etc. You are not limited to LVM, but that is generally a solution people can implement themselves. In terms of ...


0

The LVM method works they way it does because snapshots are really fast, and the outage is really small and easily within the replication-log window. Using file-copy methods extends how long the replica-member is not replicating, so how long you can take to back up is constrained by the maximum replication-log allowed on the master node. Secondly, ...


1

That query is simply a long running read, without any criteria (so it is running against all data). As it fetches back the data, it will be done in batches (based on your batch size) and then issue a getmore on the same cursor for the next set of results. The numYields count does not mean the query is being blocked, it means that it yielded its lock when ...


0

db.part1zips.aggregate( { $part1 : { _id : { state : "$state", city : "$city" }, pop : { $sum : "$pop" } } }, { $match : { pop: { $gte : 1000000 } } }, { $part1 : { _id: "$_id.state", no_st: { $sum : 1 } } }, { ...


2

A capped collection would allow you to maintain a relatively small list, though you would want to have a decent buffer, or be very confident in terms of the size of your documents. The other option would be a TTL collection, but that would be more prone to fragmentation since it will be doing a lot of deletes (this will mean having to deal with said ...


0

Some time ago my one of my data replicas which was secondary at a time crushed due to hard drive failure. After I fixed that problem and restarted secondary it went into “Recovering” state. But my arbiter is now “Secondary” A MongoDB arbiter cannot automatically become a secondary or a primary node, as it does not have a copy of the data set. If you ...


2

There is an obvious problem with your "delayed backup" model, in that your delayed secondaries will reflect the state of each replica set but not the full state of the sharded cluster at a given point in time. A simple example: there is a chunk migration from shard1 => shard2 in progress documents will exist on both shard1 and shard2 while they are being ...


0

I would not recommend doing automatic migrations from any relational databases (or other that differs in logic) to MongoDB. Of course it can be done, but the database performance might not be (and will most probably not be) good. Now, answering your questions directly: 1) what do you mean by MySQL parameters? 2) Check the official docs page about the ...


1

The quick answer is yes. Indexes in MongoDB mostly follow the same logic for usage and creation as you would do in MySQL. Nevertheless, as the two databases are different (MongoDB is document based, not relational, etc) there are some aspects you might want to consider (for instance, there are no joins - your data model/organization needs to reflect this ...


1

You could possibly do this using $and, albeit in quite a messy way: db.rules.find({ "$and": [ {"opts":{"$elemMatch":{"$all":["sid","1226"]}}}, {"opts":{"$elemMatch":{"$all":["gid","1"]}}}, {"opts":{"$elemMatch":{"$all":["rev","10"]}}}, ]}) That is untested, but may work. The real problem here is the nested arrays, and that each "option" set is ...


0

Secondary indexes (non-primary keys) in MongoDB and MySQL are very similar. Secondary indexes declare fields or columns to be sorted separate from the rest of the data, and use row identifiers to reference the rest of the row for a query.


2

You can set the Minimum Memory requirement for SQL Server also. It'll still release pages under pressure, but it might be a good start. I've never used MongoDB, so I don't know if you can manage memory usage. A quick search makes it seem you can't. Assuming you're running a 64-bit server, and have more than 4 GB of RAM, you could run a 32-bit MongoDB ...



Top 50 recent answers are included