"$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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【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
- npm install報錯, npm ERR! code MODULE_NOT_FOUNDNPM
- true || false && falseFalse
- npm ERR! code CERT_HAS_EXPIRED:解決證書過期問題NPM
- MySQL 5.6複製報錯Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;MySqlError
- JavaScript return falseJavaScriptFalse
- ! [rejected] master -> master (fetch first)AST
- npm ERR! Unexpected token in JSON at position 0 while parsing near ’ npm ERR! <!–////////NPMJSONWhile
- WPF ClipToBounds True or falseFalse
- 報錯:npm ERR! missing script: serve npm ERR! A complete log of this run can be found in:NPM
- Python解惑:True與FalsePythonFalse
- Integer128==128?falseFalse
- Ruby中的true和falseFalse
- preventDefault()與return false區別False
- Android之android exported="false"作用AndroidExportFalse
- Angular macOS Err:EACCES: permission deniedAngularMac
- git merge origin master git merge origin/master區別GitAST
- Scrum Master JobGPTScrumASTGPT
- git rebase masterGitAST
- 1248:Dungeon MasterAST
- 排除anaconda的report false問題False
- HttpContext.User.Identity.IsAuthenticated 為falseHTTPContextIDEFalse
- laravel Hash::check 始終返回false?LaravelFalse
- False SQL Injection and Advanced Blind SQL InjectionFalseSQL
- The character that plays in MyCareer will be constantly browsing a false TwitterFalse
- MySQL5.7 Master-Master主主搭建for Centos7MySqlASTCentOS
- master..spt_valuesAST
- DocumentDB 報錯“not master”AST
- C. Game MasterGAMAST
- WPF master detail viewASTAIView
- Master-Worker 模式AST模式
- 2 新增standby masterAST
- Scrum Master 生存指南ScrumAST
- Master-Worker模式AST模式
- JavaScript 比較相同的字元返回falseJavaScript字元False
- js判斷true和false一覽JSFalse
- Warning: Received `false` for a non-boolean attribute `xxx`.FalseBoolean