From c53641c29fcdd256561015b162c9693651ba4682 Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Mon, 3 Nov 2014 17:21:38 -0800 Subject: [PATCH] Add more detailed running instructions. Fixes #290 --- README.md | 2 +- docs/running.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 docs/running.md diff --git a/README.md b/README.md index 4ec21505..defc4f97 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ sudo docker run \ cAdvisor is now running (in the background) on `http://localhost:8080`. The setup includes directories with Docker state cAdvisor needs to observe. -**Note**: On CentOS and RHEL 6, run cAdvisor with an additional option ```--volume=/cgroup:/cgroup \``` +**Note**: If you're running on CentOS, RHEL, or are using LXC take a look at our [running instructions](docs/running.md). If you want to build your own cAdvisor Docker image, take a look at `deploy/Dockerfile` and `deploy/build.sh`. diff --git a/docs/running.md b/docs/running.md new file mode 100644 index 00000000..f3da6adb --- /dev/null +++ b/docs/running.md @@ -0,0 +1,49 @@ +# Running cAdvisor + +## With Docker + +We have a Docker image that includes everything you need to get started. Simply run: + +``` +sudo docker run \ + --volume=/:/rootfs:ro \ + --volume=/var/run:/var/run:rw \ + --volume=/sys:/sys:ro \ + --volume=/var/lib/docker/:/var/lib/docker:ro \ + --publish=8080:8080 \ + --detach=true \ + --name=cadvisor \ + google/cadvisor:latest +``` + +cAdvisor is now running (in the background) on `http://localhost:8080/`. The setup includes directories with Docker state cAdvisor needs to observe. + +### CentOS and RHEL + +On CentOS and RHEL the cgroup hierarchies are mounted in `/cgroup` so run cAdvisor with an additional Docker option of `--volume=/cgroup:/cgroup \`. + +### LXC Docker exec driver + +If you are using Docker with the LXC exec driver, then you need to manually specify all cgroup mounts by adding the: + +``` + --volume=/cgroup/cpu:/cgroup/cpu \ + --volume=/cgroup/cpuacct:/cgroup/cpuacct \ + --volume=/cgroup/cpuset:/cgroup/cpuset \ + --volume=/cgroup/memory:/cgroup/memory \ + --volume=/cgroup/blkio:/cgroup/blkio \ +``` + +## Standalone + +cAdvisor is a static Go binary with no external dependencies. To run it standalone all you should need to do is run it! Note that some data sources may require root priviledges. cAdvisor will gracefully degrade its features to those it can expose with the access given. + +``` +$ sudo cadvisor +``` + +cAdvisor is now running (in the foreground) on `http://localhost:8080/`. + +## I need help! + +We aim to have cAdvisor run everywhere! If you run into issues getting it running, feel free to file an issue. We are very responsive in supporting our users and update our documentation with new setups.