-
Notifications
You must be signed in to change notification settings - Fork 28
esdc redis
secult edited this page Dec 8, 2016
·
9 revisions
Redis is an advanced key-value store.
http://redis.io/
Note: This guide is made for a development environment based on CentOS 7.
We will use the remi repository and install the newest version (3.2):
yum install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
vim /etc/yum.repos.d/remi.repo # Enable the [remi] repo
yum install redis
REDISPASS="S3cr3tP4ssw0rd"
vim /etc/redis.conf
- Comment out bind option
- Set requirepass ${REDISPASS}
- Comment out save lines (in SNAPSHOTTING section)
vim /etc/sysconfig/iptables
Add following line:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
Then restart iptables
systemctl restart iptables # allow port 6379 for compute nodes
systemctl start redis
systemctl enable redis
-
Used by django for caching:
from django.core.cache import cache, caches # django cache wrapper cache.set(key, value, timeout=0) cache.get(key) cache.delete(key) # redis client directly redis = caches['redis'].master_client redis.keys()
-
Also used by Celery as a result backend:
from que.erigonesd import cq redis = cq.backed.client redis.keys()
Homepage | User Guide | API Reference | Wiki