Fedora 4 comes with built-in profiling machinery that keeps track of how many times specific services have been requested, how long each request takes to be serviced, etc.
There are presently two ways of visualizing the output of this "metrics" collection.
This guide is designed to help you install and configure a Graphite instance. The directions below are based on the instructions provided by Graphite.
You will need the following software pre-installed:
- Apache HTTPD
- Python (2.6, 2.7)
- Django (1.6)
- Various Python modules
- json or simplejson
On a Debian system, the following commands should install the above.
Setup Whisper, Carbon and Graphite-web
Clone the GitHub repositories (use either the 0.9.x [stable] branch or master [unstable/alpha] branch).
On an Linux-based system, the following commands should get the correct branches of the three Graphite modules.
Your starting directory may look something like the following.
This installs to /opt/graphite by default.
Check for any fatal errors and resolve them, (ie. missing modules, libraries). There are 3 warnings that can be ignored (they are related to optional features).
This sets up a default data retention period of gathering data every second and storing it for 1 day. You can configure this by editing the storage-schemas.conf file.
There is an Apache Virtual Hosts file provided in the graphite-web/examples directory. You can use this to configure your Apache installation.
The following, minimal Apache vhost configuration file should be enough to get started
By default Graphite uses a sqlite3 database, but you can configure it to use a MySQL, Postgresql or Oracle database instead.
Then edit local_setttings.py, to uncomment:
- Logging section
- Optional: If you are NOT using a sqlite3 database, find the DATABASES variable, un-comment it and change the ENGINE parameter and add required parameters (username, password, hostname, port).
Create the database
- If you are using the default sqlite3 database, create an administrator <username> and <password> when prompted and then re-open local_settings.py, un-comment the DATABASES variable and add the administrator username/password to the DATABASES variable.
Set the permissions of the entire storage directory (default /opt/graphite/storage) and all files to be owned by the webserver process.
Start Data Collector
This starts the listener on localhost:2003, this can be configured in /opt/graphite/conf/carbon.conf.
If you receive the message:
'WHISPER_FALLOCATE_CREATE is enabled but linking failed.'
This can be disabled by setting
WHISPER_FALLOCATE_CREATE = False
in /opt/graphite/conf/carbon.conf but this will not harm the running process and does not need to be disabled.
If all is well then browsing to your webserver's homepage should look something like this.
To enable Metrics reporting to Graphite, activate the Spring profile metrics.graphite. The system properties fcrepo.metrics.host (defaults to localhost) and fcrepo.metrics.port (defaults to 2003) can also be set.
When testing with Maven use:
Once Fedora 4 is connected to your Graphite server, the Graphite console should resemble the following: