zoukankan      html  css  js  c++  java
  • 编译安装redis4.0

     下载redis4.0的安装包:http://download.redis.io/releases/redis-4.0.11.tar.gz

    这里用的是已经下载到电脑上,只需上传即可

    解压缩

    [root@67 ~]# tar xvf redis-4.0.11.tar.gz 

    查看,会生成redis-4.0.11

    [root@67 ~]# ls
        redis-4.0.11

    移动程序包

    [root@67 ~]# mv redis-4.0.11 /usr/local/redis

    创建文件保存目录

    [root@67 ~]# mkdir /redis

    创建用户

    [root@67 ~]# useradd redis

    生成配置文件

    [root@67 ~]# cp -a  /usr/local/redis/redis.conf /redis

    修改配置文件

    [root@67 ~]# vim /redis/redis.conf
     68 bind 10.220.5.67
    91 port 6379 <<<默认6379
    135 daemonize yes <<<是否工作在后台运行模式
    157 pidfile /redis/redis_6379.pid
    170 logfile /redis/redis.log
    262 dir /redis

    修改属主,属组

    [root@67 ~]# chown -R redis.redis /redis

    启动,并查看

    [root@67 ~]# /usr/local/redis/src/redis-server /redis/redis.conf                                        
    [root@67 ~]# ss -tnl
    State       Recv-Q Send-Q          Local Address:Port                         Peer Address:Port              
    LISTEN      0      128               10.220.5.67:6379                                    *:*                  
    LISTEN      0      128                         *:22                                      *:*                  
    LISTEN      0      128                        :::22        

    为了以后启动方便,需要导出二进制文件

    [root@67 ~]# vim /etc/profile.d/redis.sh

    PATH=$PATH:/usr/local/redis/
    export PATH

    [root@67 ~]# source /etc/profile.d/redis.sh

    先关闭redis,由于是在做实验,用暴力的方法关闭

    [root@67 ~]# pkill redis
    [root@67 ~]# ss -tnl
    State       Recv-Q Send-Q          Local Address:Port                         Peer Address:Port              
    LISTEN      0      128                         *:22                                      *:*                  
    LISTEN      0      128                        :::22                                     :::*                

    使用二进制命令启动

    [root@67 ~]# redis-server /redis/redis.conf
    [root@67 ~]# ss -tnl
    State       Recv-Q Send-Q          Local Address:Port                         Peer Address:Port              
    LISTEN      0      128               10.220.5.67:6379                                    *:*                  
    LISTEN      0      128                         *:22                                      *:*                  
    LISTEN      0      128               10.220.5.67:16379                                   *:*                  
    LISTEN      0      128                        :::22                                     :::*  
  • 相关阅读:
    day06作业
    day04_ATM项目说明书
    ATM+购物车基本思路流程
    装饰器、迭代器、生成器、递归、匿名函数、面向过程编程、三元表达式6
    day05函数部分
    自制七段数码管源码
    字符串格式化
    字符串表示
    格式化输出
    python入门——列表类型、元组、字典类型
  • 原文地址:https://www.cnblogs.com/bo-ke/p/9965991.html
Copyright © 2011-2022 走看看