Solved Unable to get redis cache running on debian 10 based Nextcloud instance
-
installed nextcloud, working fine, but need the
redis
cache to be working.
redis is installed and working. I had to manually enable the unix socket int he config file.
but I can useredis-cli
and get responses.I have tried both the unix socket and the TCP connection from here:
https://docs.nextcloud.com/server/17/admin_manual/configuration_files/files_locking_transactional.htmlWhenI use the TCP method there are no log errors or anything I can see.
When I use the socket, I get this spamming in the log unless I give the socket 777 permissions. Though when I do, i get no errors, but the info status still shows no cache.
-
Honestly it can be quite a PITA. A solution might be to kind'a start from scratch and follow the how-to from techrepublic - I helped Jack write that, we had also permission errors. The group thing was a big part of the solution. Note you need to restart stuff after changing groups etc, maybe a horrible reboot can help.
And yeah, I was looking here. I don't see any obvious issues...
-
These are the php modules installed.
jbusch@nextcloud:~$ sudo apt list php-* | grep installed php-common/stable,now 2:69 all [installed,automatic] php-curl/stable,now 2:7.3+69 all [installed] php-fpm/stable,now 2:7.3+69 all [installed] php-gd/stable,now 2:7.3+69 all [installed] php-igbinary/stable,now 3.0.0-1 amd64 [installed,automatic] php-imagick/stable,now 3.4.3-4.1 amd64 [installed] php-intl/stable,now 2:7.3+69 all [installed] php-json/stable,now 2:7.3+69 all [installed] php-mbstring/stable,now 2:7.3+69 all [installed] php-mysql/stable,now 2:7.3+69 all [installed] php-pear/stable,now 1:1.10.6+submodules+notgz-1.1 all [installed] php-redis/stable,now 4.2.0-1 amd64 [installed] php-xml/stable,now 2:7.3+69 all [installed] php-zip/stable,now 2:7.3+69 all [installed]
-
@JaredBusch It's phpinfo you want to look at for module info. Preferably through the webserver.
-
@Pete-S said in Unable to get redis cache running on debian 10 based Nextcloud instance:
@JaredBusch It's phpinfo you want to look at for module info. Preferably through the webserver.
-
Did you do the config in config.php file in nextcloud folder
-
Here's what I found on https://www.c-rieger.de/nextcloud-installation-guide-debian-9-10/#c04
Redis configurationsed -i "s/port 6379/port 0/" /etc/redis/redis.conf sed -i s/\#\ unixsocket/\unixsocket/g /etc/redis/redis.conf sed -i "s/unixsocketperm 700/unixsocketperm 770/" /etc/redis/redis.conf sed -i "s/# maxclients 10000/maxclients 512/" /etc/redis/redis.conf usermod -aG redis www-data
Nextcloud configuration for Redis
'redis' => array ( 'host' => '/var/run/redis/redis-server.sock', # ATTENTION if you operate on Debian 9.x: # 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 0.0, ),
-
@Emad-R said in Unable to get redis cache running on debian 10 based Nextcloud instance:
Did you do the config in config.php file in nextcloud folder
Yes, I know how it is supposed to be configured. I've done it at least a dozen times on CentOS/Fedora based systems.
-
@black3dynamite said in Unable to get redis cache running on debian 10 based Nextcloud instance:
Here's what I found on https://www.c-rieger.de/nextcloud-installation-guide-debian-9-10/#c04
Redis configurationsed -i "s/port 6379/port 0/" /etc/redis/redis.conf sed -i s/\#\ unixsocket/\unixsocket/g /etc/redis/redis.conf sed -i "s/unixsocketperm 700/unixsocketperm 770/" /etc/redis/redis.conf sed -i "s/# maxclients 10000/maxclients 512/" /etc/redis/redis.conf usermod -aG redis www-data
Nextcloud configuration for Redis
'redis' => array ( 'host' => '/var/run/redis/redis-server.sock', # ATTENTION if you operate on Debian 9.x: # 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 0.0, ),
The only thing I did not have was setting the port to 0 and the change of max clients.
My understanding of the port 0 was that it would answer both TCP or socket if I left it alone.
-
No difference
-
-
With the socket on 770 I get this spamming again.
Changing it to 777 stops that, but instead I get this.
-
That should go away when you add redis to www-data group.
-
@black3dynamite said in Unable to get redis cache running on debian 10 based Nextcloud instance:
That should go away when you add redis to www-data group.
root@nextcloud:/var/www/nextcloud# adduser redis www-data Adding user `redis' to group `www-data' ... Adding user redis to group www-data Done. root@nextcloud:/var/www/nextcloud# systemctl restart redis root@nextcloud:/var/www/nextcloud# systemctl restart apache2 # edit conf to change permission to 770 again root@nextcloud:/var/www/nextcloud# nano /etc/redis/redis.conf root@nextcloud:/var/www/nextcloud# systemctl restart redis
and back to the spamming permission denied.
-
@JaredBusch said in Unable to get redis cache running on debian 10 based Nextcloud instance:
@black3dynamite said in Unable to get redis cache running on debian 10 based Nextcloud instance:
That should go away when you add redis to www-data group.
root@nextcloud:/var/www/nextcloud# adduser redis www-data Adding user `redis' to group `www-data' ... Adding user redis to group www-data Done. root@nextcloud:/var/www/nextcloud# systemctl restart redis root@nextcloud:/var/www/nextcloud# systemctl restart apache2 # edit conf to change permission to 770 again root@nextcloud:/var/www/nextcloud# nano /etc/redis/redis.conf root@nextcloud:/var/www/nextcloud# systemctl restart redis
and back to the spamming permission denied.
Go the other way and add www-data to the redis group instead?
-
@dafyre said in Unable to get redis cache running on debian 10 based Nextcloud instance:
@JaredBusch said in Unable to get redis cache running on debian 10 based Nextcloud instance:
@black3dynamite said in Unable to get redis cache running on debian 10 based Nextcloud instance:
That should go away when you add redis to www-data group.
root@nextcloud:/var/www/nextcloud# adduser redis www-data Adding user `redis' to group `www-data' ... Adding user redis to group www-data Done. root@nextcloud:/var/www/nextcloud# systemctl restart redis root@nextcloud:/var/www/nextcloud# systemctl restart apache2 # edit conf to change permission to 770 again root@nextcloud:/var/www/nextcloud# nano /etc/redis/redis.conf root@nextcloud:/var/www/nextcloud# systemctl restart redis
and back to the spamming permission denied.
Go the other way and add www-data to the redis group instead?
Nothing.
I'm at a real loss as to WTF is going on here.
-
Since he's back... @jospoortvliet any hints on where to look?
-
Honestly it can be quite a PITA. A solution might be to kind'a start from scratch and follow the how-to from techrepublic - I helped Jack write that, we had also permission errors. The group thing was a big part of the solution. Note you need to restart stuff after changing groups etc, maybe a horrible reboot can help.
And yeah, I was looking here. I don't see any obvious issues...
-
@jospoortvliet said in Unable to get redis cache running on debian 10 based Nextcloud instance:
Honestly it can be quite a PITA. A solution might be to kind'a start from scratch and follow the how-to from techrepublic - I helped Jack write that, we had also permission errors. The group thing was a big part of the solution. Note you need to restart stuff after changing groups etc, maybe a horrible reboot can help.
And yeah, I was looking here. I don't see any obvious issues...
I'll poke at this shortly.
I've never had a problem enabling this on a CentOS or Fedora system. I do not use Ubuntu anywhere. This one was Debian because supposedly the OCR plugin needs a package that is not available on Fedora.
-
Possibly unrelated, but I was having problems getting a new instance setup on Ubuntu. Redis wasn't working there either. I bailed almost immediately as I didn't have time to mess with it. Installed it on Fedora, and it everything seems to be working as expected.
-
@jospoortvliet said in Unable to get redis cache running on debian 10 based Nextcloud instance:
Honestly it can be quite a PITA. A solution might be to kind'a start from scratch and follow the how-to from techrepublic - I helped Jack write that, we had also permission errors. The group thing was a big part of the solution. Note you need to restart stuff after changing groups etc, maybe a horrible reboot can help.
And yeah, I was looking here. I don't see any obvious issues...
ok got it.
I had to keep the socket permission at
770
instead of700
. I can fine tune that later when the system is not in use.This is my
config.php
'filelocking.enabled' => true, 'memcache.local' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/var/run/redis/redis-server.sock', 'port' => 0, 'timeout' => 0, 'password' => '', 'dbindex' => 0, ),