"$err" : "not master and slaveok=false", "code" : 13435
2013-04-24 15:47
507 查看
monbodb安装完之后, 启动准备添加用户报错.
> use admin
switched to db admin
> db.addUser("admin","admin",false);
Wed Apr 24 14:17:26 uncaught exception: error { "$err" : "not master and slaveok=false", "code" : 13435 }
>
去check下 install 以及start 过程
/usr/local/mongodb/bin/mongod -f /etc/mongodb/37017.conf
有启动参数在 /etc/mongodb/37017.conf 配置文件里面
[root@mongo ~]# more /etc/mongodb/37017.conf
dbpath = /db/db1
port = 37017
rest = true
fork = true
logpath = /etc/mongodb/mongodb.log
logappend = true
replSet = sso-rest
我这台mongodb是单机,所以这个参数估计不合理,也许是这里报错, 注释掉
[b]#replSet = sso-rest[/b]
重新启动mongodb:
/usr/local/mongodb/bin/mongod -f /etc/mongodb/37017.conf
再登陆重新执行db.addUser("admin","admin",false);
OK !
> use admin
switched to db admin
> db.addUser("admin","admin",false);
Wed Apr 24 14:17:26 uncaught exception: error { "$err" : "not master and slaveok=false", "code" : 13435 }
>
去check下 install 以及start 过程
/usr/local/mongodb/bin/mongod -f /etc/mongodb/37017.conf
有启动参数在 /etc/mongodb/37017.conf 配置文件里面
[root@mongo ~]# more /etc/mongodb/37017.conf
dbpath = /db/db1
port = 37017
rest = true
fork = true
logpath = /etc/mongodb/mongodb.log
logappend = true
replSet = sso-rest
我这台mongodb是单机,所以这个参数估计不合理,也许是这里报错, 注释掉
[b]#replSet = sso-rest[/b]
重新启动mongodb:
/usr/local/mongodb/bin/mongod -f /etc/mongodb/37017.conf
再登陆重新执行db.addUser("admin","admin",false);
OK !
相关文章推荐
- uncaught exception: error: { "$err" : "not master and slaveOk=false", "code" : 13435 }
- MongoDb的“not master and slaveok=false”错误及解决方法,读写分离
- not master and slaveOk=false
- MongoDB的“not master and slaveok=false”错误解决
- NOT MASTER AND SLAVEOK=FALSE
- mongoDB Error:not master and slaveOk=false
- 【MongoDB】MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的"not master and slaveok=false"错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoCursorException ***not master and slaveOk=false
- error: device not found" and "error:device offline
- KVC/KVO and Bindings "MVC with less code"
- Can not delete a master page "This item cannot be deleted because it is still referenced by other pa
- Could not resolve placeholder 'master.jdbc.url' in string value "${master.jdbc.url}"
- Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x01030200