tested on debian/buster
grab the latest release
apt install gnupg1 curl lsb-release #curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg curl -fsSL https://packages.redis.io/gpg | gpg1 --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" > /etc/apt/sources.list.d/redis.list cat /etc/apt/sources.list.d/redis.list apt update
on servers
apt install redis redis-server redis-server --version
on clients (incl. the servers themselves)
apt install redis-tools redis-cli --version
tune the kernel
cd /etc/ mv -i sysctl.conf sysctl.conf.dist grep -vE '^[[:space:]]*#|^[[:space:]]*$' sysctl.conf.dist > sysctl.conf.clean grep -vE '^[[:space:]]*#|^[[:space:]]*$' sysctl.conf.dist > sysctl.conf vi sysctl.conf # was therefore empty net.core.somaxconn = 1024 vm.overcommit_memory = 1 sysctl -p
assuming internal and trusted network
cd /etc/redis/ mv -i redis.conf redis.conf.dist grep -vE '^#|^$' redis.conf.dist > redis.conf.clean grep -vE '^#|^$' redis.conf.dist > redis.conf vi redis.conf bind 0.0.0.0 # default acl user #requirepass SOME-PASSWORD
and on the slave also as follows
assuming redis1 is defined as static name resolution
slaveof redis1 6379 #masterauth SOME-PASSWORD
systemctl restart redis-server netstat -lntup | grep redis systemctl status redis-server # not enabled yet systemctl enable redis-server
if you enabled authentication for default acl user
export REDISCLI_AUTH=SOME-PASSWORD
List databases
redis-cli info | grep ^db
Print the key names of a given database, say db1 (default is db0)
select 1 keys *
Getting started with Redis https://redis.io/topics/quickstart
https://redis.io/topics/rediscli
https://www.baeldung.com/redis-list-all-databases
https://chartio.com/resources/tutorials/how-to-get-all-keys-in-redis/
https://stackoverflow.com/questions/12802726/how-to-list-all-redis-databases ==> INFO
https://redis.io/commands/KEYS
https://redis.io/commands/eval
https://www.digitalocean.com/community/cheatsheets/how-to-manage-redis-databases-and-keys
https://redis.io/topics/persistence
–> appendonly yes
https://laravel.com/docs/8.x/queues#installing-supervisor
https://laravel.com/docs/8.x/queues#supervisor-configuration
http://supervisord.org/running.html?highlight=reread
https://stackoverflow.com/questions/7537905/how-to-set-password-for-redis