Skip to content

Commit

Permalink
Update and simplify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr1212 committed Feb 2, 2019
1 parent 755b117 commit fc15b43
Show file tree
Hide file tree
Showing 14 changed files with 212 additions and 379 deletions.
1 change: 0 additions & 1 deletion conf/graphite.wsgi.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import sys
# In case of multi-instance graphite, uncomment and set appropriate name
# import os
# os.environ['GRAPHITE_SETTINGS_MODULE'] = 'graphite.local_settings'
sys.path.append('/opt/graphite/webapp')

from graphite.wsgi import application
13 changes: 0 additions & 13 deletions docs/admin-carbon.rst

This file was deleted.

19 changes: 0 additions & 19 deletions docs/admin-webapp.rst

This file was deleted.

26 changes: 26 additions & 0 deletions docs/carbon-daemons.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,32 @@ the data once they receive it. This document gives a brief overview of what each
does and how you can use them to build a more sophisticated storage backend.


Starting and stopping Carbon
----------------------------

To start the Carbon daemons run:

.. code-block:: bash
carbon-cache.py start
carbon-relay.py start
carbon-aggregator.py start
carbon-aggregator-cache.py start
.. note:: If you are using Virtualenv you must specify the full path
``/opt/graphite/bin/carbon-cache.py start``

To stop the daemons replace ``start`` with ``stop``.


Logs
----

If installed in the :ref:`default location <default-installation-layout>` then the
Carbon daemons write their logs to ``/opt/graphite/storage/log/``.


carbon-cache.py
---------------

Expand Down
21 changes: 11 additions & 10 deletions docs/config-database-setup.rst → docs/config-webapp-setup.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Webapp Database Setup
=====================
Webapp Setup
============

Before Graphite-web can be started the database needs to be initialized and the static files need to be collected.

Database Setup
--------------

You must tell Django to create the database tables used by the graphite webapp. This is very straight forward, especially if you are using the default SQLite setup.

The following configures the Django database settings. Graphite uses the database for storing user profiles, dashboards, and for the Events functionality. Graphite uses an SQLite database file located at ``STORAGE_DIR/graphite.db`` by default. If running multiple Graphite-web instances, a database such as PostgreSQL or MySQL is required so that all instances may share the same data source.

.. note ::
As of Django 1.2, the database configuration is specified by the DATABASES
dictionary instead of the old ``DATABASE_*`` format. Users must use the new
specification to have a working database.
See the
`Django documentation <https://docs.djangoproject.com/en/dev/ref/settings/#databases>`_
for full documentation of the DATABASES setting.
Expand All @@ -20,18 +21,18 @@ To set up a new database and create the initial schema, run:

.. code-block:: none
PYTHONPATH=$GRAPHITE_ROOT/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb
django-admin.py migrate --settings=graphite.settings --run-syncdb
If you are experiencing problems, uncomment the following line in /opt/graphite/webapp/graphite/local_settings.py:

.. code-block:: none
# DEBUG = True
and review your webapp logs. If you're using the default graphite-example-vhost.conf, your logs will be found in /opt/graphite/storage/log/webapp/.

If you're using the default SQLite database, your webserver will need permissions to read and write to the database file. So, for example, if your webapp is running in Apache as the 'nobody' user, you will need to fix the permissions like this:

.. code-block:: none
sudo chown nobody:nobody /opt/graphite/storage/graphite.db
76 changes: 54 additions & 22 deletions docs/config-webapp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,53 @@ On Debian-based systems, run:
sudo apt install gunicorn
Next, you will have to create a configuration to start Graphite.
If your system is using Systemd create following unit files:

``/etc/systemd/system/graphite-web.socket``:

.. code-block:: none
[Unit]
Description=Graphite-web socket
[Socket]
ListenStream=/run/graphite-web.sock
ListenStream=127.0.0.1:8080
[Install]
WantedBy=sockets.target
``/etc/systemd/system/graphite-web.service``:

.. code-block:: none
[Unit]
Description=Graphite-web service
Requires=graphite-web.socket
[Service]
ExecStart=/usr/bin/gunicorn -w2 graphite.wsgi -b 127.0.0.1:8080
# If you are using virtualenv specify the path to gunicorn in virtualenv.
# ExecStart=/opt/graphite/bin/gunicorn -w2 graphite.wsgi -b 127.0.0.1:8080
Restart=on-failure
#User=graphite
#Group=graphite
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Reload the systemd configuration, the service is socket activated so no need to start it manually.

.. code-block:: none
systemctl daemon-reload
Install nginx
^^^^^^^^^^^^^

Expand All @@ -40,9 +87,6 @@ On Debian-based systems, run:
sudo apt install nginx
Configure nginx
^^^^^^^^^^^^^^^

We will use dedicated log files for nginx when serving Graphite:

.. code-block:: none
Expand Down Expand Up @@ -74,12 +118,6 @@ Write the following configuration in ``/etc/nginx/sites-available/graphite``:
return 204;
}
# serve static content from the "content" directory
location /static {
alias /opt/graphite/webapp/content;
expires max;
}
location / {
try_files $uri @graphite;
}
Expand Down Expand Up @@ -144,6 +182,9 @@ Finally, configure the apache vhost. (You can find example of Graphite vhost con
LoadModule wsgi_module modules/mod_wsgi.so
# Set WSGIPythonHome when using virtualenv
# WSGIPythonHome /opt/graphite
WSGISocketPrefix /var/run/wsgi
Listen 80
Expand All @@ -161,18 +202,6 @@ Finally, configure the apache vhost. (You can find example of Graphite vhost con
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
Expand All @@ -184,6 +213,9 @@ Finally, configure the apache vhost. (You can find example of Graphite vhost con
</Directory>
</VirtualHost>
.. note:: You have to configure ``WSGIPythonHome`` if you are using Virtualenv

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
Expand Down Expand Up @@ -272,7 +304,7 @@ Enable the vhost and restart nginx:
Acnowlegments
------------_
-------------

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

Expand Down
4 changes: 2 additions & 2 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Graphite-web accepts contributions on `GitHub
<https://github.com/graphite-project/graphite-web>`_, in the form of issues or
pull requests. If you're comfortable with Python, here is how to get started.

First, keep in mind that Graphite-web supports Python versions **2.6 to 2.7**
and Django versions **1.4 and above**.
First, keep in mind that Graphite-web supports Python versions **2.7 and above**
and Django versions **1.8 and above**.

Setting up a development environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 3 additions & 3 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FAQ

What is Graphite?
-----------------
Graphite is a highly scalable real-time graphing system. As a user, you write an application that collects numeric time-series data that you are interested in graphing, and send it to Graphite's processing backend, :doc:`carbon </carbon-daemons>`, which stores the data in Graphite's specialized database. The data can then be visualized through graphite's web interfaces.
Graphite is a highly scalable real-time graphing system. As a user, you write an application that collects numeric time-series data that you are interested in graphing, and send it to Graphite's processing backend, :doc:`carbon </carbon-daemons>`, which stores the data in Graphite's specialized database. The data can then be visualized through Graphite's web interfaces.


Who should use Graphite?
Expand Down Expand Up @@ -35,7 +35,7 @@ Graphite was internally developed by `Orbitz`_ where it is used to visualize a v

What is Graphite written in?
----------------------------
Python2. The Graphite webapp is built on the `Django`_ web framework and uses the ExtJS javascript GUI toolkit. The graph rendering is done using the Cairo graphics library. The backend and database are written in pure Python.
Python. The Graphite webapp is built on the `Django`_ web framework and uses the ExtJS javascript GUI toolkit. The graph rendering is done using the Cairo graphics library. The backend and database are written in pure Python.


Who writes and maintains Graphite?
Expand Down Expand Up @@ -76,7 +76,7 @@ Is there a diagram of Graphite's architecture?
----------------------------------------------
There sure is! Here it is:

.. image:: ../webapp/content/img/overview.png
.. image:: ../webapp/graphite/static/img/overview.png


.. _Django: http://www.djangoproject.com/
Expand Down
2 changes: 0 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ Graphite Documentation
carbon-daemons
config-carbon
feeding-carbon
admin-carbon
config-local-settings
config-webapp
admin-webapp
composer
render_api
functions
Expand Down
77 changes: 0 additions & 77 deletions docs/install-pip.rst

This file was deleted.

Loading

0 comments on commit fc15b43

Please sign in to comment.