Replica Set Internals Bootcamp Part III: Reconfiguring

I’ve been doing replica set “bootcamps” for new hires. It’s mainly focused on applying this to debug replica set issues and being able to talk fluently about what’s happening, but it occurred to me that you (blog readers) might be interested in it, too. There are 8 subjects I cover in my bootcamp: Elections CreatingContinue reading “Replica Set Internals Bootcamp Part III: Reconfiguring”

Replica Set Internals Bootcamp: Part I – Elections

I’ve been doing replica set “bootcamps” for new hires. It’s mainly focused on applying this to debug replica set issues and being able to talk fluently about what’s happening, but it occurred to me that you (blog readers) might be interested in it, too. There are 8 subjects I cover in my bootcamp: Elections CreatingContinue reading “Replica Set Internals Bootcamp: Part I – Elections”

Trying Out Replica Set Priorities

As promised in an earlier post, replica set priorities for MongoDB are now committed and will be available in 1.9.0, which should be coming out soon. Priorities allow you to give weights to the servers, saying, “I want server X to be primary whenever possible.” Priorities can range from 0.0-100.0. To use priorities, download theContinue reading “Trying Out Replica Set Priorities”

Implementing Replica Set Priorities

Replica set priorities will, very shortly, be allowed to vary between 0.0 and 100.0. The member with the highest priority that can reach a majority of the set will be elected master. (The change is done and works, but is being held up by 1.8.0… look for it after that release.) Implementing priorities was kindContinue reading “Implementing Replica Set Priorities”

How to Use Replica Set Rollbacks

If you’re using replica sets, you can get into a situation where you have conflicting data. MongoDB will roll back conflicting data, but it never throws it out. Let’s take an example, say you have three servers: A (arbiter), B, and C. You initialize A, B, and C: $ mongo B:27017/foo > rs.initiate() > rs.add(“C:27017”)Continue reading “How to Use Replica Set Rollbacks”

Return of the Mongo Mailbag

On the mongodb-user mailing list last week, someone asked (basically): I have 4 servers and I want two shards. How do I set it up? A lot of people have been asking questions about configuring replica sets and sharding, so here’s how to do it in nitty-gritty detail. The Architecture Prerequisites: if you aren’t tooContinue reading “Return of the Mongo Mailbag”

Sharding and Replica Sets Illustrated

This post assumes you know what replica sets and sharding are. Step 1: Don’t use sharding Seriously. Almost no one needs it. If you were at the point where you needed to partition your MySQL database, you’ve probably got a long ways to go before you’ll need to partition MongoDB (we scoff at billions ofContinue reading “Sharding and Replica Sets Illustrated”

Part 3: Replica Sets in the Wild

This post assumes that you know what replica sets are and some of the basic syntax. In part 1, we set up a replica set from scratch, but real life is messier: you might want to migrate dev servers into production, add new slaves, prioritize servers, change things on the fly… that’s what this postContinue reading “Part 3: Replica Sets in the Wild”