--Started mongod in 3 nodes
mongod --dbpath /u01/data --logpath /u01/logs/log.rep01 --logappend --journal --fork --replSet repl0
--on firstnode
1) mongo
2) Replica configuration
config = {_id: "repl0",
members:[
{_id: 0, host: '172.20.43.14:27017'},
{_id: 1, host: '172.20.43.15:27017'},
{_id: 2, host: '172.20.43.16:27017'}],
"settings" : {
"chainingAllowed" : true,
"heartbeatTimeoutSecs" : 10,
"getLastErrorModes" : {
},
"getLastErrorDefaults" :
{
"w" : 1,
"wtimeout" : 0
}
}
}
3) Initiate the replica server
rs.initiate(config);
4) Check the status
rs.status()
5) use clm
6)import the table customer using retail_customer_request_json.txt
7) Duplicate the data for 92 GB
nohup mongo clm --eval 'var copy = db.customer.findOne();for (var i = 0; i< 3000000; i++)
{copy._id = new ObjectId();j = "PC00" + i;copy.profileDetails.basicDetails.customerCode=j;db.customer.insert(copy);}
' &
8) drop the table using
db.customer.drop() or drop the database clm