[英]How can i connect with mongodb in SlamData for my EC2 server
I can successfully connected with mongodb on SlamData but for my localhost. 我可以成功连接SlamData上的mongodb,但可以连接到我的本地主机。 Now I have a mongodb database on my EC2 server that database i want to connect in Ec2 then How can I ? 现在我在EC2服务器上有一个mongodb数据库,该数据库我想在Ec2中连接,那我该怎么办?
I know username and password. 我知道用户名和密码。 What should be a host and port? 主机和端口应该是什么?
If you are running Slamdata on your host and want to connect to MongoDB running on a remote EC2 host. 如果您在主机上运行Slamdata,并且想连接到在远程EC2主机上运行的MongoDB。
Then apart from the username and password, the host is the Public IP or host FQDN [ec2-xxxxxxx], port is 27017. For this check if your mongos is running and binding on 0.0.0.0. 然后,除了用户名和密码外,主机是公共IP或主机FQDN [ec2-xxxxxxx],端口是27017。为此,请检查您的mongos是否正在运行并绑定到0.0.0.0。 If it is binding to 127.0.0.1, you cannot connect remotely 如果绑定到127.0.0.1,则无法远程连接
Also check you AWS security group for EC2 and see that the port 27017 is open for your IP or in general to all [0.0.0.0] (this is NOT recommended!!!) 还要检查您的EC2的AWS安全组,并查看端口27017是否已为您的IP或所有[0.0.0.0]通用端口打开(不建议这样做!!!)
You can also review the FAQ on docs.slamdata.com located here . 您还可以查看在位于docs.slamdata.com的常见问题在这里 。
Provides step-by-step troubleshooting for connecting to cloud-hosted MongoDB servers. 提供逐步的故障排除,以连接到云托管的MongoDB服务器。
Additionally, the Path value refers to path inside of SlamData rather than the operating system path. 此外, Path值引用SlamData内部的路径,而不是操作系统路径。 For instance entering a value of aws1 results in a query path similar to the following, assuming you have a databased named demo and a collection named coll1 : 例如,假设您有一个名为demo的数据库和一个名为coll1的集合,则输入aws1的值将导致类似于以下内容的查询路径:
SELECT * FROM `/aws1/demo/coll1` 选择* FROM`/ aws1 / demo / coll1`
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.