centos7 systemctl 启动 Redis 失败
转自:http://sloger.info/posts/systemd-failed-to-start-redis-in-gentoo
今天启动 Redis 时阻塞很长时间,之后显示启动失败,启动状态如下。
systemd[1]: redis.service start operation timed out. Terminating.
systemd[1]: Failed to start A persistent key-value database.
systemd[1]: Unit redis.service entered failed state.
看了下 service 文件,发现 Systemd 启动命令如下
ExecStart=/usr/sbin/redis-server /etc/redis.conf
手动运行这条命令,发现是正常的,所以猜想是 service 文件的问题,后来发现只需要把 [Service] 部分的 Type=forking 注释掉就行了。
[Service]
# Type=forking
# PIDFile=/var/run/redis/redis.pid
ExecStart=/usr/sbin/redis-server /etc/redis.conf
User=redis
Group=redis
之后重新加载 Service 文件并启动 Redis 服务
sudo systemctl daemon-reload
sudo systemctl start redis
Man pages 对 Systemd 服务启动类型 Type 的解释如下
If set to forking, it is expected that the process configured with ExecStart= will call fork() as part of its start-up. The parent process is expected to exit when start-up is complete and all communication channels are set up. The child continues to run as the main daemon process. This is the behavior of traditional UNIX daemons. If this setting is used, it is recommended to also use the PIDFile= option, so that systemd can identify the main process of the daemon. systemd will proceed with starting follow-up units as soon as the parent process exits.
因为 Redis 配置文件里配置的是
daemonize off
centos7 systemctl 启动 Redis 失败的更多相关文章
- windows启动redis失败
# Warning: no config file specified, using the default config. In order to specify a config file use ...
- Linux启动Redis失败/没有那个文件或目录
没有那个文件或目录问题,可能是你选择的目录不对. 应切换到Redis目录下启动.
- Cassandra3在Centos7下启动失败解决办法
Centos7 安装Cassandra启动过程提示失败,查看结果如下所示: [root@xx ~]# systemctl status cassandra ● cassandra.service - ...
- centos7 启动docker失败
现象:Centos7.3通过yum安装完docker后,启动docker失败 机器的系统版本:CentOS Linux release 7.3.1611 (Core) centos7,执行完安装命令: ...
- centos7 启动docker失败的解决
控制端使用yum install docker安装完成docker后启动docker失败,出现以下信息: Job for docker.service failed because the contr ...
- centos7 vnc 无法systemctl启动
1.centos7 vnc 无法systemctl启动 报错如下:Failed to start Remote desktop service (VNC) 2.解决办法 错误服务脚本名 vncserv ...
- redis 3.2.5单机版安装、使用、systemctl管理Redis启动、停止、开机启动
参照地址 http://www.mamicode.com/info-detail-1488639.html 前提:防火墙安装,然后打开端口,设置开机启动 一.redis源码安装 [root@host- ...
- CentOS7/RHEL7安装Redis步骤详解
CentOS7/RHEL7安装Redis步骤详解 CentOS7/RHEL7安装Redis还是头一次测试安装了,因为centos7升级之后与centos6有比较大的区别了,下面我们就一起来看看Cent ...
- centos7 无法启动网络(service network restart)错误解决办法
centos7 无法启动网络(service network restart)错误解决办法: (以下方法均为网上COPY,同时感谢原博主分享) systemctl status network.ser ...
随机推荐
- Python开发【第十六篇】:AJAX全套
概述 对于WEB应用程序:用户浏览器发送请求,服务器接收并处理请求,然后返回结果,往往返回就是字符串(HTML),浏览器将字符串(HTML)渲染并显示浏览器上. 1.传统的Web应用 一个简单操作需要 ...
- java.util.Date和java.sql.Date的区别和相互转化
java.util.Date是在除了SQL语句的情况下面使用的.java.sql.Date是针对SQL语句使用的,它只包含日期而没有时间部分它 们都有getTime方法返回毫秒数,自然就可以直接构建. ...
- CF456C Boredom (DP)
Boredom CF#260 div2 C. Boredom Codeforces Round #260 C. Boredom time limit per test 1 second memory ...
- protobuf
1.下载地址:https://code.google.com/p/protobuf/downloads/list 安装 ./configure && make && m ...
- JavaScript模板引擎实现数据交互
经过1年的磨练,近期终于稍微明白到,前端是怎么做到企业要求的:数据交互. 1,ajax+json这个是必须学的,但没问题,我们可以通过这个博客来慢慢了解怎么回事? 2,可以通过JS框架和JS模板来实现 ...
- fullPage 全屏滚动【上下滚动】效果
由于个人能力,研究了两天,终于写出来了. 又花了一天的时间成功的将30多行脚本,改成了70多行,我也是够有心的了. 那么接下来就是我制作这个效果的全部过程. 那一年我十七,她十八,在那个夏天里,我们, ...
- Nginx 502 bad gateway问题的解决方法
Nginx 502 Bad Gateway的含义是请求的PHP-CGI已经执行,但是由于某种原因(一般是读取资源的问题)没有执行完毕而导致PHP-CGI进程终止,一般来说Nginx 502 Bad G ...
- js操作json与字符串相互转换
字符串转对象(strJSON代表json字符串) var obj = eval(strJSON); var obj = strJSON.parseJSON(); var obj = JSON.pars ...
- vc++6.0各种报错合集(附:VC++6.0调出打印窗口的方法)
背景: 由于VC++6.0对于现在的我来说,只是一个工具,暂时没有太多的时间分配到这块去深究它,由于不明其原理,因此也只是在此把错误积累下来,以备下次相同错误出现时能快速排除,节省时间. 正文 一.出 ...
- [原创]svn 常见错误总结
错误: Unable to make name in 'X:\nfs\drivers\can_uart\.svn\tmp' 解决: 改变当前文件夹的权限 linux 下显示修改的文件名 参考链接:ht ...