This is a sample config I use for CBA on two debian boxes
- edge.iboard.cc is the "master" where the app is running
- s1.iboard.cc is the "slave" where mongo is running as a kind of backup
MONGO_USER="mongod"
MONGO_OPTS="--dbpath /data/mongodb/ --rest --journal --replSet iboard"
MONGO_USER="mongod"
MONGO_OPTS="--dbpath /data/mongodb/ --rest --journal --replSet iboard"
I'm using the default /etc/init.d/mongod script to do so.
devel:/etc/mongodb# /usr/local/mongodb/bin/mongo
MongoDB shell version: 1.8.2
connecting to: test
> rs.initiate({_id: "iboard", members: [ { _id:0, host: "edge.iboard.cc" }, { _id:1, host: "s1.iboard.cc" } ]})
{
"info" : "Config now saved locally. Should come online in about a minute.",
"ok" : 1
}