TECHZEN Zenoss User Community ARCHIVE  

cAdvisor and serviced

Subject: cAdvisor and serviced
Author: Jan Garaj
Posted: 2015-04-14 16:00

1.) cAdvisor - https://github.com/jangaraj/serviced-app-cadvisor
I would like to use cAdvisor with serviced. I need to "reproduce" docker command:
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

No big deal, just publish port 8080 and "mount" right folders.

But container is not starting:
[root@dev ~]# serviced service start cAdvisor
Service already started
[root@dev ~]# serviced service stop cAdvisor
Scheduled 1 service(s) to stop
[root@dev ~]# serviced service start cAdvisor
Scheduled 1 service(s) to start
[root@dev ~]# serviced service status cAdvisor
NAME ID STATUS UPTIME HOST IN_SYNC DOCKER_ID
cAdvisor dcr7jukixbdxrlt1kp6me8kvj
[root@dev ~]# serviced service attach cAdvisor
no matches found
no matches found
[root@dev ~]# serviced -version
serviced version 1.0.1 - 9837f2b

[root@dev ~]# journalctl -u serviced -fl | grep cadvisor
Apr 14 21:33:31 mon040.back.mgmt.cwwtf.local serviced[5457]: I0414 20:33:31.412049 05457 servicetemplate.go:132] Pulling image google/cadvisor:latest
Apr 14 21:33:36 mon040.back.mgmt.cwwtf.local serviced[5457]: I0414 20:33:36.075045 05457 api.go:736] pushing image from repo: localhost:5000/dcr7jukixbdxrlt1kp6me8kvj/cadvisor to registry: localhost:5000 with tag:
Apr 14 21:33:40 mon040.back.mgmt.cwwtf.local serviced[5457]: I0414 20:33:40.107311 05457 api.go:750] finished pushing image from repo: localhost:5000/dcr7jukixbdxrlt1kp6me8kvj/cadvisor to registry: localhost:5000 with tag:
Apr 14 21:33:40 mon040.back.mgmt.cwwtf.local serviced[5457]: I0414 20:33:40.304698 05457 resources.go:115] Deployed template {default 513eae216558c3770349cc0fbd8a7015 cadvisor}

Logstash: no log for "cadvisor". Volumes exist on the host. Docker container is starting OK, but when I use serviced, then it's not starting.

Maybe config of serviced:
# Set the loglevel for serviced
# SERVICED_LOG_LEVEL=0 - I've tried also SERVICED_LOG_LEVEL=5, but no useful details in the log
# Set the port on which to listen for profiler connections (-1 to disable)
# SERVICED_DEBUG_PORT=6006

2.) skyline app - https://github.com/jangaraj/zenoss5-skyline
I would like to use linked containers with serviced:
docker run --name redis3 -d redis
docker run -d -p 1500:1500 -P --link redis3:redis klynch/skyline python ./skyline.py -r redis://redis:6379/ settings -i data/settings.json && python ./skyline.py -r redis://redis:6379/ horizon -u 2025 & && python ./skyline.py -r redis://redis:6379/ analyzer &

How can I expose (link) redis port 6379 from redis container to skyline container only I don't want to expose it to the host.
How can I achieve that redis container will be started before skyline container

Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.

DevOps stack: Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform / Elasticsearch



Subject: cAdvisor
Author: [Not Specified]
Posted: 2015-04-19 20:02

Hi -

At this time, we don't currently support mounting arbitrary host filesystem locations into containers. This is a feature that is in the backlog for a later release.

The design of serviced utilizes an NFS-shared directory that is the context for any 'Volume' declarations in your service definitions. For example, if you define a volume as


{
"Owner": "root:root",
"Permission": "",
"ResourcePath": "the-rootfs-vol",
"ContainerPath": "/rootfs",
"Type": ""
}

then that service will have a volume mounted at '/rootfs' that maps to /opt/serviced/volumes//the-rootfs-vol on the master host. This is, at a minimum, part of your problem.

For additional logging, you can do 'serviced service logs ' which will print out stdout/stderr of the process. If a container is starting and then immediately stopping, you can look in logstash in the Control Center UI for logs form the container.



Subject: OK, I can't run cadvisor with
Author: Jan Garaj
Posted: 2015-04-20 13:18

OK, I can't run cadvisor with serviced at the moment.

Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.

DevOps stack: Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform / Elasticsearch



< Previous
zenoss5 app stuck at 'starting service' upon host reboot
  Next
Rhybudd
>