|
790Z"), "pingMs" : 6, "syncingTo" : "192.168.50.130:27017", "configVersion" : 3 } ], "ok" : 1 } #130插入数据验证 use wind; db.tblorders.insert( { orderno: "1002", pname: "jinri", scity:"pvg",price : 1750 } ); wind:PRIMARY> db.tblorders.find().forEach(printjson); { "_id" : ObjectId("55c069cf0bef81df34afc6d3"), "orderno" : "1001", "pname" : "jinri", "scity" : "pek", "price" : 1650 } { "_id" : ObjectId("55c06dcd1449f1bbe0a56e9b"), "orderno" : "1002", "pname" : "jinri", "scity" : "pvg", "price" : 1750 } #110和120验证 mongo 192.168.50.110:27017 wind:SECONDARY> rs.slaveOk(); wind:SECONDARY> use wind; switched to db wind wind:SECONDARY> db.tblorders.find().forEach(printjson); { "_id" : ObjectId("55c069cf0bef81df34afc6d3"), "orderno" : "1001", "pname" : "jinri", "scity" : "pek", "price" : 1650 } { "_id" : ObjectId("55c06dcd1449f1bbe0a56e9b"), "orderno" : "1002", "pname" : "jinri", "scity" : "pvg", "price" : 1750 } wind:SECONDARY> rs.slaveOk(); wind:SECONDARY> use wind; switched to db wind wind:SECONDARY> db.tblorders.find().forEach(printjson); { "_id" : ObjectId("55c069cf0bef81df34afc6d3"), "orderno" : "1001", "pname" : "jinri", "scity" : "pek", "price" : 1650 } { "_id" : ObjectId("55c06dcd1449f1bbe0a56e9b"), "orderno" : "1002", "pname" : "jinri", "scity" : "pvg", "price" : 1750 }
|