redis 拒绝启动

redis refuses to start

我按照this tutorial安装了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 不是 运行ning:

> 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 文件吗?

尝试通过 apt-get 简单地安装 redis-server: sudo apt-get install redis-server,之后只需 start/stop/restart 服务器使用 sudo service redis-server start 或者你也应该能够在后台手动启动 redis-server使用 redis-server &.