port=27017 dbpath=/home/data/mongodb/mongodb_data/ logpath=/home/data/mongodb/mongodb_log/mongodb.log pidfilepath=/usr/local/mongodb/mongo.pid fork=true logappend=true shardsvr=true directoryperdb=true #slave=true #source=192.168.9.214:27017 #autoresync=true master=true
port=27018 dbpath=/home/data/mongodb-slave/mongodb_data/ logpath=/home/data/mongodb-slave/mongodb_log/mongodb.log pidfilepath=/usr/local/mongodb/mongo-slave.pid fork=true logappend=true shardsvr=true directoryperdb=true slave=true source=192.168.5.107:27017 autoresync=true #master=true
./mongod --config /usr/local/mongodb/mongodb.conf ./mongod --config /usr/local/mongodb/config/mongodb-slave.conf
從mongo實際也能夠經過工具鏈接後進行寫操做,這個時候主從同步的時候會報錯致使從奔潰,能夠刪除從的數據從新同步。mongodb