Dashboard Pipeline Setup » History » Version 17

J. Wienke, 06/29/2015 10:58 AM

1 3 J. Wienke
h1. Dashboard Pipeline Setup
2 3 J. Wienke
3 3 J. Wienke
{{>toc}}
4 1 J. Wienke
5 4 J. Wienke
h2. Deployment Decisions
6 4 J. Wienke
7 4 J. Wienke
There are currently two supported backends for storing timeseries data which can be visualized by the grafana dashboard:
8 4 J. Wienke
# "InfluxDB":https://influxdb.com/: More modern timeseries database with well-structured query language
9 4 J. Wienke
# "Graphite":https://graphite.readthedocs.org/en/latest/: Well-known monitoring database and web-frontend. Less structured query language and harder to deploy
10 4 J. Wienke
11 4 J. Wienke
While InfluxDB provides the much more modern experience and is easier to administer, graphite currently provides better performance with less CPU impact and better control of automatic retention. Depending on your needs, decide on one of the solutions.
12 4 J. Wienke
13 1 J. Wienke
h2. Installation of Required Software
14 1 J. Wienke
15 1 J. Wienke
# Install rsb, rst
16 1 J. Wienke
# Install rsb-performance-monitor
17 1 J. Wienke
# Install rsb-performance-monitor-graphite-adapter (git in this project)
18 5 J. Wienke
# Install a timeseries database:
19 5 J. Wienke
#* InfluxDB: version 0.8! as DEB archive or citk
20 5 J. Wienke
#* Graphite: See https://graphite.readthedocs.org/en/latest/install.html or citk
21 5 J. Wienke
# Install grafana version 2 (just extract the pre-built archive somewhere, or citk)
22 1 J. Wienke
23 5 J. Wienke
h2. Backend Configuration
24 1 J. Wienke
25 5 J. Wienke
For both backend solutions you need to decide on a retention policy, that means how long data will be kept in the database.  This decides on the storage requirements of your database files and the possibility to scroll back in time in the dashboard.
26 1 J. Wienke
27 5 J. Wienke
h3. InfluxDB
28 5 J. Wienke
29 5 J. Wienke
# Configure InfluxDB as desired using the example config files and the instructions found here: https://influxdb.com/docs/v0.8/introduction/installation.html. A config file which uses just a local computer and /tmp for data is attached. Please note that in this file the @assets@ line in the @admin@ section needs to be fixed so that it point to the installation of the required files for the admin web interface.
30 7 J. Wienke
# Start the database server, e.g. using
31 7 J. Wienke
  <pre>
32 7 J. Wienke
$prefix/opt/influxdb/influxdb -config=$prefix/etc/vdemo_scripts/data/influxdb-config-tmp.toml
33 8 J. Wienke
</pre>
34 5 J. Wienke
# Using the web interface (http://host:8083 per default), create a database for the monitoring data. The retention for the proposed default shard space should be set to the desired time you plan to keep data available in the database (E.g. 7d). Duration should probably be set to 1d.
35 1 J. Wienke
36 17 J. Wienke
h2. Grafana Configuration
37 17 J. Wienke
38 17 J. Wienke
Create an ini file to configure the grafana server. An example is attached: attachment:grafana-config.ini. You can place this file anywhere.
39 17 J. Wienke
40 9 J. Wienke
h3. Graphite
41 9 J. Wienke
42 9 J. Wienke
Unfortunately, graphite configuration is a bit harder than for InfluxDB. Basically, you need to follow the instructions given here: https://graphite.readthedocs.org/en/latest/install.html#initial-configuration. The steps are:
43 9 J. Wienke
# Configure the carbon daemon, which accepts new data via HTTP and pushes them into the timeseries database.
44 9 J. Wienke
## Create a @carbon.conf@ file and adapt as required. The comments about all data directories decending from @STORAGE_DIR@ are misleading. This is only true for the defaults. In case you want to move your data, you need to set all of these directories explicitly. An exemplary configuration is attached: attachment:carbon.conf. The file needs to be placed in the @conf@ directory of your installation root.
45 13 J. Wienke
## Create a @storage-schemas.conf@ file which defines the retention policies. The highest resolution needs to be >= the intended reporting speed of data. Otherwise you will end up with null values in the database. An example is attached: attachment:"storage-schemas.conf". The file needs to be placed in the @conf@ directory of your installation root.
46 15 J. Wienke
# Configure the web application
47 15 J. Wienke
## Create a @local_settings.py@. The @STORAGE_DIR@ variable needs to match the value that has been used for carbon. Otherwise, the webapp won't find the database. An example is attached: attachment:local_settings.py. This file needs to be placed in the @webapp/graphite@ directory of your installation. In case you do not want to set up a custom webserver, it is important to set @DEBUG = True@.
48 15 J. Wienke
## Collect static webapp files to be served by the wbeserver:
49 15 J. Wienke
<pre>
50 15 J. Wienke
export PYTHONPATH=$GRAPHITE_ROOT/webapp:$PYTHONPATH
51 15 J. Wienke
django-admin.py collectstatic --noinput --settings=graphite.settings
52 15 J. Wienke
</pre>
53 15 J. Wienke
## Create a configuration database for django:
54 15 J. Wienke
<pre>
55 15 J. Wienke
PYTHONPATH=$GRAPHITE_ROOT/webapp django-admin.py syncdb --settings=graphite.settings
56 15 J. Wienke
</pre>
57 9 J. Wienke
58 1 J. Wienke
h2. Startup
59 1 J. Wienke
60 16 J. Wienke
# Start the backend:
61 16 J. Wienke
#* Influxdb: as described before
62 16 J. Wienke
#* Graphite:
63 16 J. Wienke
#*# Start carbon: @$GRAPHITE_ROOT/bin/carbon-cache.py --nodaemon@
64 16 J. Wienke
#*# Start the webapp: @$GRAPHITE_ROOT/bin/run-graphite-devel-server.py --port=XXXX@
65 16 J. Wienke
## Start some @rsb-process-monitor@ and @rsb-node-monitor@ instances, assuming that monitoring results will be published on @/monitoring@ and @/host@
66 16 J. Wienke
# Start @rsbperfmon-db-adapter -a -d -b {graphite|influxdb}@ and pass additional arguments required to match your backend configuration.
67 2 J. Wienke
# Start the grafana dashboard server: @$GRAFANA_PREFIX/bin/grafana-server -config=your-config.ini -homepath=$GRAFANA_PREFIX@
68 1 J. Wienke
69 17 J. Wienke
h2. Initial Grafana Online Configuration
70 1 J. Wienke
71 17 J. Wienke
At first start, you need to perform a few steps in grafana:
72 17 J. Wienke
73 1 J. Wienke
# Open the grafana webpage at http://localhost:8020
74 17 J. Wienke
# On the left side, log in as admin (default: admin:admin)
75 17 J. Wienke
# In the left menu, select "Data Sources" -> "Add new"
76 17 J. Wienke
# Add a data source matching your selected backend. For Graphite, the given port is the one used to start the devel server.
77 17 J. Wienke
# Go to "Dashboards"
78 17 J. Wienke
# In the "Home" dropdown menu at the top, select import and import the appropriate dashboards provided in a git repository in this project.
79 1 J. Wienke
80 17 J. Wienke
h2. Usage
81 1 J. Wienke
82 17 J. Wienke
# Open the grafana webpage at http://localhost:8020