环境:centos7、python 2.7版本
官网参考
参考2
STEP1:获取三大安装包,whisper, carbon, and graphite-web
- carbon - a Twisted daemon that listens for time-series data
- whisper - a simple database library for storing time-series data (similar in design to RRD)
- graphite webapp - A Django webapp that renders graphs on-demand using Cairo
我是选择在/root路径下进行的,命令如下:
git clone https://github.com/graphite-project/graphite-web.git
git clone https://github.com/graphite-project/carbon.git
git clone https://github.com/graphite-project/whisper.git
安装完成后,在/root/路径下可以看到新增三个文件夹:carbon、graphite-web、whisper
STEP2:安装whisper
pushd whisper
sudo python setup.py install
popd
STEP3:安装carbon
pushd
python setup.py install
popd
STEP4:配置carbon
pushd /opt/graphite/conf
cp carbon.conf.example carbon.conf
cp storage-schemas.conf.example storage-schemas.conf
启动carbon,之后可以看到carbon-cache进程
cd /opt/graphite/bin
./carbon-cache.py start
STEP5:安装graphite-web
#检查依赖关系
pushd graphite-web
python check-dependencies.py
popd
如果报缺失任何包,pip install **即可
pushd graphite-web
python setup.py install
popd
配置graphite-web
cd /opt/graphite/webapp/graphite
cp local_settings.py.example local_settings.py
cp dashboard.conf.example dashboard.conf
cp graphTemplates.conf.example graphTemplates.conf #这一步我没成功,但不影响
STEP6:初始化数据库
python manage.py syncdb
可能会报错:ImportError: No module named django.core.management,解决:
pip install Django==1.8
再次运行# python manage.py syncdb 即可,在安装过程中需要输入用户名、密码、邮件等信息。
STEP7:启动graphite
cd /opt/graphite
PYTHONPATH=`pwd`/storage/whisper ./bin/run-graphite-devel-server.py --port=8085 --libs=`pwd`/webapp /opt/graphite 1>/opt/graphite/storage/log/webapp/process.log 2>&1 &
tail -f /opt/graphite/storage/log/webapp/process.log
至此搞定,默认端口是8085,打开浏览器linux虚机IP:8085/