- 论坛徽章:
- 1
|
- Thu Apr 2 23:21:24.925 [initandlisten] MongoDB starting : pid=1230 port=27017 dbpath=/data/mongodb slave=1 64
- -bit host=benny
- Thu Apr 2 23:21:24.926 [initandlisten] db version v2.4.13
- Thu Apr 2 23:21:24.926 [initandlisten] git version: de9d77996aab9315400b9f203d0c4826211fc32e
- Thu Apr 2 23:21:24.926 [initandlisten] build info: Linux ip-10-181-40-136 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP F
- ri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
- Thu Apr 2 23:21:24.926 [initandlisten] allocator: tcmalloc
- Thu Apr 2 23:21:24.926 [initandlisten] options: { auth: "true", bind_ip: "0.0.0.0", config: "/usr/local/mongo
- db/conf/mongod.conf", dbpath: "/data/mongodb", fork: "true", journal: "true", logappend: "true", logpath: "/us
- r/local/mongodb/log/mongod.log", maxConns: 10000, nohttpinterface: "true", pidfilepath: "/var/run/mongod.pid",
- port: 27017, slave: "true", source: "192.168.56.120:27017" }
- Thu Apr 2 23:21:24.937 [initandlisten] journal dir=/data/mongodb/journal
- Thu Apr 2 23:21:24.938 [initandlisten] recover : no journal files present, no recovery needed
- Thu Apr 2 23:21:24.998 [initandlisten] waiting for connections on port 27017
- Thu Apr 2 23:21:26.002 [replslave] repl: syncing from host:192.168.56.120:27017
- Thu Apr 2 23:21:26.015 [replslave] replHandshake res not: 0 res: { ok: 0.0, errmsg: "unauthorized" }
- Thu Apr 2 23:21:27.985 [initandlisten] connection accepted from 127.0.0.1:23528 #1 (1 connection now open)
- Thu Apr 2 23:21:27.994 [conn1] command denied: { getLog: "startupWarnings" }
- Thu Apr 2 23:21:27.997 [conn1] command denied: { replSetGetStatus: 1.0, forShell: 1.0 }
- Thu Apr 2 23:21:40.270 [conn1] authenticate db: admin { authenticate: 1, nonce: "bd76adb270c8782c", user: "r
- oot", key: "9ea4d2913df6a98942887a78e46ba4a6" }
- Thu Apr 2 23:23:12.625 [conn1] command admin.$cmd command: { listDatabases: 1.0 } ntoreturn:1 keyUpdates:0 lo
- cks(micros) R:11 W:114731 r:129 reslen:235 116ms
- Thu Apr 2 23:23:43.773 [replslave] repl: checkpoint applied 30 operations
- Thu Apr 2 23:23:43.773 [replslave] repl: syncedTo: Apr 2 23:23:33 551d5ef5:1
- Thu Apr 2 23:23:47.475 [replslave] CMD: drop thunderGears.test
- Thu Apr 2 23:24:11.362 [replslave] build index thunderGears.test { _id: 1 }
- Thu Apr 2 23:24:11.364 [replslave] build index done. scanned 0 total records. 0.001 secs
复制代码 mongodb version: 2.4
Thu Apr 2 23:21:26.015 [replslave] replHandshake res not: 0 res: { ok: 0.0, errmsg: "unauthorized" } 这行是提示权限不足, 可是为何后面的主从复制又可以成功呢?
我这的情况是local库都已添加repl账户, 并确认local库用户密码都一样, 为何我在不同的情况下简单的主从复制, 有的可以成功有的不可以成功呢?
额, 还有个疑问, mongodb如何通过mongo shell指定只同步特定collection呢? use admin; db.runCommand({"resync": 1}) 这是同步所有库哦
最后上我用的配置问件, 大神们发现问题请告诉我哦!- port=27017
- dbpath=/data/mongodb
- logpath=/usr/local/mongodb/log/mongod.log
- logappend=true
- pidfilepath=/var/run/mongod.pid
- fork=true
- maxConns=10000
- auth=true
- journal=true
- bind_ip=0.0.0.0
- oplogSize=128
- nohttpinterface=true
- master=true
- slave=true
- source=192.168.56.120:27017
- #autoresync=true
复制代码 |
|