MongoDB主从复制小实验(三)

2014-11-24 11:52:02 · 作者: · 浏览: 8
Fri Aug 2 14:22:07.696 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Fri Aug 2 14:22:07.696 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
Fri Aug 2 14:22:07.697 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Fri Aug 2 14:22:07.698 [initandlisten]
Fri Aug 2 14:22:07.698 [initandlisten] db version v2.4.5
Fri Aug 2 14:22:07.699 [initandlisten] git version: a2ddc68ba7c9cee17bfe69ed840383ec3506602b
Fri Aug 2 14:22:07.700 [initandlisten] build info: Linux bs-linux32.10gen.cc 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_49
Fri Aug 2 14:22:07.700 [initandlisten] allocator: system
Fri Aug 2 14:22:07.701 [initandlisten] options: { dbpath: "/var/lib/mongo/dbs/slave2", nojournal: true, port: 10002, rest: true, slave: true, source: "localhost:10000" }
Fri Aug 2 14:22:07.713 [FileAllocator] allocating new datafile /var/lib/mongo/dbs/slave2/local.ns, filling with zeroes...
Fri Aug 2 14:22:07.714 [FileAllocator] creating directory /var/lib/mongo/dbs/slave2/_tmp
Fri Aug 2 14:22:07.997 [FileAllocator] done allocating datafile /var/lib/mongo/dbs/slave2/local.ns, size: 16MB, took 0.278 secs
Fri Aug 2 14:22:07.999 [FileAllocator] allocating new datafile /var/lib/mongo/dbs/slave2/local.0, filling with zeroes...
Fri Aug 2 14:22:08.373 [FileAllocator] done allocating datafile /var/lib/mongo/dbs/slave2/local.0, size: 16MB, took 0.373 secs
Fri Aug 2 14:22:08.381 [initandlisten] command local.$cmd command: { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0 reslen:37 668ms
Fri Aug 2 14:22:08.383 [initandlisten] waiting for connections on port 10002
Fri Aug 2 14:22:08.386 [websvr] admin web console waiting for connections on port 11002
Fri Aug 2 14:22:09.391 [replslave] build index local.sources { _id: 1 }
Fri Aug 2 14:22:09.397 [replslave] build index done. scanned 0 total records. 0.005 secs
Fri Aug 2 14:22:09.398 [replslave] repl: syncing from host:localhost:10000
Fri Aug 2 14:22:09.405 [replslave] build index local.me { _id: 1 }
Fri Aug 2 14:22:09.409 [replslave] build index done. scanned 0 total records. 0.003 secs
(5)链接master,插入一条数据:
[plain]
[root@h3 ~]# mongo localhost:10000
MongoDB shell version: 2.4.5
connecting to: localhost:10000/test
Server has startup warnings:
Mon Aug 12 08:23:21.713 [initandlisten]
Mon Aug 12 08:23:21.713 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Mon Aug 12 08:23:21.713 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Mon Aug 12 08:23:21.714 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
Mon Aug 12 08:23:21.714 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Mon Aug 12 08:23:21.714 [initandlisten]
> use test;
switched to db test
> db.test.find();
> db.test.insert({'host': '1000'});
> db.test.find();
{ "_id" : ObjectId("52082b99d30e16a12c0f4277"), "host" : "1000" }
>
(6)连接slave1节点,查询结果:
[plain]
[root@h3 ~]# mongo localhost:10001
MongoDB shell version: 2.4.5
connecting to: localhost:10001/test
Server has startup warnings:
Mon Aug 1