Service 无法在centos上将redis server作为服务运行

Service 无法在centos上将redis server作为服务运行,service,redis,centos7,Service,Redis,Centos7,在centos 7上,我使用常规的wget、make和makeinstall命令安装了redis 当我能做命令的时候 $redis-server redis.conf 而且效果很好 但是如果我尝试 systemctl start redis-server 或 上面说 Failed to issue method call: Unit redis-server.service failed to load: No such file or directory. 我怎样才能解决这个问题。我需要

在centos 7上,我使用常规的wget、make和makeinstall命令安装了redis

当我能做命令的时候

$redis-server redis.conf
而且效果很好

但是如果我尝试

systemctl start redis-server

上面说

Failed to issue method call: Unit redis-server.service failed to load: No such file or directory.
我怎样才能解决这个问题。我需要将redis服务器作为服务运行

您可以尝试:

sudo systemctl enable redis-server 

sudo service redis-server start

您可以检查redis或redis服务器是否正确。可能您需要在sudo systemctl enable redis server

后重新启动系统。最好通过RPM(软件包)安装redis,而不是只执行源代码的wget,然后构建它们。您可能会在“extra packages for Enterprise Linux”集合中找到合适的版本。只需将适当的存储库添加到您的Yum配置中,并使用Yum命令更新包索引并查询它们,以查看您是否有感兴趣的Redis服务器版本。这里有一个使用EPEL的指南

另一个选择是使用.spec文件构建自己的RPM。与其尝试从头开始编写自己的脚本,不如尝试一些类似的方法作为起点(对于3.0.7版),或者搜索其他RPM或.spec文件。然而,重要的是您需要redis.service和redis.init配置文件,用于描述如何将redis服务器运行到systemd系统

sudo systemctl enable redis-server 

sudo service redis-server start