maxagno3
maxagno3

Reputation: 186

Trouble starting the redis server

I am using rails and want to run sidekiq and running sidekiq requires a Redis server to be installed. I installed Redis for my KDE Neon by following the instructions from the digital ocean. Here is the error that is displayed when I try to run sudo systemctl status redis :

redis.service - Redis In-Memory Data Store
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-03-24 17:24:12 IST; 6s ago
Process: 47334 ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf (code=exited, status=203/EXEC)
Main PID: 47334 (code=exited, status=203/EXEC)
        
Mar 24 17:24:12 maxagno3 systemd[1]: redis.service: Scheduled restart job, restart counter is at 5.
Mar 24 17:24:12 maxagno3 systemd[1]: Stopped Redis In-Memory Data Store.
Mar 24 17:24:12 maxagno3 systemd[1]: redis.service: Start request repeated too quickly.
Mar 24 17:24:12 maxagno3 systemd[1]: redis.service: Failed with result 'exit-code'.
Mar 24 17:24:12 maxagno3 systemd[1]: Failed to start Redis In-Memory Data Store.

Using redis-cli works fine. I assume when I first ran the command sudo systemctl disable redis it deleted the redis.service file. Since then I have uninstalled and installed the Redis but still, the error persists.

Quick help would greatly be appreciated.

Upvotes: 1

Views: 5564

Answers (3)

I was facing with the same issue with redis-server in ubuntu 22.04 LTS. I solved this by :-

  1. Free up some memory from root directory.
  2. See the redis.conf file if there is some missing or unwanted things added to this file by command :-

sudo redis-server /etc/redis/redis.conf

and change with "supervised no".

I hope this will work well!!.

Upvotes: 0

Shtirlic
Shtirlic

Reputation: 692

If you want clean and repeatable approach I suggest you to always use docker, especially for dev environment. So starting docker redis as simple as:

docker run -d -p 6379:6379 --name my-redis redis

Upvotes: 1

Richard Kostyn
Richard Kostyn

Reputation: 31

The error your showing is hiding your originally error. Redis is basically in a reboot loop, which your error is eluding to. What you need to do is disable this restart functionality to get the underlining problem.

This can be done by doing the following:

  1. Edit the /etc/systemd/system/redis.service
  2. Edit the restart line to Restart=no. The possible options are no, on-success, on-failure, on-abnormal, on-watchdog, on-abort or always.
  3. Edit the start limit interval to StartLimitInterval=0. This is normally set really high to prevent load from spiking by a service constantly restarting
  4. Lastly reload your services for your changes to take affect. This is done by running systemctl daemon-reload

Once your service stops looping, you can try to manually start the service to get the actual error. If the error is too large you can look in your OS's general log greping specifically for Redis, or by running journalctl: journalctl -u redis.service

Hopefully this helps!

Upvotes: 2

Related Questions