建立连接后,Mongobee无法在Atlas集群上读取DBname.system.indexes [英] Reading of DBname.system.indexes failed on Atlas cluster by mongobee after getting connected

查看:93
本文介绍了建立连接后,Mongobee无法在Atlas集群上读取DBname.system.indexes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jhipster Spring引导项目.最近,我从 mlabs 独立沙箱转移到了Atlas集群沙箱M0 Free层副本集.它甚至可以正常工作,我已经对其进行了一些数据库操作.但是由于某种原因,现在存在读取权限错误

I have a Jhipster Spring boot project. Recently I shifted from mlabs standalone sandboxes to Atlas cluster sandbox M0 Free tier replica set. It even worked and I had made some database operations on it. But now for some reason then there is a read permission error

Error creating bean with name 'mongobee' defined in class path resource [DatabaseConfiguration.class]: Invocation of init method failed; nested exception is com.mongodb.MongoQueryException: Query failed with error code 8000 and error message 'user is not allowed to do action [find] on [test.system.indexes]' on server ********-shard-00-01-mfwhq.mongodb.net:27017

您可以在此处查看完整的堆栈 https://pastebin.com/kaxcr7VS

You can see the full stack here https://pastebin.com/kaxcr7VS

我进行了上下搜索,我只能找到M0层用户没有覆盖我未执行的管理数据库的权限.

I have searched high and low and all I could find is that M0 tier user doesn't have permissions to overwrite admin database which I am not doing.

即使现在与Mlabs DB的连接也可以正常工作,但是在Atlas DB M0层上存在此问题.

Even now connection to Mlabs DB works fine but have this issue on Atlas DB M0 tier.

Mongo DB版本:3.4

Mongo DB version : 3.4

Jars及其版本 名称:"mongobee",版本:"0.10" 名称:"mongo-java-driver",版本:"3.4.2"

Jars and It's version name: 'mongobee', version: '0.10' name: 'mongo-java-driver', version: '3.4.2'

@尼尔·伦(Neil Lunn) 我正在使用的userId是管理员的userId,并且该连接的读写操作是通过Shell或Robo3T(mongo client)

@Neil Lunn The userId I am using to connect is that of admin's and the connection read and write works through shell or Robo3T(mongo client)

推荐答案

在与MongoDB支持团队讨论之后,MongoDB 3.0禁止直接访问system.indexes集合,该集合以前曾用于列出数据库中的所有索引.应用程序应改用db.<COLLECTION>.getIndexes().

After discussion with MongoDB support team, MongoDB 3.0 deprecates direct access to the system.indexes collection, which had previously been used to list all indexes in a database. Applications should use db.<COLLECTION>.getIndexes() instead.

MongoDB Atlas文档中可以看出,他们可能禁止调用system.集合:

From MongoDB Atlas docs it can be seen that they may forbid calls to system. collections:

(可选)对于read和readWrite角色,您还可以指定一个集合.如果未为read和readWrite指定一个集合,则该角色将应用于数据库中的所有集合(某些系统集合除外).

Optionally, for the read and readWrite role, you can also specify a collection. If you do not specify a collection for read and readWrite, the role applies to all collections (excluding some system. collections) in the database.

从堆栈跟踪中可以看到 MongoBee 试图进行此调用,因此现在是库问题并且应该对其进行更新.

From the stacktrace it's visible that MongoBee is trying to make this call, so it's now the library issue and it should be updated.

更新: 为了解决问题,直到 MongoBee 发布了新版本:

UPDATE: In order to fix an issue until MongoBee has released new version:

  1. 获取 MongoBee git clone git@github.com:mongobee/mongobee.gitcd mongobee
  2. 的最新资源
  3. 获取拉取请求git fetch origin pull/87/head:mongobee-atlas
  4. 结帐git checkout mongobee-atlas
  5. 安装MongoBee jar mvn clean install
  6. /target文件夹或本地/.m2
  7. 获取已编译的jar
  8. 将jar用作项目的依赖项
  1. Get the latest sources of MongoBee git clone git@github.com:mongobee/mongobee.git, cd mongobee
  2. Fetch pull request git fetch origin pull/87/head:mongobee-atlas
  3. Checkout git checkout mongobee-atlas
  4. Install MongoBee jar mvn clean install
  5. Get compiled jar from /target folder or local /.m2
  6. Use the jar as a dependency on your project

这篇关于建立连接后,Mongobee无法在Atlas集群上读取DBname.system.indexes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆