Redis 5.0.5 Installation / Update / Upgrade

Redis 5.0.5 Installation / Update / Upgrade on Ubuntu 18 with Plesk with WoltLab

Redis easily installed and updated on the server

Part Ⅰ – Only necessary for the update

  • Shut down Redis and safely shut down data storage


    Shell-Script
    1. root@server:~# redis-cli
    2. 127.0.0.1:6379> SHUTDOWN SAVE
    3. (1.89s)
    4. not connected> quit
    5. root@server:~#
  • Stop Redis instance: ~# systemctl stop redis_6379 or ~# service redis_6379 stop
  • Backup of the current Redis configuration /etc/redis/6379.conf and data files /var/lib/redis/6379/appendonly.aof and /var/lib/redis/6379/dump.rdb

Part Ⅱ – Installation / Update

Debian + Ubuntu

Shell-Script
  1. ~# apt-get install build-essential
  2. ~# apt-get install tcl wget

CentOS

Shell-Script
  1. ~# yum groupinstall 'Development Tools'
  2. ~# yum install tcl wget

Debian + Ubuntu + CentOS

Open Redis configuration – Testing Redis with Ping Pong

Shell-Script
  1. ~# redis-cli
  2. 127.0.0.1:6379> ping
  3. PONG
  4. 127.0.0.1:6379>

Display Redis version

Shell-Script
  1. ~# redis-server --version
  2. Redis server v=5.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=346d28814696cac3
  3. ~#

Part Ⅲ – Configure server for Redis

Option A: Settings for overcommit_memory and somaxconn

Shell-Script
  1. ~# echo never > /sys/kernel/mm/transparent_hugepage/enabled
  2. ~# echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf && sysctl -p
  3. ~# echo "net.core.somaxconn = 65535" >> /etc/sysctl.conf && sysctl -p
  4. Check:
  5. ~# cat /sys/kernel/mm/transparent_hugepage/enabled
  6. always madvise [never]
  7. ~# cat /proc/sys/net/core/somaxconn
  8. 65535

Option B: Settings for transparent_hugepage, overcommit_memory and somaxconn

All changed settings are displayed here in the Redis configuration file /etc/redis/6379.conf. The first two values are caused by the following configuration for system.d.

Shell-Script
  1. daemonize yes
  2. supervised systemd
  3. logfile /var/log/redis_6379.log
  4. dir /var/lib/redis/6379
  5. maxclients 10000
  6. maxmemory 15GB (Server hat 32G Memory)
  7. maxmemory-policy volatile-ttl
  8. maxmemory-samples 5
  9. appendonly yes

The Highlight - The great finale - Configure Redis for system.d

We create the file redis.service in /lib/systemd/system/redis.service with the following content:

Thus, the two following values must also be adapted in the Redis configuration /etc/redis/6379.conf.

Shell-Script
  1. daemonize yes
  2. pidfile /var/run/redis/redis.pid

Then definitely reload the daemon and restart Redis.

Code
  1. ~# systemctl daemon-reload
  2. ~# systemctl restart redis.service

Redis 5.0.5 OK-Status with system.d on Ubuntu18 Server

    About the Author

    Hola Hello ஹலோ Halo привет Hallo Salut Ciao Olá 你好 Γεια σας もしもし Pozdravljeni สวัสดี Habari ਹੈਲੋ Salve прывітанне

    Multimedia multimedia-pool.com