- 论坛徽章:
- 0
|
本帖最后由 niandun 于 2014-11-10 15:43 编辑
我的是mongo 2.6.5版本
先建立无认证主从正常
只要到/etc/mongod.conf中添加auth=true
开启主从mongo
从无法正常同步(去掉配置文件中的认证,重启mongo,数据又能同步)
日志如下
[replslave] repl:
[replslave] repl: sleep 3 sec before next pass
[replslave] repl: syncing from host:192.168.223.223:65017
并且进入local数据库中无法使用db.adduser()创建认证用户
报错如下
> db.addUser('root','12345670')
WARNING: The 'addUser' shell helper is DEPRECATED. Please use 'createUser' instead
2014-11-10T10:57:53.364+0800 Error: couldn't add user: Cannot create users in the local database at src/mongo/shell/db.js:1004 |
|