Saturday, July 4, 2015

Install Graphite with Python 2.6.6 on CentOS 6.6

If you don't have pip, install it as follows:

sudo yum install python-pip

# Install Django
sudo pip install 'https://www.djangoproject.com/download/1.4.20/tarball/'

# Install django-tagging
sudo easy_install django-tagging==0.3.1

# Install Twisted
sudo pip install twisted

# Install pytz
sudo pip install pytz

# Install bitmap-fonts-compat
sudo yum install bitmap-fonts-compat

# Install Apache
sudo yum install httpd

# Install mod_wsgi
sudo yum install mod_wsgi

sudo vi /etc/httpd/conf.d/wsgi.conf

#LoadModule wsgi_module modules/mod_wsgi.so

# Install Graphite
sudo pip install https://github.com/graphite-project/ceres/tarball/master
sudo pip install whisper
sudo pip install carbon
sudo pip install graphite-web

# Configure Carbon
cd /opt/graphite/conf
sudo cp carbon.conf.example carbon.conf
sudo cp storage-schemas.conf.example storage-schemas.conf

# Run Carbon
sudo /opt/graphite/bin/carbon-cache.py start

tail -F /opt/graphite/storage/log/carbon-cache/carbon-cache-a/console.log

# Test Carbon
echo "local.random.diceroll 4 `date +%s`" | nc localhost 2003

tail -F /opt/graphite/storage/log/carbon-cache/carbon-cache-a/creates.log

05/07/2015 14:22:22 :: new metric local.random.diceroll matched schema default_1min_for_1day
05/07/2015 14:22:22 :: new metric local.random.diceroll matched aggregation schema default
05/07/2015 14:22:22 :: creating database file /opt/graphite/storage/whisper/local/random/diceroll.wsp (archive=[(60, 1440)] xff=None agg=None)

# Configure Graphite Webapp
sudo cp /opt/graphite/examples/example-graphite-vhost.conf /etc/httpd/conf.d/graphite.conf
sudo cp /opt/graphite/conf/graphite.wsgi.example /opt/graphite/conf/graphite.wsgi
sudo cp /opt/graphite/webapp/graphite/local_settings.py.example /opt/graphite/webapp/graphite/local_settings.py

sudo chown apache:apache /opt/graphite/storage/
sudo chown apache:apache /opt/graphite/storage/log/webapp/

sudo python /opt/graphite/webapp/graphite/manage.py syncdb

# Start Apache
sudo /sbin/service httpd start

tail -F /opt/graphite/storage/log/webapp/error.log

# Visit Graphite Webapp Using Web Browser
http://your-ip-address/

References:
http://graphite.readthedocs.org/en/latest/install.html
http://graphite.readthedocs.org/en/latest/install-pip.html
http://graphite.readthedocs.org/en/latest/config-carbon.html
http://graphite.readthedocs.org/en/latest/admin-carbon.html
https://gist.github.com/ashrithr/9224450

No comments:

Post a Comment