MongoDB 錯誤匯總


錯誤1. ERROR: child process failed, exited with error number 100

可能原因:

1.沒有正確關閉服務

2.服務已經啟動

3.conf文件的參數配置錯誤。

錯誤2. "errmsg" : "not authorized on admin to execute command { shutdown: 1.0, $clusterTime: { clusterTime: Timestamp(1519725156, 1), signature: { hash: BinData(0, 476DC7E7EFED899078F2044EA1E58163CC9D5BC9), keyId: 6527148863013257217 } }, $db: \"admin\" }"

沒有權限執行相關命令,可以通過驗證相關權限,或者使用賬號密碼登入。

use admin;

db.auth("test","test") 注意這里是逗號

然后再執行相關命令。

錯誤3. "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: localhost.localdomain:27017; the following nodes did not respond affirmatively: localhost:27018 failed with not authorized on admin to execute command { replSetHeartbeat: \"rsmxqtest\", pv: 1, v: 2, from: \"localhost.localdomain:27017\", fromId: 0, checkEmpty: false }",

1.創建一個keyfile

openssl rand -base64 756 > /mongodb27010/autokey

chmod 400 /mongodb27010/autokey

2.將keyfile拷貝到其他從節點

3.在每個節點的conf文件中添加keyfile

keyFile = /mongodb27010/autokey

錯誤4. "errmsg" : "not master and slaveOk=false"

設置從節點允許讀操作

rs.slaveOk();

錯誤5:child process failed, exited with error number 48

原因:非正常關閉mongo進程導致的,比如進行kill操作、斷電關機等。

處理辦法:

1.運行--repair修復命令

mongod -f /rs-b-1/mongod.conf --repair

2.查看mogod進程是否正常

ps -ef|grep mongo

3.以正常方式啟動

 

 

 

備注:

    作者:pursuer.chen

    博客:http://www.cnblogs.com/chenmh

本站點所有隨筆都是原創,歡迎大家轉載;但轉載時必須注明文章來源,且在文章開頭明顯處給明鏈接,否則保留追究責任的權利。

《歡迎交流討論》

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM