1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-12 11:14:57 +02:00
dockerfiles/graphite
2019-11-24 19:28:12 +08:00
..
data graphite: populate STATIC_ROOT 2019-04-11 14:29:43 +08:00
docker-compose.yml update graphite 2018-11-08 11:04:08 +08:00
Dockerfile upgrade graphite to 1.1.6 2019-11-24 19:28:12 +08:00
README.md graphite: populate STATIC_ROOT 2019-04-11 14:29:43 +08:00
supervisord.conf update graphite 2018-11-05 17:40:02 +08:00

graphite

Graphite does three things:

  • Kick ass.
  • Chew bubblegum.
  • Make it easy to store and graph metrics.

docker-compose.yml

graphite:
  image: vimagick/graphite
  ports:
    - "2003:2003"
    - "2003:2003/udp"
    - "2004:2004"
    - "2023:2023"
    - "2024:2024"
    - "7002:7002"
    - "8080:8080"
    - "9001:9001"
  volumes:
    - ./data/conf:/opt/graphite/conf
    - ./data/storage:/opt/graphite/storage
  restart: always

Up and Running

$ cd ~/fig/graphite
$ mkdir -p data/storage/log/webapp
$ docker-compose up -d
$ docker-compose exec graphite sh
>>> vi conf/storage-schemas.conf
>>> python webapp/manage.py migrate --noinput --run-syncdb
>>> python webapp/manage.py createsuperuser
>>> python webapp/manage.py changepassword
>>> supervisorctl restart
>>> supervisorctl status
carbon-aggregator   RUNNING   pid 9, uptime 0:00:13
carbon-cache        RUNNING   pid 8, uptime 0:00:22
graphite-webapp     RUNNING   pid 7, uptime 0:00:24
>>> exit
$ tree -F -L 4
├── data/
│   ├── conf/
│   │   ├── aggregation-rules.conf
│   │   ├── carbon.conf
│   │   ├── rewrite-rules.conf
│   │   └── storage-schemas.conf
│   └── storage/
│       ├── carbon-cache-a.pid
│       ├── graphite.db
│       ├── log/
│       │   └── webapp/
│       └── whisper/
│           └── carbon/
└── docker-compose.yml
$ curl http://localhost:8080

storage-schemas.conf

[carbon]
pattern = ^carbon\.
retentions = 60:90d

[test_1day_for_1year]
pattern = ^test\.
retentions = 1d:1y

[default_1min_for_1day]
pattern = .*
retentions = 60s:1d

Resize Whisper

$ docker-compose exec graphite sh
>>> cd storage/whisper/test
>>> find . -type f -name '*.wsp' -exec whisper-resize.py --nobackup {} 1d:1y \;