centos6.4 安装graphite

36 篇文章 1 订阅
一、升级python2.7:
 0、准备:
  1)需要先安装openssl:(解决Python ImportError: cannot import name HTTPSHandler)
  yum install openssl openssl-devel -y
  2)安装sqlite-devel:
  解决在安装graphite-web时报错:Error loading either pysqlite2 or sqlite3 modules (http://blog.csdn.net/nuccch/article/details/42132267)
  需要安装sqlite-devel之后,重新编译安装Python即可。
yum install sqlite-devel
重新编译安装Python:
./configure
make
make install
  3)安装zlib:
  yum install zlib zlib-devel openssl  openssl-devel readline readline-devel -y
  
  
  
 1、安装python2.7.3
  1)下载、编译
  wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2  
  tar -jxvf Python-2.7.3.tar.bz2  
  cd Python-2.7.3
  ./configure  
  make         
  make install  
  #make clean  
  #make distclean 
  2)建立软连接,使系统默认的 python指向 python2.7
  mv /usr/bin/python /usr/bin/python2.6.6 
  ln -s /usr/local/bin/python2.7 /usr/bin/python  
  3)修改yum
   vi /usr/bin/yum 
   #!/usr/bin/python
改成
#!/usr/bin/python2.6.6




2、安装2.7.3的easy_install、pip
1)easy_install:
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip --no-check-certificate
unzip setuptools-7.0.zip
cd setuptools-7.0
python setup.py install






2)pip:
wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
tar zvxf 1.5.5    #解压文件
cd pip-1.5.5/
python setup.py install


http://blog.csdn.net/frank_good/article/details/43446687
http://my.oschina.net/leeyd/blog/350812


检验:(需要重新登录)
# pip -V
pip 1.5.5 from /usr/local/lib/python2.7/site-packages/pip-1.5.5-py2.7.egg (python 2.7)
# easy_install --version
setuptools 7.0


3、坑
 1)安装2.7.3对应的django
 django-admin.py syncdb --settings=graphite.settings
pip install Django==1.8


 2)pip install django-tagging


 3)ImportError: No module named cairocffi
pip install cairocffi






 4)CompressionError: bz2 module is not available
wget https://pypi.python.org/packages/source/T/Twisted/Twisted-14.0.0.tar.bz2#md5=9625c094e0a18da77faa4627b98c9815 --no-check-certificate
tar -jxf  Twisted-14.0.0.tar.bz2
cd Twisted-14.0.0;
python setup.py install


http://www.ithao123.cn/content-1273730.html




5)error: command 'gcc' failed with exit status 1
yum install libffi-devel
yum -y install gcc*












二、安装、配置graphite:
1、安装:
1)pip安装:(默认安装到了/opt下面)
pip install https://github.com/graphite-project/ceres/tarball/master
pip install whisper
pip install carbon  
#可能会报错CompressionError: bz2 module is not available
pip install graphite-web


2)修改配置文件:
cd /opt/graphite/conf
# cp aggregation-rules.conf.example aggregation-rules.conf
# cp blacklist.conf.example blacklist.conf
# cp carbon.conf.example carbon.conf
# cp carbon.amqp.conf.example carbon.amqp.conf
# cp relay-rules.conf.example relay-rules.conf
# cp rewrite-rules.conf.example rewrite-rules.conf
# cp storage-schemas.conf.example storage-schemas.conf
# cp storage-aggregation.conf.example storage-aggregation.conf
# cp whitelist.conf.example whitelist.conf
3)启动carbon-cache:
#cd /opt/graphite/bin
#./carbon-cache.py start
#netstat -nap | grep 2003
4)安装graphite-web:
cd /opt/graphite/webapp/graphite
cp local_settings.py.example local_settings.py


cd /opt/graphite/webapp/graphite/
python manage.py syncdb
#可能会报错:Django==1.8
pip install Django==1.8
#可能会报错: Error loading either pysqlite2 or sqlite3 modules
yum install sqlite-devel
# 可能会报错:No module named tagging
pip install django-tagging




5)启动:
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


可能会没有图片,报错:ImportError: No module named cairocffi
pip install cairocffi
#安装cairocffi时可能报错:error: command 'gcc' failed with exit status 1
yum install libffi-devel






参考:http://www.infoq.com/cn/articles/graphite-intro
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

赶路人儿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值