Skip to content

Commit a36fda8

Browse files
committed
Merge pull request echocat#258 from echocat/develop
backmerge for release 6.0.0
2 parents 75320ca + 3c6e487 commit a36fda8

29 files changed

+1273
-681
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## 2016-03-30 - 6.0.0 (Major release)
2+
3+
#### Features:
4+
5+
- Nginx/Gunicorn is now fully supported on both Debian and RedHat-like systems
6+
- The correct username/group is now used across apache/nginx for both Debian and RedHat
7+
- Pip is now the default provider for Django to ensure mutually-working package versions are installed.
8+
- Added systemd scripts for when `$service_provider == 'systemd'`
9+
- Added workaround for [race condition bug in graphite](graphite-project/graphite-web#403)
10+
- Added configuration variable `gr_web_server_remove_default` -- default config is only wiped when the variable is true, or when it is `undef` and `gr_web_server_port` == 80
11+
- Renamed `gr_apache_port` and `gr_apache_port_https` to `gr_web_server_port` and `gr_web_server_port` respectively. If the old configuration values are used, puppet fails telling you to use the new ones.
12+
- Add param for carbon-relay init.d ulimit `gr_carbon_relay_ulimit`
13+
- Add support for custom directory locations , see `gr_base_dir` and `gr_*_dir`
14+
- Add `gr_relay_diverse_replicas` option, default to true
15+
16+
#### Bugfixes:
17+
18+
- python-crypto is obsoleted on RHEL7, replaced by python2-crypto
19+
- Redhat: avoid raise condition on initd restart
20+
121
## 2016-01-29 - 5.16.1 (Bugfix release)
222

323
#### Bugfixes:

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ gem 'puppetlabs_spec_helper', '>= 0.1.0'
77
gem 'puppet-lint', '>= 0.3.2'
88
gem 'facter', facterversion
99
gem 'rspec', '< 3.2.0'
10+
# rubi <1.9 versus rake 11.0.0 workaround
11+
gem 'rake', '< 11.0.0'

README.md

Lines changed: 87 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
This module installs and makes basic configs for graphite, with carbon and whisper.
2323

24+
[![Puppet Forge](http://img.shields.io/puppetforge/v/dwerder/graphite.svg)](https://forge.puppetlabs.com/dwerder/graphite)
25+
[![Build Status](https://secure.travis-ci.org/echocat/puppet-graphite.png?branch=master)](https://travis-ci.org/echocat/puppet-graphite)
26+
[![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/dwerder/graphite.svg)](https://forge.puppetlabs.com/dwerder/graphite)
27+
2428
##Module Description
2529

2630
[Graphite](http://graphite.readthedocs.org/en/latest/overview.html), and its components Carbon and Whisper, is an enterprise-scale monitoring tool. This module sets up a simple graphite server with all its components. Furthermore it can be used to set up more complex graphite environments with metric aggregation, clustering and so on.
@@ -195,9 +199,9 @@ ones set for the principal instance.
195199
```puppet
196200
class {'graphite':
197201
gr_line_receiver_port => 2003,
198-
gr_pickle_receiver_port => 2004,
202+
gr_pickle_receiver_port => 2004,
199203
gr_cache_query_port => 7002,
200-
204+
201205
gr_cache_instances => {
202206
'cache:b' => {
203207
'LINE_RECEIVER_PORT' => 2103,
@@ -216,8 +220,8 @@ ones set for the principal instance.
216220
So in this case you would have 3 cache instances, the first one is `cache` (you can refer to it as `cache:a` too), `cache:b` and `cache:c`. cache:a will listen on ports 2003, 2004 and 7002 for line, pickle and query respectively. But, cache:b will do it on ports 2103, 2104, and 7102, and cache:c on 2203, 2204 and 7202. All other parameters from cache:a will be inherited by cache:b and c.
217221

218222
###Installing with something other than pip and specifying package names and versions
219-
If you need to install via something other pip, an internal apt repo with fpm converted packages for instance, you can set `gr_pip_install` to false.
220-
If you're doing this you'll most likely have to override the default package names and versions as well.
223+
If you need to install via something other than pip, an internal apt repo with fpm converted packages for instance, you can set `gr_pip_install` to false.
224+
If you're doing this you'll most likely have to override the default package names and versions as well.
221225
```puppet
222226
class { '::graphite':
223227
gr_pip_install => false,
@@ -298,6 +302,11 @@ The prefix to be applied to internal performance metrics. Defaults to 'carbon'.
298302

299303
Default is 60. Set the interval between sending internal performance metrics; affects all carbon daemons.
300304

305+
#####`gr_carbon_relay_ulimit`
306+
307+
Default is undef. Set the maximum number of file descriptors for
308+
carbon-relay process.
309+
301310
#####`gr_line_receiver_interface`
302311

303312
Default is '0.0.0.0' (string). Interface the line receiver listens.
@@ -358,13 +367,54 @@ Default is 7002. Self explaining.
358367

359368
Default is 'GMT' (string). Timezone for graphite to be used.
360369

370+
#####`gr_base_dir`
371+
372+
Default is '/opt/graphite'. Set base install location of Graphite. This forms the base location for installs, predominantly appropriate for pip installations. When not installing using pip a typical location for this may be '/opt/carbon'.
373+
374+
#####`gr_storage_dir`
375+
376+
Default is '${gr_base_dir}/storage'. Set location of base storage files. When not installing using pip a typical location for this may be '/opt/carbon'.
377+
361378
#####`gr_local_data_dir`
362379

363-
Default is '/opt/graphite/storage/whisper'. Set location of whisper files.
380+
Default is '${gr_storage_dir}/whisper'. Set location of whisper files.
364381

365382
#####`gr_rrd_dir`
366383

367-
Default is '/opt/graphite/storage/rrd'. Set location of rrd data files.
384+
Default is '${gr_storage_dir}/rrd'. Set location of rrd data files.
385+
386+
#####`gr_whitelists_dir`
387+
388+
Default is '${gr_storage_dir}/rrd'. Set location of whitelist configuration files.
389+
390+
#####`gr_carbon_conf_dir`
391+
392+
Default is '${gr_base_dir}/conf'. Set location of Carbon's configuration files. Most relevant when not using pip for installation. A typical location for this may be '/etc/carbon'.
393+
394+
#####`gr_carbon_log_dir`
395+
396+
Default is '${gr_storage_dir}/log/carbon-cache'. Set location of carbon cache log files.
397+
398+
#####`gr_graphiteweb_log_dir`
399+
400+
Default is '${gr_storage_dir}/log'. Set location of graphite web log files.
401+
402+
#####`gr_graphiteweb_conf_dir`
403+
404+
Default is '${gr_base_dir}/conf'. Set location of graphite web configuration.
405+
406+
#####`gr_graphiteweb_webapp_dir`
407+
408+
Default is '${gr_base_dir}/webapp'. Set location of graphite web's webapp files.
409+
410+
#####`gr_graphiteweb_storage_dir`
411+
412+
Default is '/var/lib/graphite-web'. Set location of graphite web's storage, used for graphite.db file.
413+
414+
#####`gr_graphiteweb_install_lib_dir`
415+
416+
Default is '${gr_graphiteweb_webapp_dir}/graphite'. Set location of libraries directory for graphite web.
417+
368418

369419
#####`gr_storage_schemas`
370420

@@ -400,7 +450,19 @@ The storage aggregation rules.
400450

401451
#####`gr_web_server`
402452

403-
Default is 'apache'. The web server to use. Valid values are 'apache', 'nginx', 'wsgionly' or 'none'. 'nginx' is only supported on Debian-like systems. And 'none' means that you will manage the webserver yourself.
453+
Default is 'apache'. The web server to configure. Valid values are 'apache', 'nginx', 'wsgionly' or 'none'.
454+
455+
Apache is configured with mod_wsgi, nginx is configured with gunicorn. 'wsgionly' configures only gunicorn.
456+
457+
The value 'none' means that you will manage the webserver yourself.
458+
459+
#####`gr_web_server_port`
460+
461+
Default is 80. The HTTP port which the web server will use. Only used for $gr_web_server => 'apache' or 'nginx'.
462+
463+
#####`gr_web_server_port_https`
464+
465+
Default is 443. The HTTPS port which the web server will use. Only used for $gr_web_server => 'apache'.
404466

405467
#####`gr_web_servername`
406468

@@ -429,19 +491,11 @@ Path to SSL dir containing keys and certs. Default is undef.
429491

430492
#####`gr_web_group`
431493

432-
Default is undef. Group name to chgrp the files that will served by webserver. Use only with gr_web_server => 'wsgionly' or 'none'.
494+
Group name to chgrp the files that will served by webserver. Only necessary for gr_web_server => 'wsgionly' or 'none'.
433495

434496
#####`gr_web_user`
435497

436-
Default is undef. Username to chown the files that will served by webserver. Use only with gr_web_server => 'wsgionly' or 'none'.
437-
438-
#####`gr_apache_port`
439-
440-
Default is 80. The HTTP port apache will use.
441-
442-
#####`gr_apache_port_https`
443-
444-
Default is 443. The HTTPS port apache will use.
498+
Username to chown the files that will served by webserver. Only necessary for gr_web_server => 'wsgionly' or 'none'.
445499

446500
#####`gr_apache_conf_template`
447501

@@ -537,6 +591,10 @@ Default is 'rules'
537591

538592
Default is 1 (integer). Add redundancy by replicating every datapoint to more than one machine.
539593

594+
#####`gr_relay_diverse_replicas`
595+
596+
Default is 'True' (string). Add to guarantee replicas across distributed hosts.
597+
540598
#####`gr_relay_destinations`
541599

542600
Default is [ '127.0.0.1:2004' ] (array). Array of backend carbons for relay.
@@ -724,7 +782,7 @@ Default is 30. value to pass to gunicorns --timeout arg.
724782
Default is 'unix:/var/run/graphite.sock'. value to pass to gunicorns --bind arg.
725783

726784
#####`gunicorn_workers`
727-
785+
728786
Default is 2. value to pass to gunicorn's --worker arg.
729787

730788
#####`gr_cache_instances`
@@ -865,7 +923,7 @@ On Redhat distributions you need the EPEL or RPMforge repository, because Graphi
865923

866924
##Limitations
867925

868-
This module is tested on CentOS 6.5 and Debian 7 (Wheezy) and should also run without problems on
926+
This module is tested on CentOS 6.5 and Debian 7 (Wheezy) and should also run on
869927

870928
* RHEL/CentOS/Scientific 6+
871929
* Debian 6+
@@ -874,8 +932,17 @@ This module is tested on CentOS 6.5 and Debian 7 (Wheezy) and should also run wi
874932
Most settings of Graphite can be set by parameters. So their can be special configurations for you. In this case you should edit
875933
the file `templates/opt/graphite/webapp/graphite/local_settings.py.erb`.
876934

877-
The nginx configs are only supported on Debian based systems at the moment.
935+
###Compatibility Notes
936+
* There is currently an [open ticket](https://tickets.puppetlabs.com/browse/PUP-3829) with Puppet about broken pip support in CentOS 6/7. The
937+
workaround for this bug is to create a symlink from `/usr/bin/pip-python` (which doesn't exist) to `/usr/bin/pip` (which does).
938+
* CentOS 7's default `nginx.conf` includes a `server` section listening on port 80. Thus, it is not possible to set up graphite without modifying
939+
the package-provided configuration file. You will have to either manually remove the `server` section, or provide a `gr_web_server_port` other
940+
than port 80.
941+
* nginx/gunicorn requires a `systemctl restart gunicorn` after installing on Ubuntu 15.10
942+
* SELinux must be disabled
878943

879944
##Contributing
880945

881946
Echocat modules are open projects. So if you want to make this module even better, you can contribute to this module on [Github](https://github.com/echocat/puppet-graphite).
947+
948+
Make sure to read the repository's `DEVELOP.md` file first.

files/fix-graphite-race-condition.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import sys
2+
sys.path.append('/opt/graphite/webapp')
3+
from django.contrib.auth.models import User
4+
from graphite.account.models import Profile
5+
from graphite.logger import log
6+
try:
7+
defaultUser = User.objects.get(username='default')
8+
except User.DoesNotExist:
9+
randomPassword = User.objects.make_random_password(length=16)
10+
defaultUser = User.objects.create_user('default','[email protected]',randomPassword)
11+
defaultUser.save()
12+
13+
try:
14+
defaultProfile = Profile.objects.get(user=defaultUser)
15+
except Profile.DoesNotExist:
16+
defaultProfile = Profile(user=defaultUser)
17+
defaultProfile.save()
18+

0 commit comments

Comments
 (0)