grafana review

of 22/22
시작하기 Billy Goo 2015.01.28

Post on 16-Jul-2015

408 views

Category:

Software

2 download

Embed Size (px)

TRANSCRIPT

  • Billy Goo 2015.01.28

  • Grafana?

  • ?

    .

    Graphite

    http://graphite.readthedocs.org/en/latest/

    http://influxdb.com/

    OpenTSDB

    http://opentsdb.net/

  • ?

    Graphite

    InfluxDB

    OpenTSDB

    Server

    Grafana

    DB

  • Grafana Interface

  • Grafana - Graphing

  • Grafana - Annotations

    Annotations provide a way to mark points on the graph with rich events.

  • Grafana Time range controls

  • Grafana Search features

  • Grafana + Graphite

    Grafana Graphite Elasticsearch

  • Graphite

    Grafana Graphite

    client

    client

    Elasticsearch

    Dashboard /

  • Graphite

    Graphite

    Component .

    Carbon : .

    Whisper : Carbon .

    Webapp :

    .

    http://www.aosabook.org/en/graphite.html

  • Graphite

    Component 3 .

    , ,

    CPU . 3 .

    Graphite ??

    http://www.aosabook.org/en/graphite.html

    3 Component 3

  • Grafana/Graphite

    : Ubuntu 12.04

    # Install all prerequisites

    apt-get -y install software-properties-common

    add-apt-repository -y ppa:chris-lea/node.js

    apt-get -y update

    apt-get -y install python-django-tagging python-simplejson python-memcache python-ldap \

    python-cairo python-pysqlite2 python-support python-pip gunicorn \

    supervisor nginx-light nodejs git wget curl openjdk-7-jre \

    build-essential python-dev

  • Grafana/Graphite

    Elasticsearch, graphite

    # Install Elasticsearch

    cd ~ && wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.deb

    cd ~ && dpkg -i elasticsearch-1.3.2.deb && rm elasticsearch-1.3.2.deb

    # Install Whisper, Carbon and Graphite-Web

    pip install Twisted==11.1.0

    pip install Django==1.5

    pip install whisper==0.9.12

    pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-

    lib=/var/lib/graphite/lib" carbon==0.9.12

    pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-

    lib=/var/lib/graphite/webapp" graphite-web==0.9.12

  • Grafana/Graphite

    Grafana

    # install npm

    apt-get install npm

    # Install & Patch Grafana

    mkdir /src/grafana

    git clone https://github.com/grafana/grafana.git /src/grafana

    cd /src/grafana

    git checkout v1.7.0

    npm install

    npm install -g grunt-cli

    grunt build

  • Grafana/Graphite

    Configuration

    config .

    https://github.com/kamon-io/docker-grafana-graphite

    # Configure Elasticsearch

    cp ./elasticsearch/run /usr/local/bin/run_elasticsearch

    chown -R elasticsearch:elasticsearch /var/lib/elasticsearch

    mkdir -p /tmp/elasticsearch && chown elasticsearch:elasticsearch /tmp/elasticsearch

  • Grafana/Graphite

    Configuration

    # Configure Whisper, Carbon and Graphite-Web

    cp ./graphite/initial_data.json /var/lib/graphite/webapp/graphite/initial_data.json

    cp ./graphite/local_settings.py /var/lib/graphite/webapp/graphite/local_settings.py

    cp ./graphite/carbon.conf /var/lib/graphite/conf/carbon.conf

    cp ./graphite/storage-schemas.conf /var/lib/graphite/conf/storage-schemas.conf

    cp ./graphite/storage-aggregation.conf /var/lib/graphite/conf/storage-aggregation.conf

    mkdir -p /var/lib/graphite/storage/whisper

    touch /var/lib/graphite/storage/graphite.db /var/lib/graphite/storage/index

    chown -R www-data /var/lib/graphite/storage

    chmod 0775 /var/lib/graphite/storage /var/lib/graphite/storage/whisper

    chmod 0664 /var/lib/graphite/storage/graphite.db

    cd /var/lib/graphite/webapp/graphite && python manage.py syncdb --noinput

  • Grafana/Graphite

    Configuration

    # Configure Grafana

    cp ./grafana/config.js /src/grafana/dist/config.js

    cp ./grafana/default-dashboard.json /src/grafana/dist/app/dashboards/default.json

    # Configure nginx and supervisord

    cp ./nginx/nginx.conf /etc/nginx/nginx.conf

    cp ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf

    # run graphite

    cd /var/lib/graphite/webapp/graphite; python manage.py runserver 0.0.0.0:8000

    # run grafana/elasticsearch

    /usr/bin/supervisord

  • Graphite & Grafana

    Config datasource

    /src/grafana/dist/config.js

  • Graphite

    : nc

    . 2003

    Pickle : python pickle .

    . Pickle 2004 .

    $ echo "test.billy.xx 5 `date +%s`" | nc 127.0.0.1 2003;

    [(path, (timestamp, value)), ...]

    : https://github.com/graphite-project/carbon/blob/master/examples/example-pickle-client.py

    graphite : http://graphite.readthedocs.org/en/0.9.12/feeding-carbon.html

  • Graphite