• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How to configure redis properly (2 redis instances)

Dukemaster

Regular Pleskian
Hi @ all,
today I first installed Ubuntus built-in redis version over apt. For the reason that I didn't know how to configure it properly and that the installation seemed to had failed (in the end there was no similar note like: successfully installed), I tried another way by installing another instance by compiling the original release by redis website.
Please, could someone help me to fix the problem to have a correct redis server?
Perhaps I have to deinstall or deactivate one instance and how to configure the best and more useful redis server version for redis PHP module/extension on websites and ngx_pagespeed.
This result I get by testing the redis server:

Code:
root@server:~/redis-stable# redis-server &
[1] 6928
root@server:~/redis-stable# 6928:C 16 Sep 12:49:19.351 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
6928:C 16 Sep 12:49:19.351 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=6928, just started
6928:C 16 Sep 12:49:19.351 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
6928:M 16 Sep 12:49:19.353 * Increased maximum number of open files to 10032 (it was originally set to 1024).
6928:M 16 Sep 12:49:19.354 # Creating Server TCP listening socket *:6379: bind: Address already in use
^C
[1]+  Exit 1                  redis-server
root@server:~/redis-stable# lsof -i tcp:6379
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
redis-ser 1676 redis    4u  IPv4  18320      0t0  TCP localhost.localdomain:6379 (LISTEN)
root@server:~/redis-stable#
root@server:~/redis-stable# redis-cli ping
PONG

Greets and thanks to @UFHH01
 
Last edited:
Hi Dukemaster,

pls. add needed informations, HOW you installed / compiled an additional redis-server on your server.
Pls. add YOUR current operating system within your threads, as the commands and paths differs often enough between CentOS/RHEL and Debian/Ubuntu - based systems.
Pls. provide informations about your current "redis.conf" - files on your server.
What is the output of the commands:
Code:
systemctl status redis
OR
Code:
service redis status


Your redis-server seems to be active:
root@server:~/redis-stable# redis-cli ping PONG
What kind of errors/issues/problems do you experience?


how to configure the best and more useful redis server version for redis PHP module/extension
Pls. explain, why do you want to mix your redis-server - installation with an ( optional ) installation/modification question for the usage PHP module for redis at you r websites?
 
Thanks a lot for your help. No I don't want to mix anything. It should only emphasize to my main question how to configure it. Inspired by You I've edited the title.
You are right again. Redis is running. During waiting for an answer I read more documentation about redis and some advice to create non-root user with sudo privilegs for the Ubuntu redis installation, and the same also explain to install redis in /temp directory.
That's what I haven't done. I installed it as user root and didn't changed any directory by myself.

What kind of errors/issues/problems do you experience?
I expect possible problems because of cross-dependencies. The oldest and most common problem of all.

Code:
systemctl status redis
● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor pre
   Active: active (running) since Sat 2017-09-16 12:35:10 CEST; 3h 32min ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 1677 ExecStartPost=/bin/run-parts --verbose /etc/redis/redis-server.p
  Process: 1631 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exit
  Process: 1556 ExecStartPre=/bin/run-parts --verbose /etc/redis/redis-server.pr
Main PID: 1676 (redis-server)
    Tasks: 3
   Memory: 7.4M
      CPU: 13.093s
   CGroup: /system.slice/redis-server.service
           └─1676 /usr/bin/redis-server 127.0.0.1:6379

Sep 16 12:35:09 server.example.com systemd[1]: Starting Advanced key-value store...
Sep 16 12:35:09 server.example.com run-parts[1556]: run-parts: executing /etc/redis/
Sep 16 12:35:10 server.example.com run-parts[1677]: run-parts: executing /etc/redis/
Sep 16 12:35:10 server.example.com systemd[1]: Started Advanced key-value store.
lines 1-19/19 (END)

Lots of greets
 
Last edited:
Thanks a lot for your help. No I don't want to mix anything. It should only emphasize to my main question how to configure it. Inspired by You I've edited the title.
You are right again. Redis is running. During waiting for an answer I read more documentation about redis and some advice to create non-root user with sudo privilegs for the Ubuntu redis installation, and the same also explain to install redis in /temp directory.
That's what I haven't done. I installed it as user root and didn't changed any directory by myself.


I expect possible problems because of cross-dependencies. The oldest and most common problem of all.

Code:
systemctl status redis
● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor pre
   Active: active (running) since Sat 2017-09-16 12:35:10 CEST; 3h 32min ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 1677 ExecStartPost=/bin/run-parts --verbose /etc/redis/redis-server.p
  Process: 1631 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exit
  Process: 1556 ExecStartPre=/bin/run-parts --verbose /etc/redis/redis-server.pr
 Main PID: 1676 (redis-server)
    Tasks: 3
   Memory: 7.4M
      CPU: 13.093s
   CGroup: /system.slice/redis-server.service
           └─1676 /usr/bin/redis-server 127.0.0.1:6379

Sep 16 12:35:09 server.arox.eu systemd[1]: Starting Advanced key-value store...
Sep 16 12:35:09 server.arox.eu run-parts[1556]: run-parts: executing /etc/redis/
Sep 16 12:35:10 server.arox.eu run-parts[1677]: run-parts: executing /etc/redis/
Sep 16 12:35:10 server.arox.eu systemd[1]: Started Advanced key-value store.
lines 1-19/19 (END)

Lots of greets

Official ubuntu repository provide only an old redis-server release, but with ubuntu packages you should not have any issues with redis.
But it's not a good idea to have a software installed from packages and builded from source at the same time. You probably have two redis-server services in /etc/systemd/system, and both are running on the same port.
The easiest is probably to remove totally allow redis-server packages, and folders before installing it again from the ubuntu repository.

Redis may require some additional settings to run properly, like allowing memory over-commit. You can set it with the following command :
Code:
echo 1 > /proc/sys/vm/overcommit_memory
 
Thanks a lot @virtubox , you say "may", does it mean it's strictly recommended or just a real good advice? until the last 12 hours I didn't know anything about Redis.
What does your command make? Do you have a lil details of it, perhaps?
By overcommit I have only a small inspiration what it could about. If you or nobody answering I will inform myself about your suggestion and do it.
I'm totally happy, today is like birthday party.
Redis is working fine. (from my little knowledge point of view). But Redis is working with Woltlab software for sure, so the Ubuntu Redis installation was successful.
aaand...
Not only by installing Redis, but also with it, I was able to make the setup for ngx_pagespeed admin, console, statistics. First time that I accessed the console and configured it.
I'm a kind of crazy by my happiness now. Happy to get this running after weeks hard reading, reading, reading, until today I was too afraid to destroy something by any tests.
Not one I had made. But today I made over 20 configurations in nginx.conf and 80% of the setup.


Lot of greets
 
Last edited:
Thanks a lot @virtubox , you say "may", does it mean it's strictly recommended or just a real good advice? until the last 12 hours I didn't know anything about Redis.
What does your command make? Do you have a lil details of it, perhaps?
By overcommit I have only a small inspiration what it could about. If you or nobody answering I will inform myself about your suggestion and do it.
I have used "may" because it 's needed only if redis display a warning .
Since in theory all the pages may change while the child process is saving, Linux can't tell in advance how much memory the child will take, so if the overcommit_memory setting is set to zero fork will fail unless there is as much free RAM as required to really duplicate all the parent memory pages, with the result that if you have a Redis dataset of 3 GB and just 2 GB of free memory it will fail.
Setting overcommit_memory to 1 tells Linux to relax and perform the fork in a more optimistic allocation fashion, and this is indeed what you want for Redis.
Source : FAQ – Redis

Redis require also to disable transparent hugepage settings, another memory management feature :
Code:
echo never > /sys/kernel/mm/transparent_hugepage/enabled

You can find all optimization tips for redis on Redis - EasyEngine
 
Back
Top