Redis 5.0.5 Installation / Update / Upgrade

Redis easily installed and updated on the server

Part Ⅰ – Only necessary for the update

  • Shut down Redis and safely shut down data storage


    Bash
    root@server:~# redis-cli
    127.0.0.1:6379> SHUTDOWN SAVE
    (1.89s)
    not connected> quit
    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

Bash
~# apt-get install build-essential
~# apt-get install tcl wget

CentOS

Bash
~# yum groupinstall 'Development Tools'
~# yum install tcl wget

Debian + Ubuntu + CentOS

Open Redis configuration – Testing Redis with Ping Pong

Bash
~# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379>

Display Redis version

Bash
~# redis-server --version
Redis server v=5.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=346d28814696cac3
~#

Part Ⅲ – Configure server for Redis

Option A: Settings for overcommit_memory and somaxconn

Bash
~# echo never > /sys/kernel/mm/transparent_hugepage/enabled
~# echo "vm.overcommit_memory = 1" >>  /etc/sysctl.conf  && sysctl  -p
~# echo "net.core.somaxconn = 65535" >>  /etc/sysctl.conf  && sysctl  -p

Check:
~# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
~# cat /proc/sys/net/core/somaxconn
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.

Bash
daemonize yes
supervised systemd
logfile /var/log/redis_6379.log
dir /var/lib/redis/6379
maxclients 10000
maxmemory 15GB (Server hat 32G Memory)
maxmemory-policy volatile-ttl
maxmemory-samples 5
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.

Bash
daemonize yes
pidfile /var/run/redis/redis.pid

Then definitely reload the daemon and restart Redis.

Code
~# systemctl daemon-reload
~# systemctl restart redis_6379

More Articles

Deleting/Clearing systemd journal files, like btmp, and other log files
Cron job – Generating weekly new DH PARAM files

Navigation

  1. Community
  2. Forum
  3. Shop
  4. My Account
  5. World
    1. WOLTLAB SPANISH
    2. WOLTLAB PORTUGUESE
    3. WOLTLAB POLISH
    4. Adding Language
    5. Create Article
  6. Chat
  7. EN
  1. Contact
  2. Legal Notice
  3. Privacy Policy
  4. Terms
  5. Disclaimer
  6. Copyrights
  7. Cookies
  8. DONATE

Current Location

This site uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.