I have couple of nodes in docker swarm but both the nodes shows only container running on them when "docker stats" command is run
But i would like list container stats (cpu,memory) from all nodes when docker stats is run on any one of the node.
Is this possible?
Any insight will be of great help.
Best Answer
There's no direct way to retrieve all container stats of a given service in a Swarm.
if you want information about CPU, memory and other info, you can use combinations
docker node
,cut
,xargs
and ssh thendocker stats
on each node:Above command will show you each container CPU,Memory group by node like
Node1
Node2
Also ref. https://stackoverflow.com/questions/45907274/docker-stats-in-swarm-mode