如何在azure容器服务中创建docker swarm后连接到代理/工作节点?

时间:2018-04-03 07:39:22

标签: azure virtual-machine docker-swarm

我创建了一个容器服务,并将业务流程设置为swarm。我有1个主人和2个代理人。我期待swarm自动启动,但它不会出现。我需要远程访问每个VM以将其连接到群集管理器。

虽然我可以通过SSH连接到我的主VM,但我看不到如何连接到比例集中的任何一个代理vm。

我在git bash中尝试了以下内容,基于比例集中列出的实例名称....

$ ssh moconnor@swarm-agentpool-16065278-vmss_1 -i /c/Users/Matthew.OConnor/azure

链接到我的私人SSH密钥,但收到以下错误....

ssh: Could not resolve hostname swarm-agentpool-16065278-vmss_1: Name or service not known

我认为这是因为swarm-agentpool-16065278-vmss_1既不是有效的ip或dns,又是如何在比例集中为每个VM获取此值?

以下适用于连接我的主人......

ssh moconnor@saseleniummgmt.ukwest.cloudapp.azure.com -i /c/Users/Matthew.OConnor/azure

根据指南中的this section,我应该看到规模集中每个VM的入站NAT规则。

对我来说这个屏幕是空的......

enter image description here

并且由于以下消息,它不允许我添加任何内容...

Full virtual machine scale set support for the portal is coming soon. Adding or editing references between load balancers and scale set virtual machines is currently disabled for load balancers that contain an existing association with a scale set.

如何在使用容器服务创建的比例集中连接到VM?

1 个答案:

答案 0 :(得分:1)

您可以通过ssh来掌握VM并在Azure门户上找到代理私有IP。

enter image description here

然后你可以ssh代理实例,例如。

ssh -i ~/.ssh/id_rsa <username>@10.0.0.5

注意:id_rsa与主VM相同。

相关问题