Tutorial by Examples

You'll need to separate out your application layer from your database layer, and that means specifying the MONGO_URL. Which means running your app through the bundle command, uncompressing it, setting environment variables, and then launching the project as a node app. Here's how... #make sure you...
Then go into the mongo shell and initiate the replica set, like so: mongo > rs.initiate() PRIMARY> rs.add("mongo-a") PRIMARY> rs.add("mongo-b") PRIMARY> rs.add("mongo-c") PRIMARY> rs.setReadPref('secondaryPreferred')
The replica set will need an oplog user to access the database. mongo PRIMARY> use admin PRIMARY> db.addUser({user:"oplogger",pwd:"YOUR_PASSWORD",roles:[],otherDBRoles:{local:["read"]}}); PRIMARY> show users
Your upstart script will need to be modified to use multiple IP addresses of the replica set. start on started mountall stop on shutdown respawn respawn limit 99 5 script # our example assumes you're using a replica set and/or oplog integreation export MONGO_URL='mongodb://mongo-a...
Oplog Tailing on Sharded Mongo

Page 1 of 1