MONGODB带验证主从

openssl rand -base64 753 > authfile
chmod 600 /opt/mongodb/key/authfile
/opt/mongodb/bin/mongod --dbpath=/datas/mongodb/data/ --logpath=/datas/mongodb/logs/mongodb.log --unixSocketPrefix=/datas/mongodb/logs/ --nohttpinterface --auth --keyFile=/opt/mongodb/key/keyfile --master --logappend --directoryperdb --fork

/opt/mongodb/bin/mongod --dbpath=/data/mongodb/data/ --logpath=/data/mongodb/logs/mongodb.log --unixSocketPrefix=/data/mongodb/logs/ --nohttpinterface --auth --keyFile=/opt/mongodb/key/keyfile --slave --source=172.16.0.3 --slavedelay=1800 --logappend --directoryperdb --fork