wget -c http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.2.tgz
tar -zxvf mongodb-linux-x86_64-2.0.2.tgz
mv mongodb-linux-x86_64-2.0.2 /usr/local/mongodb
mkdir -p /mongodb/logs/mongo.log
mkdir -p /mongodb/masterdb
mkdir -p /mongodb/slavedb_1
mkdir -p /mongodb/slavedb_2
/usr/local/mongodb/bin/mongod --dbpath /mongodb/masterdb/ --port 10000 --master --logpath=/data/logs/mongo.log --fork > /dev/null &
/usr/local/mongodb/bin/mongod --dbpath /mongodb/slavedb_1 --source localhost:10000 --slave --port 10001 --fork > /dev/null &
/usr/local/mongodb/bin/mongod --dbpath /mongodb/slavedb_2 --source localhost:10000 --slave --port 10002 --fork > /dev/null &
mongodb 配置还有主从复制
最新推荐文章于 2024-09-10 15:15:36 发布