我是 mongodb 的新手,正在嘗試在 mongod 中進行身份驗證。我嘗試了以下操作:
以普通模式啟動 mongod 添加用戶,驗證用戶在那里
啟動 mongod --auth 服務器日志說身份驗證已啟用。
打開指南針或 mongo ,我觀察到它在不要求任何密碼的情況下打開 dbs。 更新:如果我停止 MongoDB 服務,則啟動時的身份驗證作業不起作用
[WT_VERB_RECOVERY_PROGRESS] 恢復日志 11 到 11"}} {"t":{"$date":"2021-10-25T02:50:39.921 05:30"},"s":"I", "c" :"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1635110439:921070][6072:140734753232208], tt -恢復:[WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] 主恢復回圈:從 10/13696 開始到 11/256"}} {"t":{"$date":"2021-10-25T02:50:39.997 05:30"},"s": "I", "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1635110439:997804] [6072:交易恢復:[WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] 設定全域恢復時間戳:(0, 0)"}} {"t":{"$date":"2021-10-25T02:50:40.108 05:30"},"s":"I" , "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1635110440:107481][6072: 140734753232208],交易恢復:[WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] 設定全域最舊時間戳:(0, 0)"}} {"t":{"$date":"2021-10-25T02:50:40.109 05:30"},"s":"I" , "c":"STORAGE", "id":22430, "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":" CONTROL", "id":22140, "ctx":"initandlisten","msg":"此服務器系結到本地主機。遠程系統將無法連接到此服務器。使用 --bind_ip 啟動服務器以指定它應該從哪些 IP 地址提供回應,或使用 --bind_ip_all 系結到所有介面。如果需要此行為,請使用 --bind_ip 127.0.0.1 啟動服務器以禁用此警告","tags":["startupWarnings"]} {"t":{"$date":"2021-10-25T02: 50:40.269 05:30"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"更新線路規范", "attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,



//mongodb config
#net:
port: 27017 bindIp: 127.0.0.1
#processManagement:
#security:
#operationProfiling:
#replication:
#sharding:
uj5u.com熱心網友回復:
要啟用訪問控制:
一種。如果從命令列啟動 mongod,請添加--auth命令列選項:
mongod --auth --port 27017 --dbpath /var/lib/mongodb
灣 如果您使用組態檔啟動 mongod,請添加security.authorization組態檔設定:
security:
authorization: enabled
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/335964.html
標籤:mongodb
下一篇:僅MongoDB選擇型別物件
