Redis拒绝启动。

4
我已经按照这个教程安装了redis。一切都很顺利,直到我运行sudo service redis_6379 start时,我遇到如下错误: Failed to start redis_6379.service: Unit redis_6379.service failed to load: No such file or directory. 检查后发现redis没有运行:
> sudo service redis_6379 status
● redis_6379.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)

我不确定 redis_6379.service 这个文件是什么,也不知道如何创建它?需要帮助吗?

编辑: 尝试使用 sudo apt-get install redis-server 安装,但出现以下错误:

adduser: Warning: The home directory `/var/lib/redis' does not belong to the user that you are currently creating.
insserv: script shlonsky: service nginx already provided!
insserv: script unicorn_my_app: service unicorn already provided!
insserv: warning: script 'vncserver' missing LSB tags and overrides
insserv: There is a loop between service unicorn and vncserver if stopped
insserv:  loop involving service vncserver at depth 2
insserv:  loop involving service unicorn at depth 1
insserv: Stopping vncserver depends on unicorn_faisal_lab and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package redis-server (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for systemd (219-7ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 redis-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

我创建了脚本 shlonskyunicorn_my_app 来启动 nginx 和 unicorn,但我没有想到它们会影响到其他 .service 安装。你有什么建议可以让 .service 文件安装成功吗?


你正在运行Ubuntu吗? - shafeen
1个回答

11
尝试通过apt-get简单地安装redis-server: sudo apt-get install redis-server,之后可以使用sudo service redis-server start来简单地start/stop/restart服务器,或者您也可以手动在后台启动redis-server,使用命令:redis-server &

启动服务器后,您应该能够使用 redis-cli 命令连接到 Redis 命令行界面(cli)。 - shafeen
你的系统中可能存在损坏(或有效)的 Redis 安装,你的命令行中是否有 redis-server 命令可用?如果有,你尝试运行过它了吗? - shafeen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接