Graphite is a highly scalable real-time graphing system that can be used to gather various system information and display it in an intuitive web interface. Graphite is also free and open source software.
This tutorial will cover the process of installing Graphite on a CentOS 7 Server instance.
In order for Graphite to install and function, a set of packages must be installed on the server. However, these packages are not available in the CentOS default yum repository. Vultr instances come with the EPEL repository enabled by default, but if you're installing this elsewhere you will need to install it via:
sudo yum install -y http://epel.mirror.constant.com/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Next, install the requires packages for Graphite as follows:
sudo yum install -y graphite-web python-carbon
Next, we will need to modify storage schema file. The values in this file will instruct
Carbon on how long to store values.
sudo nano /opt/graphite/conf/storage-schemas.conf
Add the following lines:
[default] pattern = .* retentions = 12s:4h, 2m:3d, 5m:8d, 13m:32d, 1h:1y
Save the file and start
Carbon using the following command:
sudo systemctl enable carbon-cache sudo systemctl start carbon-cache
Next, change the
SECRET_KEY values in
Once you are done, run the database setup script using following command:
PYTHONPATH=/usr/share/graphite/webapp django-admin syncdb --settings=graphite.settings
First, remove the default index page from apache:
echo > /etc/httpd/conf.d/welcome.conf
Next, edit /etc/httpd/conf.d/graphite-web.conf and replace everything in the 'Directory "/usr/share/graphite/"' block with:
Require all granted Order allow,deny Allow from all
Assign the proper permissions to the Graphite directory:
sudo chown apache:apache /var/lib/graphite-web/graphite.db
And work around a bug related to building indexs with:
Start Apache and enable auto-start:
sudo systemctl start httpd sudo systemctl enable httpd
You may need to enable port 80 in
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --reload
You can now access Graphite in your web browser by visiting your server’s IP address.