https://blog.csdn.net/qq_31803503/article/details/79246205

本次配置linux版本是CentOS 7

首先将  redis-3.2.3/utils目录下的 redis_init_script 脚本拷贝到  /etc/init.d 下 修改名字为  redis

[root@localhost redis]# cp redis_init_script /etc/init.d/redis

编辑一下redis文件,添加一段注释在文件头部位置

#!/bin/sh

#

# Simple Redis init.d script conceived to work on Linux systems

# as it does use of the /proc filesystem.

# chkconfig: 2345 90 10

# description: Redis is a persistent key-value database

到这个我们需要拷贝一下redis.conf文件到/etc/redis目录下

[root@localhost init.d]# mkdir /etc/redis

[root@localhost redis]# cp redis.conf /etc/redis/6379.conf

编辑一下6379.conf文件,将daemonize 的 no 值改成 yes

以上修改文件的部分基本上结束啦,接下来敲一下简单的命令就搞定了

[root@localhost redis]# chmod +x /etc/init.d/redis

[root@localhost redis]# chkconfig redis on

到此结束所有的简单的配置啦,我们测一下redis启动和关闭吧

[root@localhost redis]# service redis start

[root@localhost redis]# service redis stop

都OK啦,唯一剩下的测一下reboot瞧一下redis服务是否启动

[root@localhost init.d]# ps aux|grep redis

root 2573 0.1 0.3 33328 7492 ? Ssl 14:07 0:00 /usr/local/redis/bin/redis-server *:6379

root 2577 0.0 0.0 112668 968 pts/0 S+ 14:07 0:00 grep --color=auto redis

(注意:redis_init_script 文件的redis启动路径位置是否正确,不正确会出现No such file or directory错误)

Linux配置redis开机启动(CentOS 7)的更多相关文章

  1. linux 配置Tomcat开机启动

    一台安装有tomcat的linux服务器 方法/步骤   1 请自行下载安装配置tomcat的服务器环境 本经验仅仅介绍如何配置tomcat的开机自动启动 2 切换到tomcat/bin目录下 用vi ...

  2. Linux 设置Redis开机启动

    Debian 也就是Ubun16.04 亲测可用 http://www.tuicool.com/articles/UR73ieq Centos7.0 http://blog.csdn.net/alex ...

  3. 转:CentOS7 下 Redis4 安装与配置教程(Redis开机启动)

    转 https://ken.io/note/centos7-redis4-setup 一.前言 1.本教程主要内容 Redis安装与测试 Redis远程访问配置 Redis开机启动配置 2.本教程环境 ...

  4. linux(centos)上配置nginx、mysql、php-fpm、redis开机启动<转>

    原文 http://levi.cg.am/archives/2925 I.nginx开机启动 在/etc/init.d/目录下创建脚本 1 vi  /etc/init.d/nginx 更改脚本权限 1 ...

  5. linux教程:配置Tomcat开机启动

    我们在linux下安装好tomcat之后:经常是需要配置到开机启动的: 这样的话就不需要我们每次重启linux服务器之后自己在登陆运行startup.sh文件启动tomcat了 本次的演示环境是在ce ...

  6. linux下配置Tomcat开机启动

    我们在linux下安装好tomcat之后:经常是需要配置到开机启动的: 这样的话就不需要我们每次重启linux服务器之后自己在登陆运行startup.sh文件启动tomcat了 本次的演示环境是在ce ...

  7. Linux Redis自动启动,Redis开机启动,Linux Redis设置开机启动

    Linux Redis自动启动,Redis开机启动,Linux Redis设置开机启动 >>>>>>>>>>>>>> ...

  8. Linux Redis安装,Linux如何安装Redis,Linux Redis自动启动,Redis开机启动

    Linux Redis安装,Linux如何安装Redis,Linux Redis自动启动,Redis开机启动 >>>>>>>>>>>& ...

  9. linux下tomcat开机启动简单配置

    1.个人标记 caicongyang http://blog.csdn.net/caicongyang 2.正文 在linux文件/etc/rc.d/rc.local的末尾加入例如以下行就可以: ex ...

随机推荐

  1. 洛谷p1008 三连击

    https://www.luogu.org/problemnew/show/P1008 题目描述 将1,2,3,4,5,6,7,8,9共9个数分成3组,分别组成3个三位数,且使这3个三位数的值构成1: ...

  2. python函数当容器

    def func(): pass func2 = func func2() i = [func,func2] for a in i: a() 函数名就是内存地址,加()代表执行

  3. 基于TensorFlow理解CNN中的padding参数

    1 TensorFlow中用到padding的地方 在TensorFlow中用到padding的地方主要有tf.nn.conv2d(),tf.nn.max_pool(),tf.nn.avg_pool( ...

  4. LINUX软件包的安装、升级、删除

    1.安装和升级一个rpm 包: [root@localhost beinan]#rpm -vih file.rpm 注:这个是用来安装一个新的rpm 包: [root@localhost beinan ...

  5. Win10操作系统安装—U盘作为启动盘—系统安装到固态硬盘中

    利用U盘作为启动盘安装win10操作系统 1.U盘制作为启动盘,制作工具,我选择的是大白菜(个人觉得还是很好用的) 大白菜http://www.bigbaicai.com/rjjc/syjc/3269 ...

  6. cmd命令调用powershell脚本方法

    cmd方法: powershell -command ". ('ps1脚本路径'); WriteInfo  -param 'param参数值'" ps1脚本代码: function ...

  7. Python 原生2种 邮件发送(发送验证码) 的方法

    import smtplib from email.mime.text import MIMEText # 第三方 SMTP 服务 mail_host = "smtp.sina.cn&quo ...

  8. JavaScript模板引擎实例应用(转)

    本文将举实例向大家讲解几个常用模板引擎的简单使用. 演示地址:模板引擎示例http://demo.52fhy.com/jstemp/ 准备工作 演示数据:blog.json结构: { "li ...

  9. Python 爬取高清桌面壁纸

    今天写了一个脚本用来爬取ZOL桌面壁纸网站的高清图片: 链接:http://desk.zol.com.cn/1920x1080/ 本程序只爬了美女板块的图片,若要下载其他板块,只需修改程序中的&quo ...

  10. https方式nginx 代理tomcat访问不带www的域名301重定向跳转到www的域名帮助seo集中权重

    比如我要把 http://gucanhui.com http://www.gucanhui.com 跳转到https://www.gucanhui.com 用F12的network可以看到状态码301 ...