Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to restart redis-server.service: Unit redis-server.service not found

Tags:

node.js

redis

Tried to start redis-server but got:

26195:C 27 Aug 17:05:11.684 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

26195:M 27 Aug 17:05:11.684 * Increased maximum number of open files to 10032 (it was originally set to 1024).

26195:M 27 Aug 17:05:11.685 # Creating Server TCP listening socket *:6379: bind: Address already in use

Ran lsof -wni tcp:3000 and killed the local host and tried restarting redis-server again and got the same above error.

Tried: ps -aux | grep redis (output below), then sudo kill -9 6379

nick4896 12238 0.0 0.1 41432 9048 ? Sl Aug26 0:14 redis-server *:6379

nick4896 26304 0.0 0.0 21300 984 pts/21 S+ 17:08 0:00 grep --color=auto redis

And ran sudo service redis-server restart, and got:

Failed to restart redis-server.service: Unit redis-server.service not found.

Any ideas?

like image 574
musufasa Avatar asked Aug 27 '16 09:08

musufasa


1 Answers

The problem is that symlink redis-server.service to redis.service was deleted.
Command

sudo systemctl enable redis-server

creates the symlink:

Created symlink /etc/systemd/system/redis.service → /lib/systemd/system/redis-server.service.

like image 171
Igor Kavzov Avatar answered Sep 21 '22 08:09

Igor Kavzov