容器监控

cadvisor

[root@cka-node1 ~]# docker history hub.c.163.com/xbingo/cadvisor:latest 
IMAGE          CREATED       CREATED BY                                      SIZE      COMMENT
4bc3588563b1   5 years ago   /bin/sh -c #(nop) ENTRYPOINT ["/usr/bin/cadv…   0B        
<missing>      5 years ago   /bin/sh -c #(nop) EXPOSE 8080/tcp               0B        
<missing>      5 years ago   /bin/sh -c #(nop) ADD file:d8a1cb9e0c5b0d90d…   23MB      
<missing>      5 years ago   /bin/sh -c apk add --update ca-certificates …   20MB      
<missing>      5 years ago   /bin/sh -c #(nop) ENV GLIBC_VERSION=2.23-r1     0B        
<missing>      5 years ago   /bin/sh -c #(nop) MAINTAINER dengnan@google.…   0B        
<missing>      5 years ago   /bin/sh -c #(nop) ADD file:af671c91a986f389f…   5.26MB   

[root@cka-node1 ~]# docker run -d --name mon --restart=always -p 8080:8080 -v /var/run:/var/run -v /sys:/sys:ro -v /var/lib/docker:/var/lib/docker:ro hub.c.163.com/xbingo/cadvisor 

浏览器访问

访问.png

cadvisor.jpg

scope

[root@cka-node1 ~]# wget 1.116.86.11/scope

[root@cka-node1 ~]# chmod  +x scope

[root@cka-node1 ~]# ./scope 
Usage:
scope launch {OPTIONS} {PEERS} - Launch Scope
scope stop                     - Stop Scope
scope command                  - Print the docker command used to start Scope
scope help                     - Print usage info
scope version                  - Print version info

PEERS are of the form HOST[:PORT]
HOST may be an ip or hostname.
PORT defaults to 4040.

Launch options:
Unable to find image 'weaveworks/scope:1.13.1' locally
#需要这个镜像

[root@cka-node1 ~]# docker pull weaveworks/scope:1.13.1

#拉取完后再次运行
[root@cka-node1 ~]# ./scope

[root@cka-node1 ~]# ./scope launch
ae9896a93c42f1d4bad8677e6d7b7496ae20562577b9b7a5be44493aa009420d
Scope probe started
Weave Scope is listening at the following URL(s):
  * http://192.168.4.61:4040/
  * http://10.244.115.64:4040/

打开浏览器访问

scope.jpg

这个也可以直接进入容器
16297040201.jpg