1、创建目录
# mkdir cig
2、新建docker-compose
vi docker-compose.yml version: '3.1' volumes: grafana_data: {} services: influxdb: image: tutum/influxdb:0.9 restart: always environment: - PRE_CREATE_DB=cadvisor ports: - "8083:8083" - "8086:8086" volumes: - ./data/influxdb:/data cadvisor: image: google/cadvisor links: - influxdb:influxsrv command: -storage_driver=influxdb -storage_driver_db=cadvisor -storage_driver_host=influxsrv:8086 restart: always ports: - "8080:8080" volumes: - /:/rootfs:ro - /var/run:/var/run:rw - /sys:/sys:ro - /var/lib/docker/:/var/lib/docker:ro grafana: user: "104" image: grafana/grafana user: "104" restart: always links: - influxdb:influxsrv ports: - "3000:3000" volumes: - grafana_data:/var/lib/grafana environment: - HTTP_USER=admin - HTTP_PASS=admin - INFLUXDB_HOST=influxsrv - INFLUXDB_PORT=8086 - INFLUXDB_NAME=cadvisor - INFLUXDB_USER=root - INFLUXDB_PASS=root
3、启动docker-compose
docker-compose up -d
4、查看服务启动状态
#cAdvisor服务
http://192.168.111.99:8080/containers/
#influxdb服务 http://192.168.111.99:8083/#
#grafana服务 http://192.168.111.99:3000/login admin/admin
5、grafana服务配置数据源
#默认用户名密码admin/admin http://192.168.111.99:3000/login
配置数据源
测试连接
配置面板panel
标签:CAdvisor,admin,INFLUXDB,influxdb,grafana,InfluxDB,Docker,docker,cadvisor From: https://www.cnblogs.com/zszitman/p/16848302.html