Reputation: 6144
On a centos 7 I installed redis using the regular wget, make and make install commands.
While I am able to do a command
$redis-server redis.conf
and it works nicely.
But if I try
systemctl start redis-server
or
sudo service redis-server start/restart
it says
Failed to issue method call: Unit redis-server.service failed to load: No such file or directory.
How can I fix this. I need to run redis-server as a service.
Upvotes: 1
Views: 5983
Reputation: 17500
It would be better to install Redis via an RPM (package) rather than just performing a wget of the sources and building them. You might find a suitable version in the "extra packages for Enterprise Linux" EPEL collection. Just add the appropriate repositories to your Yum configuration and use yum commands to update your package indexes and query them to see if you have the Redis server version you're interested in. Here's a guide on How to install redis server on CentOS 7 / RHEL 7 using EPEL
Another option would be to build your own RPM using a .spec file. Rather than trying to write your own from scratch you might try something like remicollet/remirepo's redis.spec as a starting point (for version 3.0.7) or search around for other RPMs or .spec files. However the big deal is that you need the redis.service and redis.init configuration files that are used to describe how to run a Redis server to the systemd system.
Upvotes: 0
Reputation:
You can try:
sudo systemctl enable redis-server
sudo service redis-server start
You can check that redis or redis-server right. May be You need to restart Your System after sudo systemctl enable redis-server
Upvotes: 3