[root@netkiller ~]# dnf install -y redis
[root@netkiller ~]# systemctl enable redis
cp /etc/redis.conf{,.original}
sed -i 's/bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf
sed -i 's/timeout 0/timeout 30/' /etc/redis.conf
sed -i 's/# maxclients 10000/maxclients 1000/' /etc/redis.conf
sed -i 's/# maxmemory-policy noeviction/maxmemory-policy volatile-lru/g' /usr/local/etc/redis.conf
random=$(cat /dev/urandom | tr -cd [:alnum:] | fold -w32 | head -n 1)
sed -i "s/# requirepass foobared/requirepass ${random}/g" /etc/redis.conf
echo "Redis random password is: ${random}"
cat >> /etc/security/limits.d/20-nofile.conf <<EOF
redis soft nofile 65500
redis hard nofile 65500
EOF
cat >> /etc/sysctl.conf <<EOF
# Set up for Redis
vm.overcommit_memory = 1
net.core.somaxconn = 1024
EOF
sysctl -w net.core.somaxconn=1024
sysctl -w vm.overcommit_memory=1
cat >> /etc/rc.local <<EOF
# Set up for Redis
echo never > /sys/kernel/mm/transparent_hugepage/enabled
EOF
echo never > /sys/kernel/mm/transparent_hugepage/enabled
systemctl enable redis
systemctl start redis
systemctl status redis
Ubuntu
$ sudo apt-get install redis-server
$ dpkg -s redis-server
Package: redis-server
Status: install ok installed
Priority: optional
Section: database
Installed-Size: 208
Maintainer: Chris Lamb <lamby@debian.org>
Architecture: amd64
Source: redis
Version: 2:1.2.6-1
Depends: libc6 (>= 2.7), adduser
Conffiles:
/etc/redis/redis.conf a19bad63017ec19def2c3a8a07bdc362
/etc/logrotate.d/redis-server 06755b99ef70d62a56cff94cbfc36de7
/etc/init.d/redis-server 3742555c10ab16fdd67fcbaf92faf694
/etc/bash_completion.d/redis-cli 848565df7f222dc03c8d5cb34b9e0188
Description: Persistent key-value database with network interface
Redis is a key-value database in a similar vein to memcache but the dataset
is non-volatile. Redis additionally provides native support for atomically
manipulating and querying data structures such as lists and sets.
.
The dataset is stored entirely in memory and periodically flushed to disk.
Homepage: http://code.google.com/p/redis/
$ cat /etc/redis/redis.conf
# Redis configuration file example
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes
# When run as a daemon, Redis write a pid file in /var/run/redis.pid by default.
# You can specify a custom pid file location here.
pidfile /var/run/redis.pid
# Accept connecti