"$err" : "not master and slaveok=false", "code" : 13435
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是單機,所以這個引數估計不合理,也許是這裡報錯, 註釋掉
#replSet = sso-rest
重新啟動mongodb:
/usr/local/mongodb/bin/mongod -f /etc/mongodb/37017.conf
再登陸重新執行db.addUser("admin","admin",false);
OK !
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26230597/viewspace-1101276/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- npm ERR! code EINTEGRITY npm! ERR! shal-NPM
- 【Vue】npm ERR! code ERESOLVEVueNPM
- code EACCESnpm ERR! syscall renamenpm ERR! path /usr/local/bin/webpack errno -13NPMWeb
- npm ERR! code ECONNRESET npm ERR! errno ECONNRESET網路問題解決NPM
- true || false && falseFalse
- ERR: node-gyp rebuild No Xcode or CLT version detectedRebuildXCode
- npm install報錯, npm ERR! code MODULE_NOT_FOUNDNPM
- MySQL Master/Slave Master/MasterMySqlAST
- err_quit()UI
- JavaScript return falseJavaScriptFalse
- npm ERR! code CERT_HAS_EXPIRED:解決證書過期問題NPM
- null >=0 ? true:falseNullFalse
- WPF ClipToBounds True or falseFalse
- 自定義KSImageNamed-Xcode-master的圖片提示功能XCodeAST
- ! [rejected] master -> master (fetch first)AST
- Mysql5.6 Master+MasterMySqlAST
- 內部Fragment設定為public static和checkReleaseBuilds false與abortOnError falseFragmentUIFalseError
- JavaScript return false的作用JavaScriptFalse
- npm ERR! Unexpected token in JSON at position 0 while parsing near ’ npm ERR! <!–////////NPMJSONWhile
- Mongodb的master-slave模式與master-master模式實驗MongoDBAST模式
- MySQL 5.6複製報錯Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;MySqlError
- 報錯:npm ERR! missing script: serve npm ERR! A complete log of this run can be found in:NPM
- change master 未指定master_log_fileAST
- Angular macOS Err:EACCES: permission deniedAngularMac
- oracle 817 archive err,oracle hangOracleHive
- Python解惑:True與FalsePythonFalse
- Ruby中的true和falseFalse
- preventDefault()與return false區別False
- return false影響事件冒泡False事件
- 使用DBLINK查詢時報ORA-00600: internal error code, arguments: [kzdlk_zt2 err]Error
- C++程式設計師看過來,false < false的設定恰當嗎?C++程式設計師False
- Git branching: master vs. origin/master vs. remotes/origin/masterGitASTREM
- show master logs 和 show master status 區別AST
- 【HBase】start master 與 start master --backup 的區別AST
- Integer128==128?falseFalse
- laravel Hash::check 始終返回false?LaravelFalse
- jQuey return false作用是什麼False
- Spring Autowired(required = false) 說明SpringUIFalse