how do you point graphite to memcache

我只是一个虾纸丫 提交于 2019-12-12 05:37:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!