运行机制:
shipyard和rethinkdb和swarm--manager通讯
swarm-manager使用etcd(shipyard-discovery)获取基本数据
etcd被动等待swarm-agent推送docker主机的注册信息
swarm-agent通过shiipyard-docker-proxy获取数据,并向etcd推送
shipyard-docker-proxy从/var/run/docker.sock这个unixsocket获取数据,并被动等待swarm-agent查询
SHIPYARD运行的HOST上:
datasource/rethinkdb
docker run \
-ti \
-d \
--restart=always \
--name shipyard-rethinkdb \
rethinkdb
discovery/etcd
docker run \
-ti \
-d \
-p 4001:4001 \
-p 7001:7001 \
--restart=always \
--name shipyard-discovery \
microbox/etcd -name discovery
docker run \
-ti \
-d \
--restart=always \
--name shipyard-swarm-manager \
swarm:latest \
manage --host tcp://0.0.0.0:3375 etcd://<IP-OF-HOST>:4001
controller/shipyard
docker run \
-ti \
-d \
--restart=always \
--name shipyard-controller \
--link shipyard-rethinkdb:rethinkdb \
--link shipyard-swarm-manager:swarm \
-p 8080:8080 \
shipyard/shipyard:latest \
server \
-d tcp://swarm:3375
然后在要被管理的机器上:
shipyard-docker-proxy
docker run \
-ti \
-d \
-p 2375:2375 \
--hostname=$HOSTNAME \
--restart=always \
--name shipyard-proxy \
-v /var/run/docker.sock:/var/run/docker.sock \
-e PORT=2375 \
shipyard/docker-proxy:latest
swarm-agent
docker run \
-ti \
-d \
--restart=always \
--name shipyard-swarm-agent \
swarm:latest \
join --addr <ip-of-host>:2375 etcd://<ip-of-host>:4001
2375前面的IP使用本机的IP,4001前面的IP使用shipyard所在机器的IP