redis - 无法在 Centos 7 上启动 redis 服务器

标签 redis centos centos7

我正在尝试安装 OpenVas,但在 CentOS 上启动 Redis 服务器时遇到问题。我应该怎么做才能排除故障?

我通过运行安装 openvas(这会安装 redis 和所有其他依赖项):

# yum install openvas

我尝试通过运行来启动它:

# systemctl enable redis && systemctl restart redis

我通过运行检查 redis 的 systemctl 状态日志:

# systemctl status redis -l

它显示连接被拒绝并且无法启动:

Mar 19 12:37:13 hostname.local systemd[1]: Started Redis persistent key-value database.
Mar 19 12:37:13 hostname.local systemd[1]: Starting Redis persistent key-value database...
Mar 19 12:37:14 hostname.local systemd[1]: redis.service: main process exited, code=exited, status=1/FAILURE
Mar 19 12:37:14 hostname.local redis-shutdown[19127]: Could not connect to Redis at 127.0.0.1:6379: Connection refused
Mar 19 12:37:14 hostname.local systemd[1]: redis.service: control process exited, code=exited status=1
Mar 19 12:37:14 hostname.local systemd[1]: Unit redis.service entered failed state.
Mar 19 12:37:14 hostname.local systemd[1]: redis.service failed.

最佳答案

首先,查看/var/log/redis/redis.log

我尝试使用这篇文章进行设置 https://forums.atomicorp.com/viewtopic.php?f=31&t=8047

1) Disable SELINUX.
Edit /etc/selinux/config, save and reboot
2) Add required packages
yum install wget bzip2 texlive net-tools alien
3) Add Atomicorp repo
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
4) Install OpenVAS 
yum install openvas
5) edit /etc/redis.conf. Add/uncomment the following
unixsocket /tmp/redis.sock
unixsocketperm 700
6) Restart Redis
systemctl enable redis && systemctl restart redis

redis ip 启动并运行

[root@localhost ~]# cat /var/log/redis/redis.log
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 3.2.3 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 29645
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

29645:M 21 Mar 14:55:00.551 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
29645:M 21 Mar 14:55:00.551 # Server started, Redis version 3.2.3
29645:M 21 Mar 14:55:00.551 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
29645:M 21 Mar 14:55:00.551 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
29645:M 21 Mar 14:55:00.551 * The server is now ready to accept connections on port 6379

关于redis - 无法在 Centos 7 上启动 redis 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42891415/

相关文章:

ruby-on-rails - Redis 订阅 + Rails ActionController::Live 挂起

ruby-on-rails - redis local SocketError : getaddrinfo: nodename nor servname provided, or not known

ftp - **不匹配的条目** pam_listfile(proftpd :auth): Couldn't open/etc/ftpusers

docker - Kubernetes 1.18警告ImageGCFailed错误无法获取imageFs信息: unable to find data in memory cache

redis - 如何使用 NX 选项设置值并使用 ServiceStack.Redis 过期?

redis - 如何禁用redis的持久性?

ruby - Gitlab 配置问题::NGINX Unicorn 端口冲突

centos - 由于服务器配置不正确,Cpanel 许可证更新失败

kubernetes - 无法验证 kubernetes repo 的签名

apache - 运行时错误 : populate() isn't reentrant on CentOS 7 | django 1. 9 | python 3