Cannot install redis server
Solution 1
I end up removing redis which installed from apt-get and install the latest stable version from redis website manually. It works fine now... And I use this guide: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04
Solution 2
You should probably alter the redis.conf file to force it to use IPv4 if it supports that mode only and then maybe you could run it without IPv6.
nano /etc/redis/redis.conf
Simply remove the ::1
IPv6 loopback address from the bind config option:
- bind 127.0.0.1 ::1
+ bind 127.0.0.1
Now redis will not try to use the IPv6 network.
Try to install again
apt install redis-server
Test the Redis Instance Functionality To test that your service is functioning correctly, connect to the Redis server with the command-line client:
redis-cli
In the prompt that follows, test connectivity by typing:
ping You should see:
$ 127.0.0.1:6379> ping
Output
PONG
Check that you can set keys by typing:
$ 127.0.0.1:6379> set test "It's working!"
Output
OK
Now, retrieve the value by typing:
$ 127.0.0.1:6379> get test
You should be able to retrieve the value we stored:
Output
$ 127.0.0.1:6379> "It's working!"
Exit the Redis prompt to get back to the shell:
127.0.0.1:6379> exit
As a final test, let's restart the Redis instance:
$ sudo systemctl restart redis
Related videos on Youtube
Yansen Tan
Updated on September 18, 2022Comments
-
Yansen Tan over 1 year
Tried to install redis-server using Kubuntu 16.04 64 bit version using:
sudo apt install redis-server
But receive this message while installing:
Setting up redis-server (2:3.0.7-1~dotdeb+6.1) ... Job for redis-server.service failed because a timeout was exceeded. See "systemctl status redis-server.service" and "journalctl -xe" for details. invoke-rc.d: initscript redis-server, action "start" failed. dpkg: error processing package redis-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: redis-server E: Sub-process /usr/bin/dpkg returned an error code (1)
Tried to run "journalctl -xe" and found this:
redis-server.service: PID file /var/run/redis/redis-server.pid not readable (yet?) after start-post: No such file or directory
Any idea to fix this issue?
* Update *
"df -h" result:
Filesystem Size Used Avail Use% Mounted on udev 3,9G 0 3,9G 0% /dev tmpfs 789M 9,6M 780M 2% /run /dev/sda2 909G 24G 840G 3% / tmpfs 3,9G 175M 3,7G 5% /dev/shm tmpfs 5,0M 4,0K 5,0M 1% /run/lock tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup /dev/sda1 511M 3,6M 508M 1% /boot/efi tmpfs 789M 0 789M 0% /run/user/118 tmpfs 789M 12K 789M 1% /run/user/1000
"df -h /var/run" result:
Filesystem Size Used Avail Use% Mounted on tmpfs 789M 9,6M 780M 2% /run
-
Rui F Ribeiro about 7 yearsPlease add to the question the output of
df -h
anddf -h /var/run
-
Yansen Tan about 7 yearsHi Rui, I updated it on my question
-
Rui F Ribeiro about 7 yearsI see it is not lack of space of the /run partition...please add also the output of
ls -lah /run
-
-
Yvan over 4 yearsThanks for pointing out the ipv6 issue!