Docker 图形监控和管理

来自ling
跳转至: 导航搜索

DockerUI

[1]

docker run -d -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock uifd/ui-for-docker

Shipyard

Shipyard1.png

如果节点无法显示或在centos启动时,总是一直处于等待状态,后查明应该是防火墙的原因,导致一些应用无法访问,解决的办法是打开用到的端口,如4001,2375,7001等。或者直接关闭防火墙 systemctl stop firewalld.service

  • engine

一个shipyard管理的docker集群可以包含一个或多个engine(引擎),一个engine就是监听tcp端口的docker daemon。shipyard管理docker daemon、images、containers完全基于Docker API,不需要做其他的修改。另外,shipyard可以对每个engine做资源限制,包括CPU和内存;因为TCP监听相比Unix socket方式会有一定的安全隐患,所以shipyard还支持通过SSL证书与docker后台进程安全通信。

  • rethinkdb

RethinkDB是一个shipyard项目的一个docker镜像,用来存放账号(account)、引擎(engine)、服务密钥(service key)、扩展元数据(extension metadata)等信息,但不会存储任何有关容器或镜像的内容。一般会启动一个shipyard/rethinkdb容器shipyard-rethinkdb-data来使用它的/data作为数据卷供另外rethinkdb一个挂载,专门用于数据存储。

自动启动类型

[2]

curl -s https://shipyard-project.com/deploy | bash -s
curl -s https://shipyard-project.com/deploy | bash -s -- -h
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock shipyard/deploy start

添加节点

curl -sSL https://shipyard-project.com/deploy | ACTION=node DISCOVERY=etcd://192.168.1.33:4001 bash -s

手工启动

官方启动文档

如果没有找到节点 需要开放4001端口 更多参考 centos7 关闭防火墙

  • Datastore

As mentioned, Shipyard uses RethinkDB for the datastore. First we will launch a RethinkDB container.

docker run -ti -d --restart=always --name shipyard-rethinkdb rethinkdb
  • Discovery

To enable Swarm leader election, we must use an external key value store from the Swarm container. For this example, we will use etcd however, you can use any key/value backend supported by Swarm.

docker run -ti -d -p 4001:4001 -p 7001:7001 --restart=always --name shipyard-discovery microbox/etcd -name discovery
  • Proxy

By default, the Docker Engine only listens on a socket. We could re-configure the Engine to use TLS or you can use a proxy container. This is a very lightweight container that simply forwards requests from TCP to the Unix socket that Docker listens on.

Note: You do not need this if you are using a manual TCP / TLS configuration.

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 Manager

This will run a Swarm container configured to manage.

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
  • Swarm Agent

This runs a Swarm agent that allows the node to schedule containers.

docker run -ti -d --restart=always --name shipyard-swarm-agent swarm:latest join --addr <ip-of-host>:2375 etcd://<ip-of-host>:4001
  • Controller

This runs the Shipyard Controller.

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

Once the controller is launched and the controller has initialized the datastore you should be able to login via http://[ip-of-host]:8080.

第一次run后,关闭再次启动时直接使用:

docker stop shipyard-controller shipyard-swarm-agent shipyard-swarm-manager shipyard-proxy shipyard-certs shipyard-discovery shipyard-rethinkdb
docker start shipyard-rethinkdb shipyard-discovery shipyard-certs shipyard-proxy shipyard-swarm-manager shipyard-swarm-agent shipyard-controller

默认用户名/密码为 admin/shipyard