MongoDB with replicas

Follow steps here
================

http://docs.mongodb.org/manual/tutorial/deploy-replica-set/

In addition to the above , I had few issues with getting up the replicas

1. Generating the key file
openssl rand -base64 741 > mongodb_key
and copy this file and change /etc/mongodb.conf keyFile property
keyFile = /home/xxx/yyy

make sure correct permission set to key file
chmod 700 /path/to/keyfile

2. Replica status says ( rs.status() ) ‘RECOVERING’ or ‘replSet error RS102 too stale to catch up’
delete all dbs in dbPath and restart mongo

3. Start mongo with keyFile authentication enabled

mongod –config /etc/mongodb.conf –keyFile /home/pathto/keys/mondodb_key

4. You will only be able to view data in primary if not specifically enabled

5. robomongo client can be used to view dbs , collections , users etc.

Advertisements

About buminda

buminda.com
This entry was posted in Uncategorized. Bookmark the permalink.