Redis is an open source (BSD licensed), in-memory data structure store used as a database, cache, message broker, and streaming engine. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
pacman -S redis
nano /etc/redis/redis.conf
port 0 unixsocket /run/redis/redis.sock unixsocketperm 770 requirepass your-password
usermod -aG redis http
systemctl enable --now redis.service
If the error overcommit memory …
occurs with systemctl status redis.service
, add this to sysctl:
/etc/sysctl.d/99-sysctl.conf
vm.overcommit_memory=1
Enable redis for php.
pacman -S php-igbinary php-redis nano /etc/php/conf.d/{igbinary.ini,redis.ini}
extension=igbinary.so extension=redis
igbinary
needs to be loaded first otherwise redis module doesn't start.redis-cli -s /var/run/redis/redis.sock --askpass monitor