1、下载源码包
注意:python2.7.3无法安装
wgethttps://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
2、安装必要的软件
yum -y install gcc automake autoconf libtool make zlib-devel openssl* bzip2*
3、编译安装python2.7
cp Python-2.7.13.tar.xz /usr/src/ tar -jxvf Python-2.7.13.tar.xz
./configure make all make install make clean make distclean
4、建立python2.7 软链
mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python2.7
ln -s /usr/bin/python2.7 /usr/bin/python
5、解决yum无法使用的问题
vi /usr/bin/yum ---------------------------------------------------- #!/usr/bin/python import sys try: import yum except ImportError: .......
修改为
#!/usr/bin/python2.6 ........
6、安装python-pip工具
tar zxvf pip-9.0.1.tar.gz cd pip-9.0.1 python setup.py install
ln -s /usr/local/python2.7/bin/pip /usr/bin/pip
如果软链不存在,可能pip已经被安装到/usr/local/bin/pip,以ln -s /usr/local/bin/pip /usr/bin/pip 这种方式建立软链
二、安装必要的软件
yum install -yDjangodjango-taggingfontconfigcairo python-devel python-memcachedpython-twistedpycairomod_pythonpython-ldappython-simplejson memcached python-zope-interface mod_wsgi python-sqlite2 python-djangopython-twistedpython-cairopython-pippython-django-taggingpython-devlibffi-dev python-devel
三、安装3大组件
3、安装graphite的3大组件
sudopipinstallwhisper
sudopipinstallcarbon
sudopipinstallgraphite-web
安装完成后会在/opt/目录下生成一个graphite的文件夹,里面内容如下:
4、配置
cd/opt/graphite/conf
sudocpcarbon.conf.examplecarbon.conf
sudocpstorage-schemas.conf.examplestorage-schemas.conf
sudocpgraphite.wsgi.examplegraphite.wsgi
cd /opt/graphite/webapp/graphite
修改时区为上海
6、初始化graphite数据库
PYTHONPATH=/opt/graphite/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb
cd /opt/graphite/storage
7、安装statsd(安装到/opt/graphite目录下)
cd /opt/graphite
下载statsd:git clonehttps://github.com/etsy/statsd.git
cdstatsd
cpexampleConfig.jsconfig.js
vi config.js【需要修改graphiteHost】
{graphitePort:2003,graphiteHost:"localhost",port:8125,debug:true} |
8、安装grafana
cd /opt
wgethttps://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-3.0.4-1464167696.linux-x64.tar.gz
tar -xvfgrafana-3.0.4-1464167696.linux-x64.tar.gz
mv grafana-3.0.4-1464167696 grafana
cdgrafana/bin
nohup ./grafana-server start &
默认grafana使用3000端口,但是也可以进行修改,vim conf/default.ini 修改http_port = 9191
9、上传启动运行脚本
cd /opt/graphite
sudo mkdir pids
10、运行restart.sh
默认graphite的端口为8999
欢迎转载,请注明来源:http://www.16boke.com/article/detail/205