zoukankan      html  css  js  c++  java
  • Centos7 redis设置开机自启动

    配置redis

    1.设置redis.conf中daemonize为yes,requirepass为你的redis密码,bind注释掉禁用本机访问绑定,确保守护进程开启,也就是在后台可以运行.

    vi /opt/redis/redis.conf

    2.复制redis配置文件(启动脚本需要用到配置文件内容,所以要复制)

    mkdir /etc/redis
    cp /usr/local/redis/redis.conf /etc/redis/6379.conf

    3.设置redis.conf中daemonize为yes,确保守护进程开启,也就是在后台可以运行.

    find / -name redis_init_script
    cp /usr/local/redis/utils/redis_init_script /etc/init.d/redis

    4.修改启动脚本参数

    vi /etc/init.d/redis

    5.启动redis
    • 打开redis命令:service redis start
    • 关闭redis命令:service redis stop
    • 设为开机启动:chkconfig redis on
    • 设为开机关闭:chkconfig redis off

    参考与致谢:https://www.cnblogs.com/therunningfish/p/9535022.html

  • 相关阅读:
    2-1(续)
    2-1
    28-69. Sqrt(x)
    27-75. Sort Colors
    26-78. Subsets
    MySQL--->存储引擎及图形化工具
    MySQL--->高级对象
    MySQL--->常用函数
    MySQL--->多表查询
    MySQL--->高级查询
  • 原文地址:https://www.cnblogs.com/gme5/p/11769720.html
Copyright © 2011-2022 走看看