Rancher:Rancher 中未显示 EC2 主机 UI
Rancher: EC2 hosts not shown in Rancher UI
我使用 docker-machine 在 Virtualbox 上创建了一个 Rancher 设置 运行。然后我添加了两个主机,也在 virtualbox 上。现在,我正在尝试向该设置添加一个 EC2 主机(这只是为了试验 Rancher)。
我看过 this 教程,但是我想改用 Docker-machine。
为此,我做了以下工作:
MAC-OSX:~ wauterw$ docker-machine create -d amazonec2 --amazonec2-vpc-id vpc-84fd6de0 --amazonec2-region eu-west-1 --amazonec2-ami ami-c5f1beb6 --amazonec2-ssh-user rancher Rancher-node-aws-01
Running pre-create checks...
Creating machine...
(Rancher-node-aws-01) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with rancheros...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env Rancher-node-aws-01
注:AMI ID对应rancheros-v0.7.0-hvm-1.
然后我通过 SSH 进入 EC2 主机并执行以下命令(在 Rancher 的自定义方法中生成)
MAC-OSX:~ wauterw$ docker-machine ssh Rancher-node-aws-01
[rancher@Rancher-node-aws-01 ~]$
[rancher@Rancher-node-aws-01 ~]$
[rancher@Rancher-node-aws-01 ~]$
[rancher@Rancher-node-aws-01 ~]$ sudo docker run -e CATTLE_HOST_LABELS='Name=Rancher-aws-node-01' -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 http://192.168.99.100:8080/v1/scripts/BF48C4313C4967A7A57F:1478602800000:IAfyWoj0bPbeM1uxxFlnRgDf2o
Unable to find image 'rancher/agent:v1.0.2' locally
v1.0.2: Pulling from rancher/agent
5a132a7e7af1: Pull complete
fd2731e4c50c: Pull complete
28a2f68d1120: Pull complete
a3ed95caeb02: Pull complete
7fa4fac65171: Pull complete
33de63de5fdb: Pull complete
d00b3b942272: Pull complete
Digest: sha256:b0b532d1e891534779d0eb1a01a5717ebfff9ac024db4412ead87d834ba92544
Status: Downloaded newer image for rancher/agent:v1.0.2
7d419ead09365347e827bee24519547c9507fb36ecac794ea6d4bcb312abeb55
[rancher@Rancher-node-aws-01 ~]$
我希望我的 Rancher UI 也能显示这个主机,但它只显示 Virtualbox 主机。有什么想法吗?
主机代理需要能够使用您已设置为 http://192.168.99.100:8080 的注册 URL 连接到服务器。 EC2 中的虚拟机无法访问它。
我使用 docker-machine 在 Virtualbox 上创建了一个 Rancher 设置 运行。然后我添加了两个主机,也在 virtualbox 上。现在,我正在尝试向该设置添加一个 EC2 主机(这只是为了试验 Rancher)。
我看过 this 教程,但是我想改用 Docker-machine。
为此,我做了以下工作:
MAC-OSX:~ wauterw$ docker-machine create -d amazonec2 --amazonec2-vpc-id vpc-84fd6de0 --amazonec2-region eu-west-1 --amazonec2-ami ami-c5f1beb6 --amazonec2-ssh-user rancher Rancher-node-aws-01
Running pre-create checks...
Creating machine...
(Rancher-node-aws-01) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with rancheros...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env Rancher-node-aws-01
注:AMI ID对应rancheros-v0.7.0-hvm-1.
然后我通过 SSH 进入 EC2 主机并执行以下命令(在 Rancher 的自定义方法中生成)
MAC-OSX:~ wauterw$ docker-machine ssh Rancher-node-aws-01
[rancher@Rancher-node-aws-01 ~]$
[rancher@Rancher-node-aws-01 ~]$
[rancher@Rancher-node-aws-01 ~]$
[rancher@Rancher-node-aws-01 ~]$ sudo docker run -e CATTLE_HOST_LABELS='Name=Rancher-aws-node-01' -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 http://192.168.99.100:8080/v1/scripts/BF48C4313C4967A7A57F:1478602800000:IAfyWoj0bPbeM1uxxFlnRgDf2o
Unable to find image 'rancher/agent:v1.0.2' locally
v1.0.2: Pulling from rancher/agent
5a132a7e7af1: Pull complete
fd2731e4c50c: Pull complete
28a2f68d1120: Pull complete
a3ed95caeb02: Pull complete
7fa4fac65171: Pull complete
33de63de5fdb: Pull complete
d00b3b942272: Pull complete
Digest: sha256:b0b532d1e891534779d0eb1a01a5717ebfff9ac024db4412ead87d834ba92544
Status: Downloaded newer image for rancher/agent:v1.0.2
7d419ead09365347e827bee24519547c9507fb36ecac794ea6d4bcb312abeb55
[rancher@Rancher-node-aws-01 ~]$
我希望我的 Rancher UI 也能显示这个主机,但它只显示 Virtualbox 主机。有什么想法吗?
主机代理需要能够使用您已设置为 http://192.168.99.100:8080 的注册 URL 连接到服务器。 EC2 中的虚拟机无法访问它。