Graphiite+Ceeres의 환경 구축

2687 단어 graphite
개시하다
Graphite에는 표준 저장 엔진인 Whisper가 있지만, Ceeres라는 다른 저장 엔진도 지원한다.
Whisper는 고정된 길이의 데이터 파일을 사용하는데 Ceeres는 트리 형태의 데이터 구조로 이상의 데이터가 필요하지 않기 때문에 디스크를 절약할 수 있다.
Graphite 설치
우선 최신 Graphite를 설치하세요.CentOS 7을 가정합니다.
루트 작업:
yum install python-virtualenv
yum install libffi-devel
일반 사용자 작업:
virtualenv env
source env/bin/activate

pip install cffi
pip install cairocffi
pip install incremental
pip install Django==1.9.12 django-tagging==0.4.3
pip install constantly fadvise gunicorn mocker
pip install pycparser pyparsing==2.0.7 pytz python-memcached
pip install simplejson txAMQP uWSGI whitenoise zope.interface Twisted

pip install https://github.com/graphite-project/ceres/tarball/master
pip install https://github.com/graphite-project/whisper/tarball/master
git clone https://github.com/graphite-project/graphite-web.git

python setup.py install 
   --install-data=~/var/data/ \
   --install-lib=~/usr/graphite/webapp \
   --install-scripts=~/usr/graphite/bin
초기 설정:
cd ~/usr/graphite/webapp/graphite
mv local_settings.py.example local_settings.py
vi local_settings.py
  # GRAPHITE_ROOTの修正(~/var/data/をフルパスで指定)

# DBの初期化
PYTHONPATH=~/usr/graphite/webapp django-admin.py migrate \
  --run-syncdb --settings=graphite.settings
스토리지 엔진 변경(Whisper->Ceeres):
~/usr/graphite/webapp/graphite/settings.다음과 같이 py 수정
STORAGE_FINDERS = (
    'graphite.finders.ceres.CeresFinder',
)
Graphite 시작
PYTHONPATH=~/usr/graphite/webapp uwsgi --http :8080 \
   --wsgi-file ~/usr/graphite/webapp/graphite/wsgi.py \
   --static-map=/static=$(pwd)/var/data/webapp/content/
로그인 테스트 데이터ceres-node-create, ceres-node-write 등의 명령을 사용할 수 있습니다.
# ツリーの作成
cd ~/var/data/storage/ceres/
ceres-tree-create test

# ノードの作成
ceres-node-create test/node1 
ceres-node-create test/node2 --step 60  (解像度を60秒に設定)

# データの登録
ceres-node-write test/node1 N:1
ceres-node-write test/node2 N:1
(Nを指定すると現在時刻になります)

# ランダムにいれてみる
ceres-node-write test/node1 1482304620:$RANDOM
ceres-node-write test/node1 1482304680:$RANDOM
ceres-node-write test/node1 1482304740:$RANDOM
Graphiite-web에서 확인
데이터가 좋으면 이렇게 나오겠지.

총결산
Ceeres는 데이터 크기 억제에 효과가 있고 성능 향상을 기대할 수도 있지만 (Whisper도) 확장된 문제는 해결할 수 없다.하지만 양도가 많으면 그만큼 좋은 점도 있겠죠.
문제는 작은 파일을 대량으로 생성해 디스크 블록 크기에 영향을 받고, 특히 실제 데이터가 많은 경우 와이퍼에 비해 몇 배나 많은 디스크가 소모되기 때문이다.convert-wsp-to-ceres 이런 부속 도구도 변환할 수 있기 때문에 실제적으로 검증하는 것이 가장 좋다.

좋은 웹페이지 즐겨찾기