问题
I have a graphite instance that I would like to use memcache server to read from cache.
I have done these:
Installed memcached on 192.168.101.1
Installed graphite and python-memcached on server 192.168.101.2
I verified that graphite web-app works using opentsdb as backend storage. This is my local_settings.py looks like:
SECRET_KEY = 'pass123'
TIME_ZONE = 'America/New_York'
DEBUG = True
MEMCACHE_HOSTS = ['192.168.101.2:11211']
DATABASES = {
'default': {
'NAME': '/opt/graphite/storage/graphite.db',
'ENGINE': 'django.db.backends.sqlite3',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': ''
}
}
#
STORAGE_FINDERS = (
'graphite_opentsdb.finder.OpenTSDBFinder',
)
OPENTSDB_URI = 'http://192.168.101.17:4242/api/v1/'
OPENTSDB_TREE = 1
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '192.168.101.2:11211',
}
}
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
When I have something in my MEMCACHE_HOST line as shown MEMCACHE_HOSTS = ['192.168.101.2:11211']), I get server error. If I keep it empty or comment out the whole line, I dont see any request going into the memchache host.
Any ideas what I am missing here?
来源:https://stackoverflow.com/questions/29774117/how-do-you-point-graphite-to-memcache