redis-server不能在服务器上工作我有nginx,apache,php和mysql
是否有任何包可能导致下面的问题
PS:当我安装BBB
时出现此错误https://github.com/bigbluebutton/bbb-install
redis-server.service:退出控制进程,代码=退出状态= 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
答案 0 :(得分:2)
我刚从debian 10.1软件包存储库重新安装了Redis 5.0.3时遇到了同样的问题。
对我来说,解决方案是将配置文件(读取)和日志文件(读写)的访问权限授予用户redis。
chown -R redis:redis /var/log/redis
chmod -R u+rwX,g+rwX,u+rx /var/log/redis
chmod +r /etc/redis/redis.conf
答案 1 :(得分:1)
对我来说,解决方案是:
sudo ps aux | grep redis
然后我杀死了 redis-server
PID:
sudo kill 7453
最后:
sudo service redis start
答案 2 :(得分:0)
我在ubuntu 16.04上遇到了同样的问题。更新redis-server软件包后发生了这种情况。
服务无法启动,但是使用
手动运行服务器 /usr/bin/redis-server /etc/redis/redis.conf
让我们开始吧。
/var/log/redis/redis.log无法提供有关它的有用信息。
我所做的是(在ubutu 16.04上)删除redis-server和所有配置文件
sudo apt-get --purge remove redis-server
/ etc / redis中有一个剩余文件dumb.rdb,因此请确保:
sudo -rf /etc/redis/dump.rdb
然后重新安装redis-server
sudo apt-get update
sudo apt-get install redis-server
那为我解决了。
请记住,尽管这只是我系统上的 。显然,redis服务器无法启动错误可能是由于不同系统上的许多情况所致,例如:
您的里程可能会有所不同。
无论如何尝试重新安装,甚至降级到以前的版本都不会造成伤害:)
答案 3 :(得分:0)
更改为redis.conf 对redis.conf文件进行以下更改,以重新启动Redis Server。通过执行以下命令编辑redis.conf文件
nano /etc/redis/redis.conf
将行绑定127.0.0.1::1更改为127.0.0.1 将受监控的行更改为受监控的系统
保存更改并关闭文件。下一步是启动Redis服务器。执行以下命令以启动Redis服务器并为Redis服务创建必要的符号链接。
systemctl启用redis-server systemctl守护程序重新加载
现在您已经准备就绪,可以通过执行命令systemctl status redis检查服务的状态来验证它。
答案 4 :(得分:0)
在/etc/redis/redis.conf
中更改默认路径和文件位置时存在陷阱。我花了一个晚上才发现,系统服务的读写权限不仅取决于文件系统权限,还取决于服务本身的单元文件中授予的权限:
如果需要将日志文件和数据库重新放置在默认位置之外的某个位置,则需要根据需要调整ReadWriteDirectories
中的/lib/systemd/system/redis-server.service
指令。
别忘了运行systemctl daemon-reload
,您应该可以systemctl start redis-server
如果替换了单位文件,则软件包更新可能会破坏此修复程序。
答案 5 :(得分:0)
Redis 工作正常,然后我开始收到此错误
redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-07-19 09:43:47 EEST; 10s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 161736 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)
然后,我尝试直接运行该命令(此命令在大多数情况下可以显示问题)
/usr/bin/redis-server /etc/redis/redis.conf
原来是Redis找不到日志文件
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 171
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: No such file or directory
解决方案很简单:
sudo mkdir -p /var/log/redis/ && sudo touch /var/log/redis/redis-server.log && sudo chown redis:redis /var/log/redis/redis-server.log