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 ...
随机推荐
- css3d总结
3d舞台 设置 perspective(景深): length, 可以设置overflow:hidden 3d舞台下 -> 3d元素容器 设置 transform-style: preserv ...
- php.ini中有关安全的设置
php的默认配置文件在 /usr/local/apache2/conf/php.ini,通过为了使你的web更安全,我们需要对php.ini进行一些设置! (1) 打开php的安全模式 php的安全模 ...
- zabbix进程构成
了解完zabbix特性之后,本该进入zabbix安装教程,但是我觉得在安装之前我们很有必要了解一下zabbix进程组成结构,默认情况下zabbix包含5个程序:zabbix_agentd.zabbix ...
- Web 安全测试
http://blog.sina.com.cn/s/blog_a1bbddc70101dt12.html http://blog.csdn.net/pdn2000/article/details/64 ...
- mysql 如何用一条SQL将一张表里的数据插入到另一张表 3个例子
1. 表结构完全一样 insert into 表1 select * from 表2 2. 表结构不一样(这种情况下得指定列名) insert into 表1 (列名1,列名2,列名3) selec ...
- [Angularjs]ng-include 包含
写在前面 有时我们需要动态的创建一些标签,或者在收到服务端返回的json,创建一些标签然后找到页面上的元素,通过innerHTML写入到页面上面.angularjs也为我们提供了一种比较方便操作方式, ...
- php开发工具之火狐浏览器插件
相信做开发的都有一种火狐情怀吧! 下面来介绍下一些自己在php开发工程中用到几个火狐浏览器插件. 1.[firebug]: 这个插件可以说是一个神奇,功能不用过对介绍. 2.[hostAdmin]: ...
- Linux服务器管理: 系统的进程管理top命令
查看系统运行状态的命令top [root@localhost~]#top [选项] 选项: -d 秒数 指定top命令每个几秒更新.默认为3秒 在top命令的交互模式当中可以执行的命令 ?或h 查看帮 ...
- css3 实现逐帧动画
css3 实现逐帧动画 实现逐帧动画需要使用到的是Animation动画,该CSS3的Animation有八个属性:分别是如下:1: animation-name2: animation-durati ...
- 2015年11月26日 Java基础系列(三)ThreadLocal类初级学习
序,ThreadLocal类是为了解决多线程的安全问题.线程安全的意思也就是说每个线程操作自己的变量,不要对其他线程的值造成影响. 在很多情况下,ThreadLocal比直接使用synchronize ...