D:\Program_file\mongo\mongodb\bin>mongo -port 18001
MongoDB shell version: 2.4.8
connecting to: 127.0.0.1:18001/test
Server has startup warnings:
Thu Mar 13 11:36:06.084 [initandlisten]
Thu Mar 13 11:36:06.084 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Thu Mar 13 11:36:06.084 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Thu Mar 13 11:36:06.084 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
Thu Mar 13 11:36:06.084 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Thu Mar 13 11:36:06.084 [initandlisten]
Thu Mar 13 11:36:06.192 [initandlisten]
Thu Mar 13 11:36:06.192 [initandlisten] ** WARNING: mongod started without --replSet yet 1 documents are present in local.system.replset
Thu Mar 13 11:36:06.192 [initandlisten] ** Restart with --replSet unless you are doing maintenance and no other clients are connected.
Thu Mar 13 11:36:06.192 [initandlisten] ** The TTL collection monitor will not start because of this.
Thu Mar 13 11:36:06.192 [initandlisten] ** For more info see http://dochub.mongodb.org/core/ttlcollections
Thu Mar 13 11:36:06.192 [initandlisten]
> show dbs;
admin 0.0625GB
local 0.15625GB
maketion 0.0625GB
mydb 0.0625GB
> use test
switched to db test
> db.test.insert({_id:1,name:"name_test"});
> db.test.find()
{ "_id" : 1, "name" : "name_test" }
1.5.開啟從庫,查看建立立的資料庫及表有沒有同步:
D:\Program_file\mongo\mongodb\bin>mongo -port 18002
MongoDB shell version: 2.4.8
connecting to: 127.0.0.1:18002/test
Server has startup warnings:
Thu Mar 13 11:44:17.236 [initandlisten]
Thu Mar 13 11:44:17.236 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Thu Mar 13 11:44:17.236 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Thu Mar 13 11:44:17.236 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
Thu Mar 13 11:44:17.236 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Thu Mar 13 11:44:17.236 [initandlisten]
Thu Mar 13 11:44:17.263 [initandlisten]
Thu Mar 13 11:44:17.263 [initandlisten] ** WARNING: mongod started without --replSet yet 1 documents are present in local.system.replset
Thu Mar 13 11:44:17.263 [initandlisten] ** Restart with --replSet unless you are doing maintenance and no other clients are connected
Thu Mar 13 11:44:17.263 [initandlisten] ** The TTL collection monitor will not start because of this.
Thu Mar 13 11:44:17.263 [initandlisten] ** For more info see http://dochub.mongodb.org/core/ttlcollections
Thu Mar 13 11:44:17.263 [initandlisten]
> show dbs;
admin 0.0625GB
local 0.09375GB
maketion 0.0625GB
mydb 0.0625GB
test 0.0625GB
> use test;
switched to db test
> show collections;
system.indexes
test
> db.test.find();
{ "_id" : 1, "name" : "name_test" }
>