Skip to content

Commit

Permalink
Merge pull request #2201 from deniszh/DZ-Deploy
Browse files Browse the repository at this point in the history
Documentation fixes
  • Loading branch information
deniszh committed Jan 14, 2018
2 parents 419a926 + bdcea94 commit ded6a2d
Show file tree
Hide file tree
Showing 2 changed files with 187 additions and 12 deletions.
152 changes: 150 additions & 2 deletions docs/config-webapp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Configuring The Webapp

There are multiple ways to expose the Graphite webapp. The following stack configurations exist:

* Apache + mod_wsgi
* nginx + gunicorn
* Apache + mod_wsgi
* nginx + uWSGI

Depending on the configuration you choose, the webapp configuration is slightly different.
Expand Down Expand Up @@ -116,12 +116,160 @@ Reload nginx to use the new configuration:
Apache + mod_wsgi
-----------------

First, you need to install mod_wsgi.

See the `mod_wsgi InstallationInstructions`_ for installation instructions.

.. _mod_wsgi InstallationInstructions: https://code.google.com/p/modwsgi/wiki/InstallationInstructions

Then create the graphite.wsgi. (You can find example of graphite.wsgi file on the `conf`_ directory of source ditribution):

.. _conf: https://github.com/graphite-project/graphite-web/blob/master/conf/graphite.wsgi.example

.. code-block:: bash
# /opt/graphite/conf/graphite.wsgi
import sys
sys.path.append('/opt/graphite/webapp')
from graphite.wsgi import application
Finally, configure the apache vhost. (You can find example of Graphite vhost configuration in the `contrib`_ directory of source ditribution):

.. _contrib: https://github.com/graphite-project/graphite-web/blob/master/examples/example-graphite-vhost.conf

.. code-block:: apache
# /etc/httpd/conf.d/graphite-vhost.conf
LoadModule wsgi_module modules/mod_wsgi.so
WSGISocketPrefix /var/run/wsgi
Listen 80
<VirtualHost *:80>
ServerName graphite
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
CustomLog /opt/graphite/storage/log/webapp/access.log common
WSGIDaemonProcess graphite-web processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
WSGIProcessGroup graphite-web
WSGIApplicationGroup %{GLOBAL}
WSGIImportScript /opt/graphite/conf/graphite.wsgi process-group=graphite-api application-group=%{GLOBAL}
WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi
Alias /static/ /opt/graphite/static/
<Directory /opt/graphite/static/>
<IfVersion < 2.4>
Order deny,allow
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
<Directory /opt/graphite/conf/>
<IfVersion < 2.4>
Order deny,allow
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
Adapt the mod_wsgi configuration to your requirements.

See the `mod_wsgi QuickConfigurationGuide`_ for an overview of configurations and `mod_wsgi ConfigurationDirectives`_ to see all configuration directives

.. _mod_wsgi QuickConfigurationGuide: https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

.. _mod_wsgi ConfigurationDirectives: https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives

Restart apache::

$ service httpd restart


Running the webapp with mod_wsgi as URL-prefixed application (Apache)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When using the new ``URL_PREFIX`` parameter in ``local_settings.py`` the
``WSGIScriptAlias`` setting must look like the following (e.g. URL_PREFIX="/graphite")::

WSGIScriptAlias /graphite /srv/graphite-web/conf/graphite.wsgi/graphite
WSGIScriptAlias /graphite /opt/graphite/conf/graphite.wsgi/graphite

The /graphite is needed for Django to create the correct URLs


Nginx + uWSGI
-------------

First, you need to install uWSGI with Python support. On Debian, install ``uwsgi-plugin-python``.

Then create the uWSGI file for Graphite-web in
``/etc/uwsgi/apps-available/graphite.ini``:

.. code-block:: ini
[uwsgi]
processes = 2
socket = localhost:8080
gid = www-data
uid = www-data
virtualenv = /opt/graphite
chdir = /opt/graphite/conf
module = wsgi:application
Then create the file ``wsgi.py``:

.. code-block:: bash
# /opt/graphite/conf/wsgi.py
import sys
sys.path.append('/opt/graphite/webapp')
from graphite.wsgi import application
Enable ``graphite.ini`` and restart uWSGI:

.. code-block:: bash
$ ln -s /etc/uwsgi/apps-available/graphite.ini /etc/uwsgi/apps-enabled
$ service uwsgi restart
Finally, configure the nginx vhost:

.. code-block:: nginx
# /etc/nginx/sites-available/graphite.conf
server {
listen 80;
location / {
include uwsgi_params;
uwsgi_pass localhost:8080;
}
}
Enable the vhost and restart nginx:

.. code-block:: bash
$ ln -s /etc/nginx/sites-available/graphite.conf /etc/nginx/sites-enabled
$ service nginx restart
Acnowlegments
------------_

Portions of that manual are based on `Graphite-API deployment manual`_.

.. _Graphite-API deployment manual: https://github.com/brutasse/graphite-api/blob/master/docs/deployment.rst
47 changes: 37 additions & 10 deletions docs/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Collection
`SSC Serv`_
A Windows service (agent) which periodically publishes system metrics, for example CPU, memory and disk usage. It can store data in Graphite using a naming schema that's identical to that used by collectd.

`telegraf`_
Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics. It also supports metric output to Graphite.

Forwarding
----------
Expand Down Expand Up @@ -242,28 +244,43 @@ Storage Backend Alternates
If you wish to use a backend to graphite other than Whisper, there are some options available to you.

`BigGraphite`_
A time-series database written in Python on top of Cassandra.
A time-series database written in Python on top of Cassandra. It integrates with Graphite as a plugin.

`carbon-clickhouse`_
Graphite metrics receiver with `ClickHouse`_ as storage. You will also need `graphite-clickhouse`_ as backend for Graphite-web.

`cassabon`_
Carbon daemon using Cassandra as the backend, implemented in Go. It also acts as an API for Graphite (using the `Cyanite`_ reader) to retrieve the stats to display.

`Ceres`_
An alternate storage backend provided by the Graphite Project. It it intended to be a distributable time-series database. It is currently in a pre-release status.

`Cyanite`_
A highly available, elastic, and low-latency time-series storage wirtten on top of Cassandra

`InfluxDB`_
A distributed time series database.
`graphite-clickhouse`_
Graphite-web backend with `ClickHouse`_ support. Please also see `carbon-clickhouse`_.

`go-carbon`_
Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister.

`KairosDB`_
A distributed time-series database written on top of Cassandra.
`influxgraph`_
Graphite `InfluxDB`_ backend. `InfluxDB`_ storage finder / plugin for Graphite API.

`OpenTSDB`_
A distributed time-series database written on top of HBase.
`Kenshin`_
A time-series database alternative to Graphite Whisper with 40x improvement in IOPS. It integrates with Graphite as a plugin.

`metrictank`_
Cassandra-backed, metrics2.0 based, multi-tenant timeseries database for Graphite and friends.

Other
-----
`bosun`_
Time Series Alerting Framework. Can use Graphite as time series source.

`carbonapi`_
3rd party reimplementation of graphite-web in Go, which supports a significant subset of graphite functions. In some testing it has shown to be 5x-10x faster than requesting data from graphite-web.

`Bryans-Graphite-Tools`_
A collection of miscellaneous scripts for pulling data from various devices, F5, Infoblox, Nutanix, etc.

Expand All @@ -273,8 +290,8 @@ Other
`carbonate`_
Utilities for managing graphite clusters.

`go-carbon`_
Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister.
`graphite-remote-adapter`_
Fully featured graphite remote adapter for `Prometheus`_.

`riemann`_
A network event stream processing system, in Clojure. Can use Graphite as source of event stream.
Expand All @@ -293,9 +310,13 @@ Other
.. _buckytools: https://github.com/jjneely/buckytools
.. _Cabot: https://github.com/arachnys/cabot
.. _carbon-c-relay: https://github.com/grobian/carbon-c-relay
.. _carbon-clickhouse: https://github.com/lomik/carbon-clickhouse
.. _carbon-relay-ng: https://github.com/graphite-ng/carbon-relay-ng
.. _carbonapi: https://github.com/go-graphite/carbonapi
.. _carbonate: https://github.com/graphite-project/carbonate
.. _cassabon: https://github.com/jeffpierce/cassabon
.. _Ceres: https://github.com/graphite-project/ceres
.. _ClickHouse: https://clickhouse.yandex
.. _Charcoal: https://github.com/cebailey59/charcoal
.. _collectd: http://collectd.org
.. _collectd-carbon: https://github.com/indygreg/collectd-carbon
Expand All @@ -319,9 +340,11 @@ Other
.. _Graphene: http://jondot.github.com/graphene
.. _Graphios: https://github.com/shawn-sterling/graphios
.. _graphite-beacon: https://github.com/klen/graphite-beacon
.. _graphite-clickhouse: https://github.com/lomik/graphite-clickhouse
.. _graphite-dashboardcli: https://github.com/blacked/graphite-dashboardcli
.. _Graphite-Newrelic: https://github.com/gingerlime/graphite-newrelic
.. _Graphite-relay: https://github.com/markchadwick/graphite-relay
.. _graphite-remote-adapter: https://github.com/criteo/graphite-remote-adapter
.. _Graphite-Tattle: https://github.com/wayfair/Graphite-Tattle
.. _graphite-to-zabbix: https://github.com/blacked/graphite-to-zabbix
.. _Graphiti: https://github.com/paperlesspost/graphiti
Expand All @@ -338,21 +361,24 @@ Other
.. _Hubot: https://github.com/github/hubot
.. _hubot-scripts: https://github.com/github/hubot-scripts
.. _InfluxDB: https://influxdb.com/
.. _influxgraph: https://github.com/InfluxGraph/influxgraph
.. _Icinga: http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/icinga2-features#graphite-carbon-cache-writer
.. _jmx2graphite: https://github.com/logzio/jmx2graphite
.. _jmxtrans: https://github.com/jmxtrans/jmxtrans
.. _KairosDB: http://kairosdb.github.io/
.. _Kenshin: https://github.com/douban/Kenshin
.. _Ledbetter: https://github.com/github/ledbetter
.. _Leonardo: https://github.com/PrFalken/leonardo
.. _Logster: https://github.com/etsy/logster
.. _OpenTSDB: http://opentsdb.net/
.. _Orion: https://github.com/gree/Orion
.. _metrics-sampler: https://github.com/dimovelev/metrics-sampler
.. _metrictank: https://github.com/grafana/metrictank
.. _Moira: http://moira.readthedocs.io
.. _New Relic: https://newrelic.com/platform
.. _Pencil: https://github.com/fetep/pencil
.. _pipe-to-graphite: https://github.com/iFixit/pipe-to-graphite
.. _Polymur: https://github.com/jamiealquiza/polymur
.. _Prometheus: https://github.com/prometheus/prometheus
.. _RabbitMQ: http://www.rabbitmq.com
.. _rearview: http://github.com/livingsocial/rearview
.. _Rickshaw: http://code.shutterstock.com/rickshaw
Expand All @@ -367,6 +393,7 @@ Other
.. _statsd: https://github.com/etsy/statsd
.. _Tasseo: https://github.com/obfuscurity/tasseo
.. _Targets-io: https://github.com/dmoll1974/targets-io
.. _telegraf: https://github.com/influxdata/telegraf
.. _Terphite: https://github.com/benwtr/terphite
.. _Tessera: https://github.com/urbanairship/tessera
.. _Therry: https://github.com/obfuscurity/therry
Expand Down

0 comments on commit ded6a2d

Please sign in to comment.