#!/bin/bash
#sudo mkdir -p /data/{db1,db2,db3,db30,db31,db32,configdb}
##--Setup Replaction Server--
sudo /usr/local/mongodb/bin/mongod --fork --dbpath=/data/db1 --logpath=/var/log/db1.log --logappend --journal --replSet inner --port 27020 --shardsvr --nohttpinterface
sudo /usr/local/mongodb/bin/mongod --fork --dbpath=/data/db2 --logpath=/var/log/db2.log --logappend --journal --replSet inner --port 27021 --shardsvr --nohttpinterface
sudo /usr/local/mongodb/bin/mongod --fork --dbpath=/data/db3 --logpath=/var/log/db3.log --logappend --journal --replSet inner --port 27022 --shardsvr --nohttpinterface
##--SetUp Replaction Server--
sudo /usr/local/mongodb/bin/mongod --fork --dbpath=/data/db30 --logpath=/var/log/db30.log --logappend --journal --replSet jack --port 27030 --shardsvr --nohttpinterface
sudo /usr/local/mongodb/bin/mongod --fork --dbpath=/data/db31 --logpath=/var/log/db31.log --logappend --journal --replSet jack --port 27031 --shardsvr --nohttpinterface
sudo /usr/local/mongodb/bin/mongod --fork --dbpath=/data/db32 --logpath=/var/log/db32.log --logappend --journal --replSet jack --port 27032 --shardsvr --nohttpinterface
##--Sharding Configure config_server mongos--
sudo /usr/local/mongodb/bin/mongod --configsvr
sleep 20
sudo /usr/local/mongodb/bin/mongos --fork --logappend --logpath=/var/log/dbconf.log --configdb 127.0.0.1:27019
阅读(1793) | 评论(0) | 转发(1) |