redis-server无法在服务器上工作我有nginx,apache,php和mysql
是否有任何软件包可以导致以下问题
PS:这个错误,当我安装BBB
https://github.com/bigbluebutton/bbb-install
redis-server.service:控制进程已退出,代码=exited status=1无法启动高级键值存储。
--
-- The result is failed.
Apr 05 12:28:44 ns3081715 systemd[1]: redis-server.service: Unit entered failed state.
Apr 05 12:28:44 ns3081715 systemd[1]: redis-server.service: Failed with result 'exit-code'.
Apr 05 12:28:44 ns3081715 systemd[1]: redis-server.service: Service hold-off time over, scheduling restart.
Apr 05 12:28:44 ns3081715 systemd[1]: Stopped Advanced key-value store.
-- Subject: Unit redis-server.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit redis-server.service has finished shutting down.
Apr 05 12:28:44 ns3081715 systemd[1]: Starting Advanced key-value store...
-- Subject: Unit redis-server.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit redis-server.service has begun starting up.
Apr 05 12:28:44 ns3081715 run-parts[19223]: run-parts: executing /etc/redis/redis-server.pre-up.d/00_example
Apr 05 12:28:44 ns3081715 redis-server[19239]: *** FATAL CONFIG FILE ERROR ***
Apr 05 12:28:44 ns3081715 redis-server[19239]: Reading the configuration file, at line 108
Apr 05 12:28:44 ns3081715 redis-server[19239]: >>> 'logfile /var/log/redis/redis-server.log'
Apr 05 12:28:44 ns3081715 redis-server[19239]: Can't open the log file: Permission denied
Apr 05 12:28:45 ns3081715 systemd[1]: redis-server.service: Control process exited, code=exited status=1
Apr 05 12:28:45 ns3081715 systemd[1]: Failed to start Advanced key-value store.
-- Subject: Unit redis-server.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit redis-server.service has failed.
--
-- The result is failed.
Apr 05 12:28:45 ns3081715 systemd[1]: redis-server.service: Unit entered failed state.
Apr 05 12:28:45 ns3081715 systemd[1]: redis-server.service: Failed with result 'exit-code'.
Apr 05 12:28:45 ns3081715 systemd[1]: redis-server.service: Service hold-off time over, scheduling restart.
Apr 05 12:28:45 ns3081715 systemd[1]: Stopped Advanced key-value store.
-- Subject: Unit redis-server.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit redis-server.service has finished shutting down.
Apr 05 12:28:45 ns3081715 systemd[1]: Starting Advanced key-value store...
-- Subject: Unit redis-server.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit redis-server.service has begun starting up.
Apr 05 12:28:45 ns3081715 run-parts[19251]: run-parts: executing /etc/redis/redis-server.pre-up.d/00_example
Apr 05 12:28:45 ns3081715 redis-server[19270]: *** FATAL CONFIG FILE ERROR ***
Apr 05 12:28:45 ns3081715 redis-server[19270]: Reading the configuration file, at line 108
Apr 05 12:28:45 ns3081715 redis-server[19270]: >>> 'logfile /var/log/redis/redis-server.log'
Apr 05 12:28:45 ns3081715 redis-server[19270]: Can't open the log file: Permission denied
Apr 05 12:28:45 ns3081715 systemd[1]: redis-server.service: Control process exited, code=exited status=1
Apr 05 12:28:45 ns3081715 systemd[1]: Failed to start Advanced key-value store.
-- Subject: Unit redis-server.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit redis-server.service has failed.
--
-- The result is failed.
Apr 05 12:28:45 ns3081715 systemd[1]: redis-server.service: Unit entered failed state.
Apr 05 12:28:45 ns3081715 systemd[1]: redis-server.service: Failed with result 'exit-code'.
其他原木
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit redis-server.service has failed.
> --
> -- The result is failed. Apr 05 12:38:23 ns3081715 systemd[1]: redis-server.service: Unit entered failed state. Apr 05 12:38:23
> ns3081715 systemd[1]: redis-server.service: Failed with result
> 'exit-code'. Apr 05 12:38:23 ns3081715 systemd[1]:
> redis-server.service: Service hold-off time over, scheduling restart.
> Apr 05 12:38:23 ns3081715 systemd[1]: Stopped Advanced key-value
> store.
> -- Subject: Unit redis-server.service has finished shutting down
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit redis-server.service has finished shutting down. Apr 05 12:38:23 ns3081715 systemd[1]: Starting Advanced key-value store...
> -- Subject: Unit redis-server.service has begun start-up
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit redis-server.service has begun starting up. Apr 05 12:38:23 ns3081715 run-parts[20653]: run-parts: executing
> /etc/redis/redis-server.pre-up.d/00_example Apr 05 12:38:23 ns3081715
> redis-server[20669]: *** FATAL CONFIG FILE ERROR *** Apr 05 12:38:23
> ns3081715 redis-server[20669]: Reading the configuration file, at line
> 108 Apr 05 12:38:23 ns3081715 redis-server[20669]: >>> 'logfile
> /var/log/redis/redis-server.log' Apr 05 12:38:23 ns3081715
> redis-server[20669]: Can't open the log file: Permission denied Apr 05
> 12:38:23 ns3081715 systemd[1]: redis-server.service: Control process
> exited, code=exited status=1 Apr 05 12:38:23 ns3081715 systemd[1]:
> Failed to start Advanced key-value store.
> -- Subject: Unit redis-server.service has failed
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit redis-server.service has failed.
> --
> -- The result is failed. Apr 05 12:38:23 ns3081715 systemd[1]: redis-server.service: Unit entered failed state. Apr 05 12:38:23
> ns3081715 systemd[1]: redis-server.service: Failed with result
> 'exit-code'. Apr 05 12:38:23 ns3081715 systemd[1]:
> redis-server.service: Service hold-off time over, scheduling restart.
> Apr 05 12:38:23 ns3081715 systemd[1]: Stopped Advanced key-value
> store.
> -- Subject: Unit redis-server.service has finished shutting down
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit redis-server.service has finished shutting down. Apr 05 12:38:23 ns3081715 systemd[1]: redis-server.service: Start request
> repeated too quickly. Apr 05 12:38:23 ns3081715 systemd[1]: Failed to
> start Advanced key-value store.
> -- Subject: Unit redis-server.service has failed
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit redis-server.service has failed.
> --
> -- The result is failed. Apr 05 12:38:24 ns3081715 sshd[20498]: Failed password for root from 218.65.30.46 port 47702 ssh2 Apr 05 12:38:24
> ns3081715 sshd[20498]: Received disconnect from 218.65.30.46 port
> 47702:11: [preauth] Apr 05 12:38:24 ns3081715 sshd[20498]:
> Disconnected from 218.65.30.46 port 47702 [preauth] Apr 05 12:38:24
> ns3081715 sshd[20498]: PAM 2 more authentication failures; logname=
> uid=0 euid=0 tty=ssh ruser= rhost=218.65.30.46 user=root Apr 05
> 12:38:24 ns3081715 sshd[20540]: Failed password for root from
> 217.61.5.246 port 42706 ssh2 Apr 05 12:38:24 ns3081715 sshd[20540]: Received disconnect from 217.61.5.246 port 42706:11: disconnected by
> user [preauth] Apr 05 12:38:24 ns3081715 sshd[20540]: Disconnected
> from 217.61.5.246 port 42706 [preauth] Apr 05 12:38:24 ns3081715
> sshd[20540]: PAM 1 more authentication failure; logname= uid=0 euid=0
> tty=ssh ruser= rhost=217.61.5.246 user=root Apr 05 12:38:25 ns3081715
> sshd[20680]: pam_unix(sshd:auth): authentication failure; logname=
> uid=0 euid=0 tty=ssh ruser= rhost=218.65.30.46 user=root
8条答案
按热度按时间iqxoj9l91#
我刚从debian10.1软件包库中安装了redis5.0.3,也遇到了同样的问题。
对我来说,解决方案是将配置文件(读)和日志文件(读-写)的访问权限授予用户redis。
6mzjoqzu2#
我在ubuntu16.04上也遇到过同样的问题,它发生在redis-server软件包更新之后。
服务无法启动,但使用手动运行服务器
会让它开始。
/var/log/redis/redis.log不会提供关于它的有用信息。
我所做的是(在ubutu 16.04上)删除redis-server和 * 它所有的配置文件 *
在/etc/redis中有一个剩余的文件dumb.rdb,因此需要确认:
然后重新安装redis-server
这就帮我解决了问题。
请记住,虽然这是 * 只是 * 在我的系统上。显然,redis服务器无法启动错误可能是由于许多条件在不同的系统,其中一些是例如:
你的里程可能会有变化。
在任何情况下,尝试重新安装,甚至降级到以前的版本不会有什么伤害:)
编辑:更正了一处排印错误
p8h8hvxi3#
Redis工作正常,然后我开始得到这个错误
然后,我尝试直接运行命令(这个命令在大多数情况下都可以向您显示问题)
原来Redis找不到日志文件
解决办法很简单:
6tqwzwtp4#
对我来说,解决办法是:
然后,我已经删除了
redis-server
PID:最后:
fnvucqvd5#
我不得不用
/usr/bin/redis-server /etc/redis/redis.conf
运行redis,然后它说有一个配置错误(错字...)当我用systemctl检查状态时,我看不到这一点。
lstz6jyr6#
对redis.conf文件进行以下修改以重新启动Redis服务器。通过执行以下命令编辑redis.conf文件
纳米/等/红色/红色配置文件
将行bind127.0.0.1::1更改为127.0.0.1将受监督的行no更改为受监督的systemd
保存更改并关闭文件。下一步是启动Redis服务器。执行下面的命令启动Redis服务器并为Redis服务创建必要的符号链接。
systemctl启用redis服务器systemctl守护进程重载
现在一切都准备好了,可以通过执行命令systemctl status redis检查服务的状态来验证它。
dm7nw8vv7#
在
/etc/redis/redis.conf
中修改默认路径和文件位置有一个陷阱,我花了一个晚上才发现,一个系统服务的读写权限不仅取决于文件系统权限,还取决于服务本身的单元文件中授予的权限:如果需要将日志文件和数据库重新定位到默认位置之外的某个位置,则需要根据需要调整
/lib/systemd/system/redis-server.service
中的ReadWriteDirectories
指令。不要忘记运行
systemctl daemon-reload
,您应该可以运行systemctl start redis-server
如果替换了单元文件,则软件包更新可能会破坏修复。
zpgglvta8#
如果运行
redis.service
,端口6379被占用,可能会发生上述错误。因此,禁用默认的redis服务器: