命令失敗:MongoError:CMD_NOT_ALLOWED:配置文件 (command failed: MongoError: CMD_NOT_ALLOWED: profile)


問題描述

命令失敗:MongoError:CMD_NOT_ALLOWED:配置文件 (command failed: MongoError: CMD_NOT_ALLOWED: profile)

我正在使用 Atlas free 集群 mongodb 並嘗試啟用分析器以進行監控,並且我在集群上有 Atlas Admin 訪問權限

profiller 設置圖片

在設置中,如上圖所示啟用探查器選項

當我運行命令db.setProfilingLevel(2)時,出現以下錯誤:

MongoDB Enterprise Cluster0‑shard‑0:PRIMARY> db.setProfilingLevel(2)
2020‑02‑01T11:52:51.976+1100 E  QUERY    [js] uncaught exception: Error: command failed: {
    "ok" : 0,
    "errmsg" : "CMD_NOT_ALLOWED: profile",
    "code" : 8000,
    "codeName" : "AtlasError"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:583:17
assert.commandWorked@src/mongo/shell/assert.js:673:16
DB.prototype.setProfilingLevel@src/mongo/shell/db.js:681:12
@(shell):1:1

參考解法

方法 1:

Mongodb Atlas free tier blocks profiling options.

You can find operations that are not permitted in Mongodb Atlas free tier below

https://docs.atlas.mongodb.com/reference/unsupported‑commands/

(by San Jaisymvg)

參考文件

  1. command failed: MongoError: CMD_NOT_ALLOWED: profile (CC BY‑SA 2.5/3.0/4.0)

#mongo-shell #mongoDB #mongodb-atlas #mongodb-query






相關問題

Windows 是否有任何 mongo shell 擴展? (Is there any mongo shell extensions for windows?)

獲取查詢中所有文檔的大小 (Get the size of all the documents in a query)

如何從 java 程序運行 mongo 查詢? (How to run a mongo query from java program?)

MongoDB 更新 ObjectId 字段 (MongoDB update ObjectId field)

MongoDB - 將簡單字段更改為對象 (MongoDB - change simple field into an object)

mongoDB aggregate() 在電子郵件對象集合中查找電子郵件時間 (mongoDB aggregate() finding email times in a collection of email objects)

指定在 mongodb .js 腳本中使用哪個數據庫 (Specify which database to use in mongodb .js script)

命令失敗:MongoError:CMD_NOT_ALLOWED:配置文件 (command failed: MongoError: CMD_NOT_ALLOWED: profile)

有沒有辦法在 MongoDB 的一個語句中添加遞增的 id? (Is there a way to add an incrementing id in one statement in MongoDB?)

運行 rs.initiate() 後 mongodb 副本集錯誤“...replSetHeartbeat 需要身份驗證...” (mongodb replica set error "...replSetHeartbeat requires authentication..." after running rs.initiate())

將 mongo shell 連接到受限的 MongoDB Atlas 數據庫? (Connect mongo shell to restricted MongoDB Atlas Database?)

[MongoDB]:更改所有數組字段中的值類型 ([MongoDB]: Changing the type of values in all array fields)







留言討論