问题描述
我已经在VM中安装了mongodb。谁能告诉我如何配置mongodb以从我的本地计算机远程连接它。
请找到配置文件:
# mongod.conf
# for documentation of all options,see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: C:\MongoDB\db
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: C:\MongoDB\log\mongod.log
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1
#processManagement:
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
是否需要使用VM IP地址代替bindIp?
感谢您的时间
解决方法
您必须将bindIp
设置为0.0.0.0
,然后才能通过VM IP连接到mongo