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                                     :::*  
  • 相关阅读:
    jmeter(八)断言
    jmeter(七)定时器
    jmeter(六)元件的作用域与执行顺序
    JS 正则详解
    表单验证
    ubuntu16.04安装Grafana
    Crontab详细用法-定时任务详解
    ubuntu16.04 安装influxdb,简单使用
    jQuery CSS操作 点赞样式
    jQuery文档处理
  • 原文地址:https://www.cnblogs.com/bo-ke/p/9965991.html
Copyright © 2011-2022 走看看