I am trying to run Graphite through GUnicorn (ultimately proxied through nginx), however I tried almost everything to run the application and could not get errors similar to the following.
(graphite)/opt/graphite/conf gunicorn
2014-03-03 17:02:14 [312] [INFO] Starting gunicorn 18.0
2014-03-03 17:02:14 [312] [INFO] Listening at: http://127.0.0.1:8080 (312)
2014-03-03 17:02:14 [312] [INFO] Using worker: sync
2014-03-03 17:02:14 [317] [INFO] Booting worker with pid: 317
2014-03-03 17:02:14 [317] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
__import__(module)
ImportError: No module named graphite.wsgi
Traceback (most recent call last):
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/opt/graphite/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
__import__(module)
ImportError: No module named graphite.wsgi
2014-03-03 17:02:14 [317] [INFO] Worker exiting (pid: 317)
2014-03-03 17:02:14 [312] [INFO] Shutting down: Master
2014-03-03 17:02:14 [312] [INFO] Reason: Worker failed to boot.
I tried working in different directories (root dir, conf dir, webapp dir, etc.). I tried working with gunicorn_django assistant. I can download it using the development server:opt/graphite/bin/run-graphite-devel-server.py --port=8080 /opt/graphite
I installed everything through virtualenv and pip and just copied the graphite.wsgi.example file to the graphite.wsgi file in the directory conf. Looks like that:
(graphite)/opt/graphite/conf cat graphite.wsgi.example
import os, sys
sys.path.append('/opt/graphite/webapp')
os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
from graphite.logger import log
log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid())
import graphite.metrics.search
(graphite)/opt/graphite/conf
Any help would be greatly appreciated.