OL: Interacting with memcached
On any host:
$ cd /olsystem/etc $ . /opt/openlibrary/venv/bin/activate $ python |
in python:
>>> import yaml >>> import memcache >>> y = yaml.safe_load(open('openlibrary.yml')) >>> mc = memcache.Client(y['memcache_servers']) |
where:
>>> y['memcache_servers'] ['ol-mem0:11211', 'ol-mem1:11211', 'ol-mem2:11211'] |
-: to GET the memcache entry:
>>> mc.get('ia.get_metadata-"houseofscorpion00farmrich"') |
-: to DELETE a memcached entry:
>>> mc.delete('ia.get_metadata-"houseofscorpion00farmrich"') |
[ref: http://dev.blog.archive.org/2014/02/14/manually-deleting-stale-cache-entries-from-ol-memcache]