top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

MongoDB: No role named clusterAdmin

+1 vote
790 views

I am new to mongodb. im using mongodb 3.2. I need to monitor my mongodb operations for that the user need clusterAdmin privileges when i set db.grantRolesToUser("test123", [ { role: "clusterAdmin", db: "testdb" } ]) it showing error as "Error: No role named clusterAdmin@testdb".

What is my mistake?

posted Mar 9, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

MongoDB provides the built-in database user and database administration roles on every database. The other built-in roles such as cluster administration, backup and restoration and all-database roles are only available on the admin database. See built-in roles for more details.

As per your example, you could modify testdb into admin:

db.grantRolesToUser("test123", [ { role: "clusterAdmin", db: "admin" } ])
answer Nov 17, 2016 by Manikandan J
Similar Questions
+2 votes

We are seeing some issues with iowait. On a machine with 16 cores and 60 GB memory and SSD (max IO around 250 mb/s) (virtual machine on google) we see around constantly 20% iowait on top and iotop shows its the mongoDB process. Only around 10MB/s are actually read from the disk and as I said, we know from other tests that the machine can do much much more.

The query producing this pattern sorts a result from a query by an attribute (all indexed). After running queries like this a few times it works better. The total index size is around 4GB, so I assume it gets loaded in memory directly.

Is there any suggestions on how to debug this? I cant see how there can be such a high iowait when all computing resources are not even barely utilized.

Note: Running MongoDB 3.0.10 on Ubuntu 14.04

+1 vote

|ID | Fruit Name | Basket No|
|1 |Apple |1 |
|2 |Banana |2 |
|3 |Orange |1 |
|1 |Apple |2 |
|2 |Banana |3 |
|3 |Orange |2 |
|4 |Mango |2 |
|5 |Grapes |1 |
|1 |Apple |3 |​

question 1: Find the basket number which have more than 2 fruits.
question 2: Find the basket number which contain orange.
question 3: Find the fruits which are present in more than one basket.

+1 vote

Recently, I have been studying OpenCV to detect and recognize faces using C++. In order to execute source code demonstration from the OpenCV website I need to run Python to crop image first. Unfortunately, the message error is ImportError: No module named Image when I run the Python script ( this script is provided by OpenCV website). I installed python-2.7.amd64 and downloaded PIL-1.1.7.win32-py2.7 to install Image library. However, the message error is Python version 2.7 required, which was not found in the registry. And then, I downloaded the script written by Joakim Löw for Secret Labs AB / PythonWare to register registry in my computer. But the message error is "Unable to register. You probably have the another Python installation".

Please help

+1 vote

I generated some GridFs data on local MongoDB but I want to export these files only to production MongoDB.
I just have uploadtime field to query these files. Is there some option in Export to JSON by mongoexport both files and chunks after time stamp.

...