如何将Robomongo连接到MongoDB

问题描述 投票:39回答:10

我在运行系统中使用MongoDB和Robomongo,我使用Robomongo作为客户端,我在不同的系统上安装了MongoDB,我将其视为服务器,我想将系统的Robomongo(作为客户端)连接到其他系统上的MongoDB(服务器)。我应该遵循哪些步骤来实现相同的目标?任何线索都会有所帮助。提前致谢

mongodb robo3t
10个回答
58
投票

我能够使用连接字符串将Robomongo连接到在Mongo Labs上运行的Mongodb的远程实例,如下所示:

  1. 下载最新的Robomongo。我从here下载了0.9 RC6。
  2. 从连接字符串中,按如下方式填充服务器地址和端口号。

Connection settings

  1. 在身份验证选项卡下填写数据库名称,用户名和密码,如下所示。

Authentication settings

  1. 测试连接。

Test connection enter image description here

希望这有帮助!


-2
投票
  1. 注释掉/etc/mongod.conf文件的bind_ip
  2. 下载https://download.robomongo.org/0.9.0-rc9/windows/robomongo-0.9.0-rc9-windows-x86_64-0bb5668.exe
  3. 连接标签: 3.1名称(无论如何) 3.2地址(服务器IP):端口号(27017)
  4. SSH TAB(我使用了我的普通putty连接细节) 4.1 SSH地址:[服务器IP] 4.2 SSH用户名[用户名] 4.3用户密码[密码]

20
投票

编辑:注释掉bind_ip可能会使您的系统容易受到安全漏洞的影响,请参阅https://docs.mongodb.com/manual/administration/security-checklist/#limit-network-exposure添加更多的IP比向所有内容打开系统更好。

您需要编辑/etc/mongod.conf文件的bind_ip变量以包含您正在使用的计算机的IP,或者完全取消它。

我能够使用以下mongod.conf连接,我注释掉了bind_ip和未注释的端口。

# mongod.conf

# Where to store the data.

# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.

dbpath=/var/lib/mongodb


#where to log

logpath=/var/log/mongodb/mongod.log


logappend=true


port = 27017


# Listen to local interface only. Comment out to listen on all 
interfaces. 

#bind_ip = 127.0.0.1


# Disables write-ahead journaling

# nojournal = true


# Enables periodic logging of CPU utilization and I/O wait

#cpu = true


# Turn on/off security.  Off is currently the default

#noauth = true

#auth = true


# Verbose logging output.

#verbose = true


# Inspect all client data for validity on receipt (useful for

# developing drivers)

#objcheck = true


# Enable db quota management

#quota = true


# Set oplogging level where n is

#   0=off (default)

#   1=W

#   2=R

#   3=both

#   7=W+some reads

#diaglog = 0


# Ignore query hints

#nohints = true


# Enable the HTTP interface (Defaults to port 28017).

#httpinterface = true


# Turns off server-side scripting.  This will result in greatly limited

# functionality

#noscripting = true


# Turns off table scans.  Any query that would do a table scan fails.

#notablescan = true


# Disable data file preallocation.

#noprealloc = true


# Specify .ns file size for new databases.

# nssize = <size>


# Replication Options


# in replicated mongo databases, specify the replica set name here

#replSet=setname

# maximum size in megabytes for replication operation log

#oplogSize=1024

# path to a key file storing authentication info for connections

# between replica set members

#keyFile=/path/to/keyfile

在尝试连接之前不要忘记重启mongod服务:

service mongod restart

从robomongo我使用以下连接设置:

连接选项卡:

地址:[VPS IP]:27017

SSH标签:

SSH地址:[VPS IP]:22

SSH用户名:[启用sudo的用户名]

SSH验证方法:密码

用户密码:Supersecret


5
投票
  1. 首先,您必须在终端中运行mongod命令,确保命令正确执行。
  2. 然后在新的终端选项卡中运行mongo命令。
  3. 然后打开Robomongo GUI并使用默认设置创建新连接。

希望这将解决您的问题

干杯!!


4
投票

看起来Robomongo尚未与Mongo 3合作

https://github.com/paralect/robomongo/issues/771


3
投票

目前,Robomongo 0.8.x不适用于MongoDB 3.0 :: - Mongodb & Robomongo: Can't connect (authentication) - https://github.com/paralect/robomongo/issues/766

现在,不要使用Robomongo,对我来说,对我来说最好的解决方案是使用mongochef:http://3t.io/mongochef/


2
投票

到目前为止遇到任何特定的错误?!顺便说一句,这就是我们的工作:

  • 创建新连接,设置名称,IP地址和相应的端口

  • 如果需要,请设置身份验证

  • (可选)设置SSL,SSH等的其他可用设置。
  • 保存并连接

2
投票

如果未启用身份验证(用户名/密码)且仍无法连接。只需使用localhost和默认端口。如果测试连接成功,请单击“测试并保存”。

enter image description here

enter image description here

enter image description here

enter image description here

关心Jagdish


0
投票

Robomongo 0.8.5肯定适用于MongoDB 3.X(我的mongoDB版本是3.0.7,最新版本)。

应该执行以下步骤以连接到mongodb服务器:

  1. 安装Mongodb服务器(在Windows上,Linux ...您的选择)
  2. 运行Mongodb服务器。如果您希望客户端通过服务器自己的ip-address连接到服务器,请不要设置net.bind_ip = 127.0.0.1!
  3. 如果需要,使用服务器ip + set身份验证从Robomongo连接到服务器。

0
投票

我从Studio 3T导出以下连接:

mongodb的://渊的NoSQL-grej测试:[email protected]:10255 /管理3t.uriVersion = 2&3t.certificatePreference = RootCACert:accept_any&3t.databases =管理员&3t.connectionMode =直接&3t.useClientCertPassword =假3t.connection.name = Grej试验&readPreference =初级&SSL =真

并填写以下屏幕:Connection

Authentication

SSL

OK!

© www.soinside.com 2019 - 2024. All rights reserved.