From 89d38770cebfdf537683c7a40ccc6c40ebd70e46 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Thu, 29 Sep 2016 01:14:19 +0800 Subject: Fix error in Gnocchi service * mount gnocchi volume for gnocchi-api and gnocchi-statsd * fix the failed of gnocchi-api * use gnocchi user when running gnocchi-upgrade * use the app.wsgi file in python path directly, rather than copy it to /var/www/cgi-bin/gnocchi/app file TrivialFix Change-Id: Ie026b8f44cd8e9703bf115cebb4e2d50b114a3a2 --- ansible/roles/gnocchi/tasks/start.yml | 2 ++ .../roles/gnocchi/templates/wsgi-gnocchi.conf.j2 | 24 ++++++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) (limited to 'ansible') diff --git a/ansible/roles/gnocchi/tasks/start.yml b/ansible/roles/gnocchi/tasks/start.yml index 98d54241c..d53ab979b 100644 --- a/ansible/roles/gnocchi/tasks/start.yml +++ b/ansible/roles/gnocchi/tasks/start.yml @@ -19,6 +19,7 @@ name: "gnocchi_metricd" volumes: - "{{ node_config_directory }}/gnocchi-metricd/:{{ container_config_directory }}/:ro" + - "gnocchi:/var/lib/gnocchi/" - "kolla_logs:/var/log/kolla/" when: inventory_hostname in groups['gnocchi-metricd'] @@ -30,5 +31,6 @@ name: "gnocchi_statsd" volumes: - "{{ node_config_directory }}/gnocchi-statsd/:{{ container_config_directory }}/:ro" + - "gnocchi:/var/lib/gnocchi/" - "kolla_logs:/var/log/kolla/" when: inventory_hostname in groups['gnocchi-statsd'] diff --git a/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 b/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 index c6bc624c9..5d1317ec0 100644 --- a/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 +++ b/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 @@ -3,23 +3,15 @@ Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['addr - ## Vhost docroot - DocumentRoot "/var/www/cgi-bin/gnocchi" - - ## Directories, there should at least be a declaration for /var/www/cgi-bin/gnocchi + ErrorLog "/var/log/kolla/gnocchi/gnocchi-api-error.log" + CustomLog "/var/log/kolla/gnocchi/gnocchi-api-access.log" combined + WSGIApplicationGroup %{GLOBAL} + WSGIDaemonProcess gnocchi group=gnocchi processes=5 threads=1 user=gnocchi python-path={{ python_path }} + WSGIProcessGroup gnocchi + WSGIScriptAlias / "{{ python_path }}/gnocchi/rest/app.wsgi" - - Options Indexes FollowSymLinks MultiViews - AllowOverride None - Require all granted + + Require all granted - ## Logging - ErrorLog "/var/log/kolla/gnocchi/gnocchi_wsgi_error.log" - ServerSignature Off - CustomLog "/var/log/kolla/gnocchi/gnocchi_wsgi_access.log" combined - WSGIApplicationGroup %{GLOBAL} - WSGIDaemonProcess gnocchi group=gnocchi processes=2 threads=2 user=gnocchi - WSGIProcessGroup gnocchi - WSGIScriptAlias / "/var/www/cgi-bin/gnocchi/app" -- cgit v1.2.3