背景说明

Weave Scope是一个图形化的容器监控,轻量且支持多主机监控聚合且是一个开源项目,Weave Scope会自动生成容器之间的关系图,方便理解容器之间的关系,也方便监控容器化和微服务化的应用。

解决方案

开源地址

https://github.com/weaveworks/scope

安装部署

文件下载

打开浏览器访问网址: https://github.com/weaveworks/weave/releases
image.png

权限赋予

  1. [root@vm1 ~]# wget https://github.com/weaveworks/scope/releases/download/v1.13.2/scope
  2. [root@vm1 ~]# chmod +x scope
  3. [root@vm1 ~]# mv scope /usr/local/bin/

单机监控

  1. [root@vm1 ~]# scope launch
  2. Unable to find image 'weaveworks/scope:1.13.2' locally
  3. 1.13.2: Pulling from weaveworks/scope
  4. ba3557a56b15: Pull complete
  5. 3ac4c0e9800c: Pull complete
  6. d052e74a4dae: Pull complete
  7. aacb9bf49f73: Pull complete
  8. 06841e6f61a9: Pull complete
  9. ee99b95c7732: Pull complete
  10. dd0e726a9a15: Pull complete
  11. 05cb5f9d0d32: Pull complete
  12. e956cf3e716a: Pull complete
  13. Digest: sha256:8591bb11d72f784f784ac8414660759d40b7c0d8819011660c1cc94271480a83
  14. Status: Downloaded newer image for weaveworks/scope:1.13.2
  15. 21c132dc95a8ed7e97b9c52da70a32812edd633733234739bb178bb43321dfaf
  16. Scope probe started
  17. Weave Scope is listening at the following URL(s):
  18. * http://192.168.184.139:4040/

查看监控

打开浏览器访问网址: http://192.168.184.139:4040/即可看到监控界面

关闭监控

  1. [root@vm1 ~]# scope stop

多机监控

假设这里有2台主机,主机IP分别是192.168.184.138和192.168.184.139

  1. [root@vm1 ~]# scope launch 192.168.184.138 192.168.184.139
  2. WARNING: IPv4 forwarding is disabled. Networking will not work.
  3. ddcc733681e8ad3edde9d075923d9c98e8536879c1e151734f5f58adf3cddc47
  4. Scope probe started
  5. Weave Scope is listening at the following URL(s):
  6. * http://192.168.184.138:4040/

此时访问任意一个主机的4040端口即可看到对应的监控界面
image.png

不同主机的主机名称需要不同