docker基础之八monitor-3-weavescope
weave scope
所用镜像
weaveworks/scope:1.11.5
Weave Scope 的最大特点是会自动生成一张 Docker 容器地图,让我们能够直观地理解、监控和控制容器。千言万语不及一张图
安装
curl -L git.io/scope -o /usr/local/bin/scope chmod a+x /usr/local/bin/scope [root@nas5 ~]# scope launch 69ebf839c7da58718415464bb11e95cf3b5b85bdd6e3d41d77b0f42c148af1dc Scope probe started Weave Scope is listening at the following URL(s): * http://10.100.4.105:4040/ * http://10.1.1.15:4040/
scope launch 将以容器方式启动 Weave Scope。
[root@nas5 ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2ac512380650 weaveworks/scope:1.11.5 "/bin/sh -c 'curl -m…" 1 second ago Created clever_einstein 69ebf839c7da weaveworks/scope:1.11.5 "/home/weave/entrypo…" 28 seconds ago Up Less than a second weavescope a16675950610 httpd "httpd-foreground" 3 days ago Up About an hour 80/tcp httpd [root@nas5 ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 69ebf839c7da weaveworks/scope:1.11.5 "/home/weave/entrypo…" 3 minutes ago Up 2 minutes weavescope a16675950610 httpd "httpd-foreground" 3 days ago Up About an hour 80/tcp httpd
访问页面:
http://10.1.1.15:4040

容器监控
weave scope地图中间显示了host当前运行的容器,不过少了weave相关的容器
weave scope将容器分为两类:weave自己的容器system container,和其它容器application container,默认仅显示后者
weavescope界面可交互的,点击地图左下角的All可显示所有container

点击cpu选择器,weave scope将以高低水位方式显示容器CPU使用量

如果此时将鼠标放到容器图标,则会显示具体的CPU%

点击容器图标,可以查看容器详细信息

详细信息包括:
Status
Info
Inbond
Outbond
Processes
Docker labels
Image
对容器的操作按钮

docker container attach

docker container exec

docker container restart

docker container pause

docker container stop

Hosts监控
点击顶部Hosts菜单项,地图将显示当前host

与容器类似,点击host图标将显示详细信息

host当前的资源使用情况和历史曲线一览无余
host页面上部有一个按钮,可以直接打开host的shell窗口,进行远程远程管理

多主机监控
在同时需要监控的两台主机上都运行
[root@nas5 ~]# scope launch 10.1.1.14 10.1.1.15 d47809d6a5b0914851728fc373fda23264f8c1d2af7a770b314be06d181d7801 Scope probe started Weave Scope is listening at the following URL(s): * http://10.1.1.15:4040/ * http://10.100.4.105:4040/ [root@nas4 ~]# scope launch 10.1.1.14 10.1.1.15 Unable to find image 'weaveworks/scope:1.11.5' locally 1.11.5: Pulling from weaveworks/scope 48ecbb6b270e: Pull complete a9173551d000: Pull complete e1cb00bed8ea: Pull complete e99cc8ba1bc9: Pull complete 2f4d78d76aee: Pull complete e28b73b9f8e7: Pull complete e1b00f4c68ab: Pull complete 1463816cff46: Pull complete b7955d090a66: Pull complete 16e5522f4d88: Pull complete Digest: sha256:5a63d0be7988c05059a7511abfa50e217eff101ff843c783ee6da27b113d3d23 Status: Downloaded newer image for weaveworks/scope:1.11.5 a96318b58ed3f9c1eff2ad236b2a0b89819753761cfd0f7031d0ecf45193f991 Scope probe started Weave Scope is listening at the following URL(s): * http://10.100.10.165:4040/ * http://10.1.1.14:4040/ You have new mail in /var/spool/mail/root
无论访问http://10.1.1.14:4040还是http://10.1.1.15:4040,都能监控到两个host

点击CONTAINERS菜单项,将显示环境中的所有容器

容器图标下面表明了所在host

可以进行SEARCH

weave scope还支持逻辑条件查询,比如输入cpu > 2,立刻会找出cpu利用率高于2%的容器

更多过滤方法点击帮助



浙公网安备 33010602011771号