问题描述
我想将linux VM scale set的成员连接到运行在azure上的mongodb atlas服务. mongodb服务需要将scaleset成员的ip地址列入白名单,以便连接到数据库.
I would like to connect the members of linux VM scale set to the mongodb atlas service running on azure. The mongodb service requires to whitelist the ip addresses of the members of the scaleset in order to connect to the database.
我(通过whatsmyip.com)获得了一个正在运行的scaleset VM的IP(发送)地址,但是我注意到我无法在门户的任何位置找到该IP地址.为什么虚拟机具有那个似乎没有在任何地方配置的特定IP地址?我也 试图将一个公共ip添加到比例集,但是按预期的方式,不适用于VM启动的连接.
I acquired to ip (outgoing) address of a running scaleset VM (via whatsmyip.com), however I noticed that I cannot find this ip address anywhere in the portal. Why does the VM have that specific ip address that seems to be not configured anywhere? I also tried to add a public ip to the scaleset, however as expected, that does not work for connections which are initiated by the VM.
配置单个公共ip的最佳方法是什么,我可以将其用于所有我的scaleset成员以连接到mongodb Atlas服务?
What is the best way to configure a single public ip which I can use for all my scaleset members to connect to the mongodb atlas service?
推荐答案
ScaleSet中的每个VM将具有专用的专用IP地址.通常,在规模集实例中,您没有与每个单独的VM关联的公共IP.相反,当您要连接到特定实例时,将使用带有 公用IP地址,也可以从同一虚拟网络中的另一台计算机连接到VM的专用地址.
Each VM in a ScaleSet will have a dedicated private IP address. Generally, you do not have public IPs associated with each individual VM in a scale set instance. Rather, when you want to connect to a specific instance you will use a Load Balancer with a public IP address or you can connect to the private address of the VMs from another machine in the same Virtual Network.
这些是我们在门户中共享的地址.它们通常是10.0.2.1、10.0.2.2等
These are the address we share in the portal. They are often something like 10.0.2.1, 10.0.2.2, etc
您可以在此处阅读有关Azure中出站连接的更多信息:
You can read more about outbound connections in Azure here:
https://docs.microsoft.com/zh-CN/azure/load-balancer/load-balancer-outbound-connections
https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections
我认为,如果数据库未托管在Azure中,则很难在数据库的规模集实例中将IP列入白名单.在数据库和您的规模集实例之间共享虚拟网络以提供这种级别的通信可能类似于.
I think it will be difficult to whitelist the IPs in a scale set instance for your database if your DB is not hosted in Azure. It might be similar to share the virtual networks between the DB and your scale set instance to provide that level of communication.
这篇关于所有scaleset成员的静态传出IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!