我在运行系统中使用MongoDB和Robomongo,我使用Robomongo作为客户端,我在不同的系统上安装了MongoDB,我将其视为服务器,我想将系统的Robomongo(作为客户端)连接到其他系统上的MongoDB(服务器)。我应该遵循哪些步骤来实现相同的目标?任何线索都会有所帮助。提前致谢
我能够使用连接字符串将Robomongo连接到在Mongo Labs上运行的Mongodb的远程实例,如下所示:
希望这有帮助!
编辑:注释掉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
mongod
命令,确保命令正确执行。mongo
命令。希望这将解决您的问题
干杯!!
看起来Robomongo尚未与Mongo 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/
到目前为止遇到任何特定的错误?!顺便说一句,这就是我们的工作:
Robomongo 0.8.5肯定适用于MongoDB 3.X(我的mongoDB版本是3.0.7,最新版本)。
应该执行以下步骤以连接到mongodb服务器:
我从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 =真